From c91981e60ad110660d49daaef9199a142c80dfad Mon Sep 17 00:00:00 2001 From: Lavish Singal Date: Wed, 3 Jun 2026 11:15:27 +0530 Subject: [PATCH 1/2] Add Microsoft Azure Resilience Management SDK (beta.1) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../CHANGELOG.md | 6 + .../README.md | 102 + .../SAMPLE.md | 4103 +++++++++++++++++ .../pom.xml | 74 + .../ResilienceManagementManager.java | 538 +++ .../fluent/DrillResourcesClient.java | 77 + .../fluent/DrillRunResourcesClient.java | 80 + .../fluent/DrillRunsClient.java | 407 ++ .../fluent/DrillsClient.java | 557 +++ .../fluent/EnrollmentsClient.java | 200 + .../fluent/GoalAssignmentsClient.java | 425 ++ .../fluent/GoalResourcesClient.java | 77 + .../fluent/GoalTemplatesClient.java | 244 + .../fluent/OperationStatusClient.java | 43 + .../fluent/OperationsClient.java | 40 + .../fluent/RecoveryJobResourcesClient.java | 81 + .../fluent/RecoveryJobsClient.java | 310 ++ .../fluent/RecoveryPlanActionsClient.java | 983 ++++ .../fluent/RecoveryPlansClient.java | 251 + .../fluent/RecoveryResourcesClient.java | 74 + .../ResilienceManagementManagementClient.java | 167 + .../fluent/UnifiedResilienceItemsClient.java | 73 + .../fluent/UsagePlansClient.java | 269 ++ .../fluent/models/DrillInner.java | 184 + .../fluent/models/DrillResourceInner.java | 144 + .../fluent/models/DrillRunInner.java | 144 + .../fluent/models/DrillRunResourceInner.java | 144 + .../fluent/models/EnrollmentInner.java | 155 + .../fluent/models/GoalAssignmentInner.java | 155 + .../fluent/models/GoalResourceInner.java | 155 + .../fluent/models/GoalTemplateInner.java | 155 + .../fluent/models/OperationInner.java | 150 + .../models/OperationStatusResultInner.java | 222 + .../fluent/models/RecoveryJobInner.java | 144 + .../models/RecoveryJobResourceInner.java | 144 + .../RecoveryPlanActionBaseResponseInner.java | 77 + .../fluent/models/RecoveryPlanInner.java | 184 + .../fluent/models/RecoveryResourceInner.java | 155 + .../RecoveryResourceQualificationInner.java | 96 + .../models/UnifiedResilienceItemInner.java | 145 + .../UpdateRecoveryResourcesResponseInner.java | 81 + .../fluent/models/UsagePlanInner.java | 181 + ...ForRecoveryOperationBaseResponseInner.java | 82 + .../fluent/models/package-info.java | 8 + .../fluent/package-info.java | 8 + .../implementation/DrillImpl.java | 55 + .../implementation/DrillResourceImpl.java | 50 + .../DrillResourcesClientImpl.java | 390 ++ .../implementation/DrillResourcesImpl.java | 66 + .../implementation/DrillRunImpl.java | 50 + .../implementation/DrillRunResourceImpl.java | 50 + .../DrillRunResourcesClientImpl.java | 376 ++ .../implementation/DrillRunResourcesImpl.java | 69 + .../implementation/DrillRunsClientImpl.java | 1390 ++++++ .../implementation/DrillRunsImpl.java | 115 + .../implementation/DrillsClientImpl.java | 1884 ++++++++ .../implementation/DrillsImpl.java | 147 + .../implementation/EnrollmentImpl.java | 130 + .../implementation/EnrollmentsClientImpl.java | 755 +++ .../implementation/EnrollmentsImpl.java | 152 + .../implementation/GoalAssignmentImpl.java | 50 + .../GoalAssignmentsClientImpl.java | 1513 ++++++ .../implementation/GoalAssignmentsImpl.java | 119 + .../implementation/GoalResourceImpl.java | 50 + .../GoalResourcesClientImpl.java | 395 ++ .../implementation/GoalResourcesImpl.java | 66 + .../implementation/GoalTemplateImpl.java | 50 + .../GoalTemplatesClientImpl.java | 931 ++++ .../implementation/GoalTemplatesImpl.java | 100 + .../implementation/OperationImpl.java | 51 + .../OperationStatusClientImpl.java | 144 + .../implementation/OperationStatusImpl.java | 52 + .../OperationStatusResultImpl.java | 76 + .../implementation/OperationsClientImpl.java | 242 + .../implementation/OperationsImpl.java | 45 + .../implementation/RecoveryJobImpl.java | 50 + .../RecoveryJobResourceImpl.java | 50 + .../RecoveryJobResourcesClientImpl.java | 383 ++ .../RecoveryJobResourcesImpl.java | 70 + .../RecoveryJobsClientImpl.java | 1037 +++++ .../implementation/RecoveryJobsImpl.java | 98 + .../RecoveryPlanActionBaseResponseImpl.java | 32 + .../RecoveryPlanActionsClientImpl.java | 3186 +++++++++++++ .../RecoveryPlanActionsImpl.java | 314 ++ .../implementation/RecoveryPlanImpl.java | 55 + .../RecoveryPlansClientImpl.java | 948 ++++ .../implementation/RecoveryPlansImpl.java | 110 + .../implementation/RecoveryResourceImpl.java | 50 + .../RecoveryResourceQualificationImpl.java | 44 + .../RecoveryResourcesClientImpl.java | 363 ++ .../implementation/RecoveryResourcesImpl.java | 66 + ...enceManagementManagementClientBuilder.java | 138 + ...ilienceManagementManagementClientImpl.java | 564 +++ .../implementation/ResourceManagerUtils.java | 195 + .../UnifiedResilienceItemImpl.java | 50 + .../UnifiedResilienceItemsClientImpl.java | 380 ++ .../UnifiedResilienceItemsImpl.java | 66 + .../UpdateRecoveryResourcesResponseImpl.java | 44 + .../implementation/UsagePlanImpl.java | 178 + .../implementation/UsagePlansClientImpl.java | 1097 +++++ .../implementation/UsagePlansImpl.java | 142 + ...eForRecoveryOperationBaseResponseImpl.java | 44 + .../models/DrillListResult.java | 95 + .../models/DrillResourceListResult.java | 95 + .../models/DrillRunListResult.java | 95 + .../models/DrillRunResourceListResult.java | 96 + .../models/EnrollmentListResult.java | 95 + .../models/GoalAssignmentListResult.java | 96 + .../models/GoalResourceListResult.java | 95 + .../models/GoalTemplateListResult.java | 95 + .../models/OperationListResult.java | 96 + .../models/RecoveryJobListResult.java | 95 + .../models/RecoveryJobResourceListResult.java | 97 + .../models/RecoveryPlanListResult.java | 95 + .../models/RecoveryResourceListResult.java | 96 + .../UnifiedResilienceItemListResult.java | 97 + .../models/UsagePlanListResult.java | 95 + .../implementation/package-info.java | 8 + .../models/ActionTask.java | 56 + .../models/ActionType.java | 46 + .../models/AddOrUpdateResourcesRequest.java | 144 + .../models/ArmResponseErrorResponse.java | 76 + .../models/AssetPropertiesOfDrill.java | 145 + .../models/AssociatedIdentity.java | 114 + .../models/AttentionReason.java | 463 ++ .../models/AttestationState.java | 51 + .../models/AutoFailover.java | 51 + .../ChaosResourcePropertiesOfDrill.java | 152 + .../models/CommentType.java | 51 + .../models/ConfirmationStatus.java | 61 + .../models/CustomFaultDetails.java | 114 + .../models/DiskReprotectInputDetails.java | 113 + .../resiliencemanagement/models/Drill.java | 62 + .../models/DrillAttestation.java | 51 + .../models/DrillEndRequest.java | 114 + .../models/DrillMode.java | 46 + .../models/DrillProperties.java | 546 +++ .../models/DrillResource.java | 55 + .../models/DrillResourceAttentionReason.java | 136 + .../models/DrillResourceFaultState.java | 56 + .../models/DrillResourceInclusionState.java | 51 + .../models/DrillResourceProperties.java | 413 ++ .../models/DrillResourceReadinessState.java | 51 + .../models/DrillResourceState.java | 67 + .../models/DrillResources.java | 70 + .../resiliencemanagement/models/DrillRun.java | 55 + .../models/DrillRunAddNotesRequest.java | 120 + .../models/DrillRunFailoverRequest.java | 114 + .../models/DrillRunOperationVerbs.java | 61 + .../models/DrillRunProperties.java | 210 + .../models/DrillRunResource.java | 55 + .../models/DrillRunResourceProperties.java | 130 + .../models/DrillRunResources.java | 72 + .../models/DrillRunSubtasks.java | 66 + .../models/DrillRuns.java | 213 + .../models/DrillStartRequest.java | 86 + .../models/DrillType.java | 51 + .../models/DrillUpdate.java | 113 + .../models/DrillUpdateProperties.java | 200 + .../resiliencemanagement/models/Drills.java | 277 ++ .../models/Enrollment.java | 189 + .../models/EnrollmentProperties.java | 120 + .../models/Enrollments.java | 144 + .../models/ErrorDetails.java | 112 + .../models/ExclusionReason.java | 56 + .../models/ExclusionState.java | 51 + .../models/ExecutionConfigurations.java | 86 + .../models/ExecutionReadinessState.java | 51 + .../models/ExecutionState.java | 56 + .../models/ExtensionObjectState.java | 51 + .../models/FailoverDirectionTypes.java | 46 + .../models/FailoverRequest.java | 116 + .../models/FailoverRequestProperties.java | 151 + .../models/FailoverState.java | 61 + .../models/FaultDetails.java | 145 + .../models/FaultProperties.java | 147 + .../models/ForceInclusionAndUpdate.java | 51 + .../models/GoalAssignment.java | 55 + .../models/GoalAssignmentProperties.java | 182 + .../models/GoalAssignmentType.java | 46 + .../models/GoalAssignments.java | 218 + .../models/GoalResource.java | 55 + .../models/GoalResourceProperties.java | 321 ++ .../models/GoalResources.java | 70 + .../models/GoalTemplate.java | 55 + .../models/GoalTemplateProperties.java | 244 + .../models/GoalTemplates.java | 141 + .../resiliencemanagement/models/GoalType.java | 46 + .../models/GoalsData.java | 257 ++ .../resiliencemanagement/models/HAStatus.java | 51 + .../models/IncludeOrUpdateResource.java | 114 + .../models/InitialConfig.java | 51 + .../models/IsoDuration.java | 61 + .../models/JobErrorInfo.java | 107 + .../models/JobExtendedInfo.java | 91 + .../models/JobProperties.java | 440 ++ .../models/JobResourceProperties.java | 468 ++ .../models/JobResourceType.java | 56 + .../models/JobRetryDetails.java | 180 + .../models/JobStatus.java | 96 + .../models/JobTaskDetail.java | 245 + .../models/JobTriggeredBy.java | 51 + .../resiliencemanagement/models/JobType.java | 56 + .../models/JobUserComment.java | 108 + .../models/LastRunProperties.java | 126 + .../ManagedOnBehalfOfConfiguration.java | 77 + .../models/ManagedServiceIdentity.java | 154 + .../models/ManagedServiceIdentityType.java | 62 + .../models/MarkAsCompleteRequest.java | 86 + .../models/MembershipType.java | 56 + .../models/MoboBrokerResource.java | 78 + .../models/MonitoringPropertiesOfDrill.java | 157 + .../models/Operation.java | 58 + .../models/OperationDisplay.java | 128 + .../models/OperationQualificationDetails.java | 98 + .../models/OperationStatus.java | 38 + .../models/OperationStatusResult.java | 86 + .../models/Operations.java | 35 + .../resiliencemanagement/models/Origin.java | 57 + .../models/ProvisioningState.java | 76 + .../models/QualificationState.java | 61 + .../models/RBACSetupMode.java | 56 + .../models/RBACState.java | 51 + .../ReasonForRequestingConfirmation.java | 53 + .../models/RecommendCapacityRequest.java | 92 + .../models/RecommendationsData.java | 76 + .../RecommendationsHighAvailabilityData.java | 139 + .../models/RecoveryActionRequest.java | 85 + .../models/RecoveryGroup.java | 154 + .../models/RecoveryGroupActionSettings.java | 138 + .../models/RecoveryGroupActionType.java | 51 + .../models/RecoveryGroupBaseAction.java | 191 + .../RecoveryGroupCustomRunbookAction.java | 203 + .../models/RecoveryGroupManualAction.java | 111 + .../models/RecoveryGroupProperties.java | 203 + .../models/RecoveryGroupsSetting.java | 120 + .../models/RecoveryJob.java | 55 + .../models/RecoveryJobProperties.java | 127 + .../models/RecoveryJobResource.java | 55 + .../models/RecoveryJobResourceProperties.java | 165 + .../models/RecoveryJobResources.java | 73 + .../models/RecoveryJobs.java | 176 + .../models/RecoveryOperationNames.java | 67 + .../models/RecoveryOperationStatus.java | 81 + .../models/RecoveryPlan.java | 62 + .../RecoveryPlanActionBaseResponse.java | 27 + .../models/RecoveryPlanActions.java | 453 ++ .../models/RecoveryPlanExclusionReason.java | 52 + .../RecoveryPlanFailoverOperationStatus.java | 130 + .../models/RecoveryPlanOperationStatus.java | 110 + .../models/RecoveryPlanProperties.java | 230 + .../models/RecoveryPlanPropertiesOfDrill.java | 120 + .../models/RecoveryPlanState.java | 56 + .../models/RecoveryPlanType.java | 51 + .../models/RecoveryPlans.java | 144 + .../models/RecoveryResource.java | 55 + .../models/RecoveryResourceProperties.java | 402 ++ .../models/RecoveryResourceQualification.java | 34 + .../models/RecoveryResources.java | 67 + .../models/RegionalDrillProperties.java | 168 + .../RelativeResourceCompositionState.java | 51 + .../models/ReprotectRequest.java | 86 + .../models/ReprotectRequestProperties.java | 90 + .../models/RequirementSelected.java | 51 + .../models/ResilienceHealthStatus.java | 56 + ...ResourceBaseProtectionSolutionSetting.java | 108 + .../ResourceCustomProtectionAction.java | 87 + .../ResourceCustomProtectionSetting.java | 227 + .../models/ResourceInclusionState.java | 51 + .../models/ResourceLists.java | 150 + ...sourceNativeProtectionSolutionSetting.java | 78 + .../ResourceProtectionSolutionSettings.java | 288 ++ .../ResourceProtectionSolutionType.java | 66 + .../models/ResourceProtectionStatus.java | 62 + .../models/ResourceReplicationRole.java | 56 + ...ResourceSiteRecoveryProtectionSetting.java | 168 + .../ResourceSiteRecoveryReprotectParams.java | 93 + ...SiteRecoveryTestFailoverCleanupParams.java | 87 + ...esourceSiteRecoveryTestFailoverParams.java | 89 + .../models/ResourceTypeCategories.java | 47 + .../models/ServiceGroupMembership.java | 93 + .../models/ServiceLevelResource.java | 114 + .../models/SolutionDisplayName.java | 52 + .../models/SupportedVerbsForStage.java | 96 + .../models/SystemMetadata.java | 95 + .../models/TestFailoverCleanupRequest.java | 85 + .../models/TestFailoverState.java | 51 + .../models/UnifiedResilienceItem.java | 55 + .../UnifiedResilienceItemProperties.java | 134 + ...fiedResilienceItemRequirementSelected.java | 57 + .../models/UnifiedResilienceItems.java | 65 + .../models/UpdateGoalResourceRequest.java | 90 + .../UpdateRecoveryResourcesRequest.java | 125 + .../UpdateRecoveryResourcesResponse.java | 29 + .../models/UsagePlan.java | 252 + .../models/UsagePlanProperties.java | 119 + .../models/UsagePlanTagsUpdate.java | 87 + .../models/UsagePlanType.java | 51 + .../models/UsagePlans.java | 157 + .../models/UserAssignedIdentity.java | 89 + ...erConfirmationForHighAvailabilityItem.java | 153 + .../models/UserConsent.java | 51 + .../models/VMPresent.java | 51 + .../ValidateForExecutionProperties.java | 90 + .../models/ValidateForExecutionRequest.java | 87 + .../models/ValidateForOperationRequest.java | 87 + ...idateForRecoveryOperationBaseResponse.java | 29 + .../models/ZonalDrillProperties.java | 183 + .../models/package-info.java | 8 + .../resiliencemanagement/package-info.java | 8 + .../src/main/java/module-info.java | 16 + ...manager-resiliencemanagement_metadata.json | 1 + .../proxy-config.json | 1 + .../reflect-config.json | 1 + ...rcemanager-resiliencemanagement.properties | 1 + .../generated/DrillResourcesGetSamples.java | 25 + .../generated/DrillResourcesListSamples.java | 24 + .../DrillRunResourcesGetSamples.java | 25 + .../DrillRunResourcesListSamples.java | 25 + .../generated/DrillRunsAddNotesSamples.java | 27 + .../generated/DrillRunsFailOverSamples.java | 37 + .../generated/DrillRunsGetSamples.java | 25 + .../generated/DrillRunsListSamples.java | 23 + .../DrillRunsMarkAsCompleteSamples.java | 29 + .../generated/DrillRunsReprotectSamples.java | 25 + .../generated/DrillRunsResumeSamples.java | 25 + .../DrillsAddOrUpdateResourcesSamples.java | 60 + .../generated/DrillsCreateSamples.java | 73 + .../generated/DrillsDeleteSamples.java | 23 + .../generated/DrillsEndSamples.java | 30 + .../generated/DrillsGetSamples.java | 23 + .../generated/DrillsListSamples.java | 23 + .../DrillsResyncReadinessCheckSamples.java | 24 + .../generated/DrillsStartSamples.java | 28 + .../generated/DrillsUpdateSamples.java | 72 + .../DrillsValidateForExecutionSamples.java | 31 + .../EnrollmentsCreateOrUpdateSamples.java | 30 + .../generated/EnrollmentsDeleteSamples.java | 24 + .../generated/EnrollmentsGetSamples.java | 24 + .../generated/EnrollmentsListSamples.java | 23 + .../GoalAssignmentsCreateOrUpdateSamples.java | 55 + .../GoalAssignmentsDeleteSamples.java | 23 + .../generated/GoalAssignmentsGetSamples.java | 23 + .../generated/GoalAssignmentsListSamples.java | 36 + ...alAssignmentsRecommendCapacitySamples.java | 30 + ...ssignmentsRefreshGoalResourcesSamples.java | 23 + ...AssignmentsUpdateGoalResourcesSamples.java | 44 + .../GoalAssignmentsUpdateSamples.java | 37 + .../generated/GoalResourcesGetSamples.java | 52 + .../generated/GoalResourcesListSamples.java | 23 + .../GoalTemplatesCreateOrUpdateSamples.java | 52 + .../generated/GoalTemplatesDeleteSamples.java | 36 + .../generated/GoalTemplatesGetSamples.java | 23 + .../generated/GoalTemplatesListSamples.java | 36 + .../generated/GoalTemplatesUpdateSamples.java | 36 + .../generated/OperationStatusGetSamples.java | 24 + .../generated/OperationsListSamples.java | 36 + .../RecoveryJobResourcesGetSamples.java | 25 + .../RecoveryJobResourcesListSamples.java | 25 + .../generated/RecoveryJobsCancelSamples.java | 28 + .../generated/RecoveryJobsGetSamples.java | 25 + .../generated/RecoveryJobsListSamples.java | 23 + .../generated/RecoveryJobsResumeSamples.java | 28 + .../generated/RecoveryJobsRetrySamples.java | 25 + ...overyPlanActionsCheckReadinessSamples.java | 24 + ...overyPlanActionsFailoverCommitSamples.java | 24 + .../RecoveryPlanActionsFailoverSamples.java | 38 + .../RecoveryPlanActionsFinalizeSamples.java | 24 + .../RecoveryPlanActionsReprotectSamples.java | 31 + ...PlanActionsTestFailoverCleanupSamples.java | 28 + ...ecoveryPlanActionsTestFailoverSamples.java | 38 + ...veryPlanActionsUpdateResourcesSamples.java | 48 + ...tionsValidateForFailoverCommitSamples.java | 25 + ...PlanActionsValidateForFailoverSamples.java | 33 + ...lanActionsValidateForOperationSamples.java | 29 + ...lanActionsValidateForReprotectSamples.java | 31 + ...ValidateForTestFailoverCleanupSamples.java | 25 + ...ActionsValidateForTestFailoverSamples.java | 33 + .../RecoveryPlansCreateOrUpdateSamples.java | 445 ++ .../generated/RecoveryPlansDeleteSamples.java | 23 + .../generated/RecoveryPlansGetSamples.java | 24 + .../generated/RecoveryPlansListSamples.java | 23 + .../generated/RecoveryPlansUpdateSamples.java | 1269 +++++ .../RecoveryResourcesGetSamples.java | 25 + .../RecoveryResourcesListSamples.java | 23 + .../UnifiedResilienceItemsGetSamples.java | 23 + .../UnifiedResilienceItemsListSamples.java | 37 + .../UsagePlansCreateOrUpdateSamples.java | 46 + .../generated/UsagePlansDeleteSamples.java | 23 + .../UsagePlansGetByResourceGroupSamples.java | 24 + .../UsagePlansListByResourceGroupSamples.java | 23 + .../generated/UsagePlansListSamples.java | 23 + .../generated/UsagePlansUpdateSamples.java | 42 + .../AddOrUpdateResourcesRequestTests.java | 132 + .../AssetPropertiesOfDrillTests.java | 32 + .../generated/AssociatedIdentityTests.java | 30 + .../ChaosResourcePropertiesOfDrillTests.java | 41 + .../generated/CustomFaultDetailsTests.java | 29 + .../DiskReprotectInputDetailsTests.java | 29 + .../generated/DrillEndRequestTests.java | 30 + .../DrillResourceAttentionReasonTests.java | 24 + .../DrillRunAddNotesRequestTests.java | 26 + .../DrillRunFailoverRequestTests.java | 55 + .../generated/DrillRunsAddNotesMockTests.java | 36 + .../generated/DrillRunsFailOverMockTests.java | 51 + .../DrillRunsMarkAsCompleteMockTests.java | 38 + .../DrillRunsReprotectMockTests.java | 33 + .../generated/DrillRunsResumeMockTests.java | 34 + .../generated/DrillStartRequestTests.java | 25 + .../generated/DrillUpdatePropertiesTests.java | 78 + .../generated/DrillUpdateTests.java | 109 + .../generated/DrillsEndMockTests.java | 38 + .../generated/DrillsStartMockTests.java | 37 + .../generated/DrillsUpdateMockTests.java | 82 + .../DrillsValidateForExecutionMockTests.java | 41 + .../ExecutionConfigurationsTests.java | 26 + .../FailoverRequestPropertiesTests.java | 36 + .../generated/FailoverRequestTests.java | 44 + .../generated/FaultDetailsTests.java | 31 + .../generated/FaultPropertiesTests.java | 40 + ...AssignmentsRecommendCapacityMockTests.java | 38 + ...ignmentsRefreshGoalResourcesMockTests.java | 33 + ...signmentsUpdateGoalResourcesMockTests.java | 79 + .../generated/GoalResourceInnerTests.java | 77 + .../GoalResourceListResultTests.java | 44 + .../GoalResourcePropertiesTests.java | 62 + ...GoalResourcesGetWithResponseMockTests.java | 56 + .../generated/GoalResourcesListMockTests.java | 63 + .../generated/GoalsDataTests.java | 31 + .../IncludeOrUpdateResourceTests.java | 43 + .../generated/JobUserCommentTests.java | 18 + .../generated/LastRunPropertiesTests.java | 17 + .../ManagedOnBehalfOfConfigurationTests.java | 17 + .../ManagedServiceIdentityTests.java | 44 + .../generated/MarkAsCompleteRequestTests.java | 26 + .../generated/MoboBrokerResourceTests.java | 15 + .../MonitoringPropertiesOfDrillTests.java | 32 + .../generated/OperationDisplayTests.java | 17 + .../generated/OperationInnerTests.java | 17 + .../generated/OperationListResultTests.java | 19 + .../OperationQualificationDetailsTests.java | 21 + .../generated/OperationsListMockTests.java | 36 + .../RecommendCapacityRequestTests.java | 27 + .../generated/RecommendationsDataTests.java | 24 + ...ommendationsHighAvailabilityDataTests.java | 23 + .../generated/RecoveryActionRequestTests.java | 25 + .../RecoveryGroupActionSettingsTests.java | 17 + .../RecoveryGroupBaseActionTests.java | 32 + ...RecoveryGroupCustomRunbookActionTests.java | 63 + .../RecoveryGroupManualActionTests.java | 32 + .../RecoveryGroupPropertiesTests.java | 69 + .../generated/RecoveryGroupTests.java | 74 + .../generated/RecoveryGroupsSettingTests.java | 102 + ...overyPlanActionBaseResponseInnerTests.java | 18 + ...eryPlanActionsCheckReadinessMockTests.java | 34 + ...eryPlanActionsFailoverCommitMockTests.java | 37 + .../RecoveryPlanActionsFailoverMockTests.java | 50 + ...RecoveryPlanActionsReprotectMockTests.java | 43 + ...anActionsTestFailoverCleanupMockTests.java | 39 + ...overyPlanActionsTestFailoverMockTests.java | 49 + ...onsValidateForFailoverCommitMockTests.java | 72 + ...anActionsValidateForFailoverMockTests.java | 83 + ...nActionsValidateForReprotectMockTests.java | 78 + ...lidateForTestFailoverCleanupMockTests.java | 72 + ...tionsValidateForTestFailoverMockTests.java | 84 + .../RecoveryPlanPropertiesOfDrillTests.java | 32 + .../ReprotectRequestPropertiesTests.java | 27 + .../generated/ReprotectRequestTests.java | 29 + ...rceBaseProtectionSolutionSettingTests.java | 23 + .../ResourceCustomProtectionActionTests.java | 25 + .../ResourceCustomProtectionSettingTests.java | 40 + .../generated/ResourceListsTests.java | 110 + ...eNativeProtectionSolutionSettingTests.java | 23 + ...sourceProtectionSolutionSettingsTests.java | 17 + ...rceSiteRecoveryProtectionSettingTests.java | 49 + ...ourceSiteRecoveryReprotectParamsTests.java | 32 + ...ecoveryTestFailoverCleanupParamsTests.java | 26 + ...ceSiteRecoveryTestFailoverParamsTests.java | 26 + .../ServiceGroupMembershipTests.java | 21 + .../generated/ServiceLevelResourceTests.java | 29 + .../SupportedVerbsForStageTests.java | 22 + .../generated/SystemMetadataTests.java | 20 + .../TestFailoverCleanupRequestTests.java | 25 + .../UnifiedResilienceItemInnerTests.java | 46 + .../UnifiedResilienceItemListResultTests.java | 51 + .../UnifiedResilienceItemPropertiesTests.java | 44 + ...silienceItemsGetWithResponseMockTests.java | 67 + .../UnifiedResilienceItemsListMockTests.java | 69 + .../UpdateGoalResourceRequestTests.java | 120 + .../generated/UsagePlanTagsUpdateTests.java | 39 + .../generated/UserAssignedIdentityTests.java | 22 + ...firmationForHighAvailabilityItemTests.java | 39 + .../ValidateForExecutionPropertiesTests.java | 28 + .../ValidateForExecutionRequestTests.java | 30 + .../ValidateForOperationRequestTests.java | 27 + .../tsp-location.yaml | 4 + 496 files changed, 62669 insertions(+) create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/CHANGELOG.md create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/README.md create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/SAMPLE.md create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/pom.xml create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/ResilienceManagementManager.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/DrillResourcesClient.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/DrillRunResourcesClient.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/DrillRunsClient.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/DrillsClient.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/EnrollmentsClient.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/GoalAssignmentsClient.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/GoalResourcesClient.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/GoalTemplatesClient.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/OperationStatusClient.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/OperationsClient.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryJobResourcesClient.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryJobsClient.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryPlanActionsClient.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryPlansClient.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryResourcesClient.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/ResilienceManagementManagementClient.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/UnifiedResilienceItemsClient.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/UsagePlansClient.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/DrillInner.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/DrillResourceInner.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/DrillRunInner.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/DrillRunResourceInner.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/EnrollmentInner.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/GoalAssignmentInner.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/GoalResourceInner.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/GoalTemplateInner.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/OperationInner.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/OperationStatusResultInner.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryJobInner.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryJobResourceInner.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryPlanActionBaseResponseInner.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryPlanInner.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryResourceInner.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryResourceQualificationInner.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/UnifiedResilienceItemInner.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/UpdateRecoveryResourcesResponseInner.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/UsagePlanInner.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/ValidateForRecoveryOperationBaseResponseInner.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/package-info.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/package-info.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillResourceImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillResourcesClientImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillResourcesImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunResourceImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunResourcesClientImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunResourcesImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunsClientImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunsImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillsClientImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillsImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/EnrollmentImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/EnrollmentsClientImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/EnrollmentsImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalAssignmentImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalAssignmentsClientImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalAssignmentsImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalResourceImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalResourcesClientImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalResourcesImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalTemplateImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalTemplatesClientImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalTemplatesImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationStatusClientImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationStatusImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationStatusResultImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationsClientImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationsImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobResourceImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobResourcesClientImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobResourcesImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobsClientImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobsImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlanActionBaseResponseImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlanActionsClientImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlanActionsImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlanImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlansClientImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlansImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryResourceImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryResourceQualificationImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryResourcesClientImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryResourcesImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/ResilienceManagementManagementClientBuilder.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/ResilienceManagementManagementClientImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/ResourceManagerUtils.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UnifiedResilienceItemImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UnifiedResilienceItemsClientImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UnifiedResilienceItemsImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UpdateRecoveryResourcesResponseImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UsagePlanImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UsagePlansClientImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UsagePlansImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/ValidateForRecoveryOperationBaseResponseImpl.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/DrillListResult.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/DrillResourceListResult.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/DrillRunListResult.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/DrillRunResourceListResult.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/EnrollmentListResult.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/GoalAssignmentListResult.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/GoalResourceListResult.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/GoalTemplateListResult.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/OperationListResult.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/RecoveryJobListResult.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/RecoveryJobResourceListResult.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/RecoveryPlanListResult.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/RecoveryResourceListResult.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/UnifiedResilienceItemListResult.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/UsagePlanListResult.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/package-info.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ActionTask.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ActionType.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AddOrUpdateResourcesRequest.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ArmResponseErrorResponse.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AssetPropertiesOfDrill.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AssociatedIdentity.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AttentionReason.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AttestationState.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AutoFailover.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ChaosResourcePropertiesOfDrill.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/CommentType.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ConfirmationStatus.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/CustomFaultDetails.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DiskReprotectInputDetails.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Drill.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillAttestation.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillEndRequest.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillMode.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResource.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceAttentionReason.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceFaultState.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceInclusionState.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceReadinessState.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceState.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResources.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRun.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunAddNotesRequest.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunFailoverRequest.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunOperationVerbs.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunResource.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunResourceProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunResources.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunSubtasks.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRuns.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillStartRequest.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillType.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillUpdate.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillUpdateProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Drills.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Enrollment.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/EnrollmentProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Enrollments.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ErrorDetails.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExclusionReason.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExclusionState.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExecutionConfigurations.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExecutionReadinessState.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExecutionState.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExtensionObjectState.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FailoverDirectionTypes.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FailoverRequest.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FailoverRequestProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FailoverState.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FaultDetails.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FaultProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ForceInclusionAndUpdate.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalAssignment.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalAssignmentProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalAssignmentType.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalAssignments.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalResource.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalResourceProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalResources.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalTemplate.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalTemplateProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalTemplates.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalType.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalsData.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/HAStatus.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/IncludeOrUpdateResource.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/InitialConfig.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/IsoDuration.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobErrorInfo.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobExtendedInfo.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobResourceProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobResourceType.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobRetryDetails.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobStatus.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobTaskDetail.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobTriggeredBy.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobType.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobUserComment.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/LastRunProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ManagedOnBehalfOfConfiguration.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ManagedServiceIdentity.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ManagedServiceIdentityType.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/MarkAsCompleteRequest.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/MembershipType.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/MoboBrokerResource.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/MonitoringPropertiesOfDrill.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Operation.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/OperationDisplay.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/OperationQualificationDetails.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/OperationStatus.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/OperationStatusResult.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Operations.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Origin.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ProvisioningState.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/QualificationState.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RBACSetupMode.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RBACState.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ReasonForRequestingConfirmation.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecommendCapacityRequest.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecommendationsData.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecommendationsHighAvailabilityData.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryActionRequest.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroup.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupActionSettings.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupActionType.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupBaseAction.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupCustomRunbookAction.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupManualAction.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupsSetting.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJob.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobResource.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobResourceProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobResources.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobs.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryOperationNames.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryOperationStatus.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlan.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanActionBaseResponse.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanActions.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanExclusionReason.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanFailoverOperationStatus.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanOperationStatus.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanPropertiesOfDrill.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanState.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanType.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlans.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryResource.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryResourceProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryResourceQualification.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryResources.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RegionalDrillProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RelativeResourceCompositionState.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ReprotectRequest.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ReprotectRequestProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RequirementSelected.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResilienceHealthStatus.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceBaseProtectionSolutionSetting.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceCustomProtectionAction.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceCustomProtectionSetting.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceInclusionState.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceLists.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceNativeProtectionSolutionSetting.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceProtectionSolutionSettings.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceProtectionSolutionType.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceProtectionStatus.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceReplicationRole.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceSiteRecoveryProtectionSetting.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceSiteRecoveryReprotectParams.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceSiteRecoveryTestFailoverCleanupParams.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceSiteRecoveryTestFailoverParams.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceTypeCategories.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ServiceGroupMembership.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ServiceLevelResource.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/SolutionDisplayName.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/SupportedVerbsForStage.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/SystemMetadata.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/TestFailoverCleanupRequest.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/TestFailoverState.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UnifiedResilienceItem.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UnifiedResilienceItemProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UnifiedResilienceItemRequirementSelected.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UnifiedResilienceItems.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UpdateGoalResourceRequest.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UpdateRecoveryResourcesRequest.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UpdateRecoveryResourcesResponse.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlan.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlanProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlanTagsUpdate.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlanType.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlans.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UserAssignedIdentity.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UserConfirmationForHighAvailabilityItem.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UserConsent.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/VMPresent.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ValidateForExecutionProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ValidateForExecutionRequest.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ValidateForOperationRequest.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ValidateForRecoveryOperationBaseResponse.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ZonalDrillProperties.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/package-info.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/package-info.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/module-info.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/resources/META-INF/azure-resourcemanager-resiliencemanagement_metadata.json create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-resiliencemanagement/proxy-config.json create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-resiliencemanagement/reflect-config.json create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/resources/azure-resourcemanager-resiliencemanagement.properties create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillResourcesGetSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillResourcesListSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunResourcesGetSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunResourcesListSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsAddNotesSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsFailOverSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsGetSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsListSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsMarkAsCompleteSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsReprotectSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsResumeSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsAddOrUpdateResourcesSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsCreateSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsDeleteSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsEndSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsGetSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsListSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsResyncReadinessCheckSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsStartSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsUpdateSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsValidateForExecutionSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/EnrollmentsCreateOrUpdateSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/EnrollmentsDeleteSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/EnrollmentsGetSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/EnrollmentsListSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsCreateOrUpdateSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsDeleteSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsGetSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsListSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsRecommendCapacitySamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsRefreshGoalResourcesSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsUpdateGoalResourcesSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsUpdateSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourcesGetSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourcesListSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalTemplatesCreateOrUpdateSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalTemplatesDeleteSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalTemplatesGetSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalTemplatesListSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalTemplatesUpdateSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationStatusGetSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationsListSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobResourcesGetSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobResourcesListSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobsCancelSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobsGetSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobsListSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobsResumeSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobsRetrySamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsCheckReadinessSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsFailoverCommitSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsFailoverSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsFinalizeSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsReprotectSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsTestFailoverCleanupSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsTestFailoverSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsUpdateResourcesSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForFailoverCommitSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForFailoverSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForOperationSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForReprotectSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForTestFailoverCleanupSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForTestFailoverSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlansCreateOrUpdateSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlansDeleteSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlansGetSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlansListSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlansUpdateSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryResourcesGetSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryResourcesListSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemsGetSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemsListSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansCreateOrUpdateSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansDeleteSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansGetByResourceGroupSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansListByResourceGroupSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansListSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansUpdateSamples.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/AddOrUpdateResourcesRequestTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/AssetPropertiesOfDrillTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/AssociatedIdentityTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ChaosResourcePropertiesOfDrillTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/CustomFaultDetailsTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DiskReprotectInputDetailsTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillEndRequestTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillResourceAttentionReasonTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunAddNotesRequestTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunFailoverRequestTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsAddNotesMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsFailOverMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsMarkAsCompleteMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsReprotectMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsResumeMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillStartRequestTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillUpdatePropertiesTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillUpdateTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsEndMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsStartMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsUpdateMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsValidateForExecutionMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ExecutionConfigurationsTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/FailoverRequestPropertiesTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/FailoverRequestTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/FaultDetailsTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/FaultPropertiesTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsRecommendCapacityMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsRefreshGoalResourcesMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsUpdateGoalResourcesMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourceInnerTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourceListResultTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourcePropertiesTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourcesGetWithResponseMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourcesListMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalsDataTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/IncludeOrUpdateResourceTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/JobUserCommentTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/LastRunPropertiesTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ManagedOnBehalfOfConfigurationTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ManagedServiceIdentityTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/MarkAsCompleteRequestTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/MoboBrokerResourceTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/MonitoringPropertiesOfDrillTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationDisplayTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationInnerTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationListResultTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationQualificationDetailsTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationsListMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecommendCapacityRequestTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecommendationsDataTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecommendationsHighAvailabilityDataTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryActionRequestTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupActionSettingsTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupBaseActionTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupCustomRunbookActionTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupManualActionTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupPropertiesTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupsSettingTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionBaseResponseInnerTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsCheckReadinessMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsFailoverCommitMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsFailoverMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsReprotectMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsTestFailoverCleanupMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsTestFailoverMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForFailoverCommitMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForFailoverMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForReprotectMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForTestFailoverCleanupMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForTestFailoverMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanPropertiesOfDrillTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ReprotectRequestPropertiesTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ReprotectRequestTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceBaseProtectionSolutionSettingTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceCustomProtectionActionTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceCustomProtectionSettingTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceListsTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceNativeProtectionSolutionSettingTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceProtectionSolutionSettingsTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceSiteRecoveryProtectionSettingTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceSiteRecoveryReprotectParamsTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceSiteRecoveryTestFailoverCleanupParamsTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceSiteRecoveryTestFailoverParamsTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ServiceGroupMembershipTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ServiceLevelResourceTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/SupportedVerbsForStageTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/SystemMetadataTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/TestFailoverCleanupRequestTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemInnerTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemListResultTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemPropertiesTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemsGetWithResponseMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemsListMockTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UpdateGoalResourceRequestTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlanTagsUpdateTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UserAssignedIdentityTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UserConfirmationForHighAvailabilityItemTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ValidateForExecutionPropertiesTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ValidateForExecutionRequestTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ValidateForOperationRequestTests.java create mode 100644 sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/tsp-location.yaml diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/CHANGELOG.md b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/CHANGELOG.md new file mode 100644 index 000000000000..6129924c1b67 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/CHANGELOG.md @@ -0,0 +1,6 @@ +# Release History + +## 1.0.0-beta.1 (2026-06-02) + +- Azure Resource Manager Resilience Management client library for Java. This package contains Microsoft Azure SDK for Resilience Management Management SDK. Package api-version 2026-04-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/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/README.md b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/README.md new file mode 100644 index 000000000000..7d69aec8e335 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Resilience Management client library for Java + +Azure Resource Manager Resilience Management client library for Java. + +This package contains Microsoft Azure SDK for Resilience Management Management SDK. Package api-version 2026-04-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-resiliencemanagement;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-resiliencemanagement + 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 + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ResilienceManagementManager manager = ResilienceManagementManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` 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/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/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://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[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/ diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/SAMPLE.md b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/SAMPLE.md new file mode 100644 index 000000000000..bf8b1f064c97 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/SAMPLE.md @@ -0,0 +1,4103 @@ +# Code snippets and samples + + +## DrillResources + +- [Get](#drillresources_get) +- [List](#drillresources_list) + +## DrillRunResources + +- [Get](#drillrunresources_get) +- [List](#drillrunresources_list) + +## DrillRuns + +- [AddNotes](#drillruns_addnotes) +- [FailOver](#drillruns_failover) +- [Get](#drillruns_get) +- [List](#drillruns_list) +- [MarkAsComplete](#drillruns_markascomplete) +- [Reprotect](#drillruns_reprotect) +- [Resume](#drillruns_resume) + +## Drills + +- [AddOrUpdateResources](#drills_addorupdateresources) +- [Create](#drills_create) +- [Delete](#drills_delete) +- [End](#drills_end) +- [Get](#drills_get) +- [List](#drills_list) +- [ResyncReadinessCheck](#drills_resyncreadinesscheck) +- [Start](#drills_start) +- [Update](#drills_update) +- [ValidateForExecution](#drills_validateforexecution) + +## Enrollments + +- [CreateOrUpdate](#enrollments_createorupdate) +- [Delete](#enrollments_delete) +- [Get](#enrollments_get) +- [List](#enrollments_list) + +## GoalAssignments + +- [CreateOrUpdate](#goalassignments_createorupdate) +- [Delete](#goalassignments_delete) +- [Get](#goalassignments_get) +- [List](#goalassignments_list) +- [RecommendCapacity](#goalassignments_recommendcapacity) +- [RefreshGoalResources](#goalassignments_refreshgoalresources) +- [Update](#goalassignments_update) +- [UpdateGoalResources](#goalassignments_updategoalresources) + +## GoalResources + +- [Get](#goalresources_get) +- [List](#goalresources_list) + +## GoalTemplates + +- [CreateOrUpdate](#goaltemplates_createorupdate) +- [Delete](#goaltemplates_delete) +- [Get](#goaltemplates_get) +- [List](#goaltemplates_list) +- [Update](#goaltemplates_update) + +## OperationStatus + +- [Get](#operationstatus_get) + +## Operations + +- [List](#operations_list) + +## RecoveryJobResources + +- [Get](#recoveryjobresources_get) +- [List](#recoveryjobresources_list) + +## RecoveryJobs + +- [Cancel](#recoveryjobs_cancel) +- [Get](#recoveryjobs_get) +- [List](#recoveryjobs_list) +- [Resume](#recoveryjobs_resume) +- [Retry](#recoveryjobs_retry) + +## RecoveryPlanActions + +- [CheckReadiness](#recoveryplanactions_checkreadiness) +- [Failover](#recoveryplanactions_failover) +- [FailoverCommit](#recoveryplanactions_failovercommit) +- [Finalize](#recoveryplanactions_finalize) +- [Reprotect](#recoveryplanactions_reprotect) +- [TestFailover](#recoveryplanactions_testfailover) +- [TestFailoverCleanup](#recoveryplanactions_testfailovercleanup) +- [UpdateResources](#recoveryplanactions_updateresources) +- [ValidateForFailover](#recoveryplanactions_validateforfailover) +- [ValidateForFailoverCommit](#recoveryplanactions_validateforfailovercommit) +- [ValidateForOperation](#recoveryplanactions_validateforoperation) +- [ValidateForReprotect](#recoveryplanactions_validateforreprotect) +- [ValidateForTestFailover](#recoveryplanactions_validatefortestfailover) +- [ValidateForTestFailoverCleanup](#recoveryplanactions_validatefortestfailovercleanup) + +## RecoveryPlans + +- [CreateOrUpdate](#recoveryplans_createorupdate) +- [Delete](#recoveryplans_delete) +- [Get](#recoveryplans_get) +- [List](#recoveryplans_list) +- [Update](#recoveryplans_update) + +## RecoveryResources + +- [Get](#recoveryresources_get) +- [List](#recoveryresources_list) + +## UnifiedResilienceItems + +- [Get](#unifiedresilienceitems_get) +- [List](#unifiedresilienceitems_list) + +## UsagePlans + +- [CreateOrUpdate](#usageplans_createorupdate) +- [Delete](#usageplans_delete) +- [GetByResourceGroup](#usageplans_getbyresourcegroup) +- [List](#usageplans_list) +- [ListByResourceGroup](#usageplans_listbyresourcegroup) +- [Update](#usageplans_update) +### DrillResources_Get + +```java +/** + * Samples for DrillResources Get. + */ +public final class DrillResourcesGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillResources_Get_MaximumSet_Gen.json + */ + /** + * Sample code: DrillResources_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillResourcesGetMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillResources() + .getWithResponse("sampleServiceGroupName", "drill1", "b6378181-9dc0-4a43-8e09-97a8b08aabaa", + com.azure.core.util.Context.NONE); + } +} +``` + +### DrillResources_List + +```java +/** + * Samples for DrillResources List. + */ +public final class DrillResourcesListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillResources_List_MaximumSet_Gen.json + */ + /** + * Sample code: DrillResources_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillResourcesListMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillResources() + .list("sampleServiceGroupName", "drill1", "xntbyoswztnmvitj", 69, com.azure.core.util.Context.NONE); + } +} +``` + +### DrillRunResources_Get + +```java +/** + * Samples for DrillRunResources Get. + */ +public final class DrillRunResourcesGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillRunResources_Get_MaximumSet_Gen.json + */ + /** + * Sample code: DrillRunResources_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillRunResourcesGetMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillRunResources() + .getWithResponse("sampleServiceGroupName", "drill1", "ca92602e-53bf-43d2-ae62-d3fc940474b3", + "56f942da-a30e-43c0-b5f0-1c22e44f2d94", com.azure.core.util.Context.NONE); + } +} +``` + +### DrillRunResources_List + +```java +/** + * Samples for DrillRunResources List. + */ +public final class DrillRunResourcesListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillRunResources_List_MaximumSet_Gen.json + */ + /** + * Sample code: DrillRunResources_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillRunResourcesListMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillRunResources() + .list("sampleServiceGroupName", "drill1", "ca92602e-53bf-43d2-ae62-d3fc940474b3", + com.azure.core.util.Context.NONE); + } +} +``` + +### DrillRuns_AddNotes + +```java +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunAddNotesRequest; + +/** + * Samples for DrillRuns AddNotes. + */ +public final class DrillRunsAddNotesSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillRuns_AddNotes_MaximumSet_Gen.json + */ + /** + * Sample code: DrillRuns_AddNotes_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillRunsAddNotesMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillRuns() + .addNotes("sampleServiceGroupName", "qmn", "drill1", "ca92602e-53bf-43d2-ae62-d3fc940474b3", + new DrillRunAddNotesRequest().withNotes("wubqjajveatmwcglo"), com.azure.core.util.Context.NONE); + } +} +``` + +### DrillRuns_FailOver + +```java +import com.azure.resourcemanager.resiliencemanagement.models.AutoFailover; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunFailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverDirectionTypes; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequestProperties; +import java.util.Arrays; + +/** + * Samples for DrillRuns FailOver. + */ +public final class DrillRunsFailOverSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillRuns_FailOver_MaximumSet_Gen.json + */ + /** + * Sample code: DrillRuns_FailOver_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillRunsFailOverMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillRuns() + .failOver("sampleServiceGroupName", "qmn", "drill1", "ca92602e-53bf-43d2-ae62-d3fc940474b3", + new DrillRunFailoverRequest().withAutoFailover(AutoFailover.ENABLE) + .withFailoverProperties( + new FailoverRequest().withFailoverDirection(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS) + .withFailoverRequestProperties( + new FailoverRequestProperties().withSourceLocations(Arrays.asList("westus")))), + com.azure.core.util.Context.NONE); + } +} +``` + +### DrillRuns_Get + +```java +/** + * Samples for DrillRuns Get. + */ +public final class DrillRunsGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillRuns_Get_MaximumSet_Gen.json + */ + /** + * Sample code: DrillRuns_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + drillRunsGetMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillRuns() + .getWithResponse("sampleServiceGroupName", "drill1", "ca92602e-53bf-43d2-ae62-d3fc940474b3", + com.azure.core.util.Context.NONE); + } +} +``` + +### DrillRuns_List + +```java +/** + * Samples for DrillRuns List. + */ +public final class DrillRunsListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillRuns_List_MaximumSet_Gen.json + */ + /** + * Sample code: DrillRuns_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + drillRunsListMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillRuns().list("sampleServiceGroupName", "drill1", com.azure.core.util.Context.NONE); + } +} +``` + +### DrillRuns_MarkAsComplete + +```java +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunSubtasks; +import com.azure.resourcemanager.resiliencemanagement.models.MarkAsCompleteRequest; + +/** + * Samples for DrillRuns MarkAsComplete. + */ +public final class DrillRunsMarkAsCompleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillRuns_MarkAsComplete_MaximumSet_Gen.json + */ + /** + * Sample code: DrillRuns_MarkAsComplete_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillRunsMarkAsCompleteMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillRuns() + .markAsComplete("sampleServiceGroupName", "qmn", "drill1", "ca92602e-53bf-43d2-ae62-d3fc940474b3", + new MarkAsCompleteRequest().withDrillRunStage(DrillRunSubtasks.fromString("Fault")), + com.azure.core.util.Context.NONE); + } +} +``` + +### DrillRuns_Reprotect + +```java +/** + * Samples for DrillRuns Reprotect. + */ +public final class DrillRunsReprotectSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillRuns_Reprotect_MaximumSet_Gen.json + */ + /** + * Sample code: DrillRuns_Reprotect_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillRunsReprotectMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillRuns() + .reprotect("sampleServiceGroupName", "qmn", "drill1", "ca92602e-53bf-43d2-ae62-d3fc940474b3", + com.azure.core.util.Context.NONE); + } +} +``` + +### DrillRuns_Resume + +```java +/** + * Samples for DrillRuns Resume. + */ +public final class DrillRunsResumeSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillRuns_Resume_MaximumSet_Gen.json + */ + /** + * Sample code: DrillRuns_Resume_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + drillRunsResumeMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillRuns() + .resume("sampleServiceGroupName", "qmn", "drill1", "ca92602e-53bf-43d2-ae62-d3fc940474b3", + com.azure.core.util.Context.NONE); + } +} +``` + +### Drills_AddOrUpdateResources + +```java +import com.azure.resourcemanager.resiliencemanagement.models.AddOrUpdateResourcesRequest; +import com.azure.resourcemanager.resiliencemanagement.models.CustomFaultDetails; +import com.azure.resourcemanager.resiliencemanagement.models.FaultDetails; +import com.azure.resourcemanager.resiliencemanagement.models.FaultProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ForceInclusionAndUpdate; +import com.azure.resourcemanager.resiliencemanagement.models.IncludeOrUpdateResource; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceLists; +import java.util.Arrays; + +/** + * Samples for Drills AddOrUpdateResources. + */ +public final class DrillsAddOrUpdateResourcesSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Drills_AddOrUpdateResources_MaximumSet_Gen.json + */ + /** + * Sample code: Drills_AddOrUpdateResources_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillsAddOrUpdateResourcesMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drills() + .addOrUpdateResources("sampleServiceGroupName", "qmn", "drill1", new AddOrUpdateResourcesRequest() + .withFaultDurationInMin(0) + .withResourceLists(new ResourceLists().withIncludeResources(Arrays.asList(new IncludeOrUpdateResource() + .withId( + "/providers/Microsoft.Management/serviceGroups/sampleServiceGroupName/providers/Microsoft.AzureResilienceManagement/drills/drill1/drillResources/2c9b3a1f-f96e-42c2-98fe-15005da8a133") + .withFaultProperties(new FaultProperties().withOverriddenDefaultFault(new FaultDetails() + .withFaultUrn("urn:csci:microsoft:virtualMachine:shutdown/1.0") + .withFaultName("shutdown") + .withTargetResourceId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1")) + .withCustomFault(new CustomFaultDetails().withFaultName( + "umofuzwgczqwyzcoakmrdrkjknykdonhypxibwrweggltsmjayvnlzroxdfalwkfsqvuqtfwhhzcnemndbgxdiciqs") + .withScriptResourceId( + "/subscriptions/191973cd-9c54-41e0-ac19-25dd9a92d5a8/resourceGroups/abhinkRG/providers/Microsoft.Automation/automationAccounts/abhinkAcc/runbooks/viveksi"))))) + .withExcludeResources(Arrays.asList( + "/providers/Microsoft.Management/serviceGroups/sampleServiceGroupName/providers/Microsoft.AzureResilienceManagement/drills/drill1/drillResources/c2191964-be24-4849-8faf-d9569576c708")) + .withUpdateResources(Arrays.asList(new IncludeOrUpdateResource().withId( + "/providers/Microsoft.Management/serviceGroups/sampleServiceGroupName/providers/Microsoft.AzureResilienceManagement/drills/drill1/drillResources/c26bea42-c34c-4e6f-8cf4-15043e18c8bc") + .withFaultProperties(new FaultProperties().withOverriddenDefaultFault(new FaultDetails() + .withFaultUrn("urn:csci:microsoft:virtualMachine:shutdown/1.0") + .withFaultName("shutdown") + .withTargetResourceId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1")) + .withCustomFault(new CustomFaultDetails().withFaultName( + "umofuzwgczqwyzcoakmrdrkjknykdonhypxibwrweggltsmjayvnlzroxdfalwkfsqvuqtfwhhzcnemndbgxdiciqs") + .withScriptResourceId( + "/subscriptions/191973cd-9c54-41e0-ac19-25dd9a92d5a8/resourceGroups/abhinkRG/providers/Microsoft.Automation/automationAccounts/abhinkAcc/runbooks/viveksi")))))) + .withForceInclusionAndUpdate(ForceInclusionAndUpdate.ENABLE), com.azure.core.util.Context.NONE); + } +} +``` + +### Drills_Create + +```java +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillInner; +import com.azure.resourcemanager.resiliencemanagement.models.AssetPropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.AssociatedIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ChaosResourcePropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.DrillProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.MonitoringPropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.RBACSetupMode; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanPropertiesOfDrill; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Drills Create. + */ +public final class DrillsCreateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Drills_Create_MaximumSet_Gen.json + */ + /** + * Sample code: Drills_Create_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + drillsCreateMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drills() + .create("sampleServiceGroupName", "drill1", new DrillInner().withProperties(new DrillProperties() + .withRecoveryPlanProperties(new RecoveryPlanPropertiesOfDrill().withIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))) + .withDrillAssetProperties( + new AssetPropertiesOfDrill().withSubscription("4e88bed3-114f-443d-9975-28f64122ec5e") + .withRegion("eastus") + .withResourceGroup("customDrillResourceGroup")) + .withChaosResourceProperties(new ChaosResourcePropertiesOfDrill().withIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")) + .withChaosResourceIdentityForFaults(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))) + .withRbacSetupMode(RBACSetupMode.AUTOMATED_CUSTOM_ROLE) + .withMonitoringProperties(new MonitoringPropertiesOfDrill().withIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf())), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Drills_Delete + +```java +/** + * Samples for Drills Delete. + */ +public final class DrillsDeleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Drills_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: Drills_Delete_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + drillsDeleteMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drills().delete("sampleServiceGroupName", "drill1", com.azure.core.util.Context.NONE); + } +} +``` + +### Drills_End + +```java +import com.azure.resourcemanager.resiliencemanagement.models.DrillAttestation; +import com.azure.resourcemanager.resiliencemanagement.models.DrillEndRequest; + +/** + * Samples for Drills End. + */ +public final class DrillsEndSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Drills_End_MaximumSet_Gen.json + */ + /** + * Sample code: Drills_End_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + drillsEndMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drills() + .end("sampleServiceGroupName", "qmn", "drill1", + new DrillEndRequest().withAttestation(DrillAttestation.ATTESTED_SUCCESS) + .withAttestationNotes("ycnqvrgduotohgycsapckhixwqwgp"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Drills_Get + +```java +/** + * Samples for Drills Get. + */ +public final class DrillsGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Drills_Get_MaximumSet_Gen.json + */ + /** + * Sample code: Drills_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + drillsGetMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drills().getWithResponse("sampleServiceGroupName", "drill1", com.azure.core.util.Context.NONE); + } +} +``` + +### Drills_List + +```java +/** + * Samples for Drills List. + */ +public final class DrillsListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Drills_List_MaximumSet_Gen.json + */ + /** + * Sample code: Drills_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + drillsListMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drills().list("sampleServiceGroupName", "xntbyoswztnmvitj", 69, com.azure.core.util.Context.NONE); + } +} +``` + +### Drills_ResyncReadinessCheck + +```java +/** + * Samples for Drills ResyncReadinessCheck. + */ +public final class DrillsResyncReadinessCheckSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Drills_ResyncReadinessCheck_MaximumSet_Gen.json + */ + /** + * Sample code: Drills_ResyncReadinessCheck_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillsResyncReadinessCheckMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drills() + .resyncReadinessCheck("sampleServiceGroupName", "qmn", "drill1", com.azure.core.util.Context.NONE); + } +} +``` + +### Drills_Start + +```java +import com.azure.resourcemanager.resiliencemanagement.models.DrillMode; +import com.azure.resourcemanager.resiliencemanagement.models.DrillStartRequest; + +/** + * Samples for Drills Start. + */ +public final class DrillsStartSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Drills_Start_MaximumSet_Gen.json + */ + /** + * Sample code: Drills_Start_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + drillsStartMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drills() + .start("sampleServiceGroupName", "qmn", "drill1", new DrillStartRequest().withMode(DrillMode.FAILOVER), + com.azure.core.util.Context.NONE); + } +} +``` + +### Drills_Update + +```java +import com.azure.resourcemanager.resiliencemanagement.models.AssetPropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.AssociatedIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ChaosResourcePropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.DrillUpdate; +import com.azure.resourcemanager.resiliencemanagement.models.DrillUpdateProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.MonitoringPropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.RBACSetupMode; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanPropertiesOfDrill; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Drills Update. + */ +public final class DrillsUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Drills_Update_MaximumSet_Gen.json + */ + /** + * Sample code: Drills_Update_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + drillsUpdateMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drills() + .update("sampleServiceGroupName", "drill1", new DrillUpdate() + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf())) + .withProperties(new DrillUpdateProperties().withRecoveryPlanProperties( + new RecoveryPlanPropertiesOfDrill().withIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))) + .withDrillAssetProperties(new AssetPropertiesOfDrill().withSubscription("pxlmwjuhcif") + .withRegion("zuvwzxnbqyzdkthrewruw")) + .withChaosResourceProperties(new ChaosResourcePropertiesOfDrill() + .withIdentity(new AssociatedIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")) + .withChaosResourceIdentityForFaults(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))) + .withRbacSetupMode(RBACSetupMode.AUTOMATED_CUSTOM_ROLE) + .withMonitoringProperties(new MonitoringPropertiesOfDrill().withIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Drills_ValidateForExecution + +```java +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForExecutionProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForExecutionRequest; +import java.util.Arrays; + +/** + * Samples for Drills ValidateForExecution. + */ +public final class DrillsValidateForExecutionSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Drills_ValidateForExecution_MaximumSet_Gen.json + */ + /** + * Sample code: Drills_ValidateForExecution_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillsValidateForExecutionMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drills() + .validateForExecution("sampleServiceGroupName", "qmn", "drill1", + new ValidateForExecutionRequest().withValidateForExecutionProperties( + new ValidateForExecutionProperties().withSourceLocations(Arrays.asList("eastus2-az1"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### Enrollments_CreateOrUpdate + +```java +import com.azure.resourcemanager.resiliencemanagement.models.EnrollmentProperties; + +/** + * Samples for Enrollments CreateOrUpdate. + */ +public final class EnrollmentsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Enrollments_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: Enrollments_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void enrollmentsCreateOrUpdateMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.enrollments() + .define("sg1-enrollment") + .withExistingUsagePlan("MyResourceGroup", "myUsagePlan") + .withProperties( + new EnrollmentProperties().withServiceGroupId("/providers/Microsoft.Management/serviceGroups/sg1")) + .create(); + } +} +``` + +### Enrollments_Delete + +```java +/** + * Samples for Enrollments Delete. + */ +public final class EnrollmentsDeleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Enrollments_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: Enrollments_Delete_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void enrollmentsDeleteMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.enrollments() + .delete("MyResourceGroup", "myUsagePlan", "sg1-enrollment", com.azure.core.util.Context.NONE); + } +} +``` + +### Enrollments_Get + +```java +/** + * Samples for Enrollments Get. + */ +public final class EnrollmentsGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Enrollments_Get_MaximumSet_Gen.json + */ + /** + * Sample code: Enrollments_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + enrollmentsGetMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.enrollments() + .getWithResponse("MyResourceGroup", "myUsagePlan", "sg1-enrollment", com.azure.core.util.Context.NONE); + } +} +``` + +### Enrollments_List + +```java +/** + * Samples for Enrollments List. + */ +public final class EnrollmentsListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Enrollments_List_MaximumSet_Gen.json + */ + /** + * Sample code: Enrollments_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + enrollmentsListMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.enrollments().list("MyResourceGroup", "myUsagePlan", com.azure.core.util.Context.NONE); + } +} +``` + +### GoalAssignments_CreateOrUpdate + +```java +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalAssignmentInner; +import com.azure.resourcemanager.resiliencemanagement.models.GoalAssignmentProperties; +import com.azure.resourcemanager.resiliencemanagement.models.GoalAssignmentType; +import com.azure.resourcemanager.resiliencemanagement.models.ServiceLevelResource; +import java.util.Arrays; + +/** + * Samples for GoalAssignments CreateOrUpdate. + */ +public final class GoalAssignmentsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalAssignments_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: GoalAssignments_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalAssignmentsCreateOrUpdateMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalAssignments() + .createOrUpdate("sg1", "ga1", new GoalAssignmentInner().withProperties(new GoalAssignmentProperties() + .withGoalTemplateId("/providers/Microsoft.AzureResilienceManagement/goaltemplates/gt1") + .withGoalAssignmentType(GoalAssignmentType.RESILIENCY) + .withServiceLevelResources(Arrays.asList(new ServiceLevelResource().withServiceLevelIndicatorResourceId( + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/MyVirtualMachine") + .withServiceLevelObjectiveResourceId( + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/MyVirtualMachine")))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/GoalAssignments_CreateOrUpdate_MinimumSet_Gen.json + */ + /** + * Sample code: GoalAssignments_CreateOrUpdate_MinimumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalAssignmentsCreateOrUpdateMinimumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalAssignments() + .createOrUpdate("sg1", "ga1", + new GoalAssignmentInner().withProperties(new GoalAssignmentProperties() + .withGoalTemplateId("/providers/Microsoft.AzureResilienceManagement/goaltemplates/gt1") + .withGoalAssignmentType(GoalAssignmentType.RESILIENCY)), + com.azure.core.util.Context.NONE); + } +} +``` + +### GoalAssignments_Delete + +```java +/** + * Samples for GoalAssignments Delete. + */ +public final class GoalAssignmentsDeleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalAssignments_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: GoalAssignments_Delete_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalAssignmentsDeleteMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalAssignments().delete("sg1", "ga1", com.azure.core.util.Context.NONE); + } +} +``` + +### GoalAssignments_Get + +```java +/** + * Samples for GoalAssignments Get. + */ +public final class GoalAssignmentsGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalAssignments_Get_MaximumSet_Gen.json + */ + /** + * Sample code: GoalAssignments_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalAssignmentsGetMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalAssignments().getWithResponse("sg1", "ga1", com.azure.core.util.Context.NONE); + } +} +``` + +### GoalAssignments_List + +```java +/** + * Samples for GoalAssignments List. + */ +public final class GoalAssignmentsListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalAssignments_List_MaximumSet_Gen.json + */ + /** + * Sample code: GoalAssignments_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalAssignmentsListMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalAssignments().list("zldmpkvqzifygkqau", "xntbyoswztnmvitj", 69, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/GoalAssignments_List_MinimumSet_Gen.json + */ + /** + * Sample code: GoalAssignments_List_MinimumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalAssignmentsListMinimumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalAssignments().list("sg1", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### GoalAssignments_RecommendCapacity + +```java +import com.azure.resourcemanager.resiliencemanagement.models.RecommendCapacityRequest; +import java.util.Arrays; + +/** + * Samples for GoalAssignments RecommendCapacity. + */ +public final class GoalAssignmentsRecommendCapacitySamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalAssignments_RecommendCapacity_MaximumSet_Gen.json + */ + /** + * Sample code: GoalAssignments_RecommendCapacity_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalAssignmentsRecommendCapacityMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalAssignments() + .recommendCapacity("sg1", "ga1", new RecommendCapacityRequest().withResourceIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.Storage/storageAccounts/sa1")), + com.azure.core.util.Context.NONE); + } +} +``` + +### GoalAssignments_RefreshGoalResources + +```java +/** + * Samples for GoalAssignments RefreshGoalResources. + */ +public final class GoalAssignmentsRefreshGoalResourcesSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalAssignments_RefreshGoalResources_MaximumSet_Gen.json + */ + /** + * Sample code: GoalAssignments_RefreshGoalResources_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalAssignmentsRefreshGoalResourcesMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalAssignments().refreshGoalResources("sg1", "ga1", com.azure.core.util.Context.NONE); + } +} +``` + +### GoalAssignments_Update + +```java +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalAssignmentInner; +import com.azure.resourcemanager.resiliencemanagement.models.GoalAssignmentProperties; +import com.azure.resourcemanager.resiliencemanagement.models.GoalAssignmentType; +import com.azure.resourcemanager.resiliencemanagement.models.ServiceLevelResource; +import java.util.Arrays; + +/** + * Samples for GoalAssignments Update. + */ +public final class GoalAssignmentsUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalAssignments_Update_MaximumSet_Gen.json + */ + /** + * Sample code: GoalAssignments_Update_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalAssignmentsUpdateMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalAssignments() + .update("sg1", "ga1", new GoalAssignmentInner().withProperties(new GoalAssignmentProperties() + .withGoalTemplateId("/providers/Microsoft.AzureResilienceManagement/goaltemplates/gt1") + .withGoalAssignmentType(GoalAssignmentType.RESILIENCY) + .withServiceLevelResources(Arrays.asList(new ServiceLevelResource().withServiceLevelIndicatorResourceId( + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/MyVirtualMachine") + .withServiceLevelObjectiveResourceId( + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/MyVirtualMachine")))), + com.azure.core.util.Context.NONE); + } +} +``` + +### GoalAssignments_UpdateGoalResources + +```java +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalResourceInner; +import com.azure.resourcemanager.resiliencemanagement.models.AttestationState; +import com.azure.resourcemanager.resiliencemanagement.models.ExclusionState; +import com.azure.resourcemanager.resiliencemanagement.models.GoalResourceProperties; +import com.azure.resourcemanager.resiliencemanagement.models.UpdateGoalResourceRequest; +import java.util.Arrays; + +/** + * Samples for GoalAssignments UpdateGoalResources. + */ +public final class GoalAssignmentsUpdateGoalResourcesSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalAssignments_UpdateGoalResources_MaximumSet_Gen.json + */ + /** + * Sample code: GoalAssignments_UpdateGoalResources_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalAssignmentsUpdateGoalResourcesMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalAssignments() + .updateGoalResources("sg1", "ga1", new UpdateGoalResourceRequest().withResources(Arrays.asList( + new GoalResourceInner().withProperties(new GoalResourceProperties().withResourceArmId( + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/MyVirtualMachine") + .withHighAvailabilityGoalParticipation(ExclusionState.EXCLUDED) + .withHighAvailabilityAttestationStatus(AttestationState.MANUALLY_ATTESTED) + .withDisasterRecoveryGoalParticipation(ExclusionState.EXCLUDED) + .withDisasterRecoveryAttestationStatus(AttestationState.MANUALLY_ATTESTED)), + new GoalResourceInner().withProperties(new GoalResourceProperties().withResourceArmId( + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/MyVirtualMachine1") + .withHighAvailabilityGoalParticipation(ExclusionState.EXCLUDED) + .withHighAvailabilityAttestationStatus(AttestationState.MANUALLY_ATTESTED) + .withDisasterRecoveryGoalParticipation(ExclusionState.EXCLUDED) + .withDisasterRecoveryAttestationStatus(AttestationState.MANUALLY_ATTESTED)))), + com.azure.core.util.Context.NONE); + } +} +``` + +### GoalResources_Get + +```java +/** + * Samples for GoalResources Get. + */ +public final class GoalResourcesGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalResources_Get_Complete_Example.json + */ + /** + * Sample code: GoalResources_Get_Complete_Example. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalResourcesGetCompleteExample( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalResources() + .getWithResponse("production-sg", "resiliencyGoalAssignment", "web-app-resource", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/GoalResources_Get_MaximumSet_Gen.json + */ + /** + * Sample code: GoalResources_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + goalResourcesGetMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalResources() + .getWithResponse("umyghwnfpzsgrhpczizcn", "ga1", "gr1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/GoalResources_Get_MinimumSet_Gen.json + */ + /** + * Sample code: GoalResources_Get_MinimumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + goalResourcesGetMinimumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalResources().getWithResponse("sg1", "ga1", "gr1", com.azure.core.util.Context.NONE); + } +} +``` + +### GoalResources_List + +```java +/** + * Samples for GoalResources List. + */ +public final class GoalResourcesListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalResources_List_MaximumSet_Gen.json + */ + /** + * Sample code: GoalResources_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalResourcesListMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalResources().list("sg1", "ga1", "xntbyoswztnmvitj", 69, com.azure.core.util.Context.NONE); + } +} +``` + +### GoalTemplates_CreateOrUpdate + +```java +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalTemplateInner; +import com.azure.resourcemanager.resiliencemanagement.models.GoalTemplateProperties; +import com.azure.resourcemanager.resiliencemanagement.models.GoalType; +import com.azure.resourcemanager.resiliencemanagement.models.RequirementSelected; + +/** + * Samples for GoalTemplates CreateOrUpdate. + */ +public final class GoalTemplatesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalTemplates_CreateOrUpdate_MinimumSet_Gen.json + */ + /** + * Sample code: GoalTemplates_CreateOrUpdate_MinimumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalTemplatesCreateOrUpdateMinimumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalTemplates() + .createOrUpdate("sg1", "gt1", + new GoalTemplateInner().withProperties(new GoalTemplateProperties().withGoalType(GoalType.RESILIENCY)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/GoalTemplates_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: GoalTemplates_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalTemplatesCreateOrUpdateMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalTemplates() + .createOrUpdate("zumt", "gt1", + new GoalTemplateInner().withProperties( + new GoalTemplateProperties().withRequireHighAvailability(RequirementSelected.REQUIRED) + .withRequireDisasterRecovery(RequirementSelected.NOT_REQUIRED) + .withRegionalRecoveryPointObjective("PT15M") + .withRegionalRecoveryTimeObjective("PT30M") + .withGoalType(GoalType.RESILIENCY)), + com.azure.core.util.Context.NONE); + } +} +``` + +### GoalTemplates_Delete + +```java +/** + * Samples for GoalTemplates Delete. + */ +public final class GoalTemplatesDeleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalTemplates_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: GoalTemplates_Delete_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalTemplatesDeleteMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalTemplates().delete("ajsvdpsdgp", "gt1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/GoalTemplates_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: GoalTemplates_Delete_MinimumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalTemplatesDeleteMinimumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalTemplates().delete("sg1", "gt1", com.azure.core.util.Context.NONE); + } +} +``` + +### GoalTemplates_Get + +```java +/** + * Samples for GoalTemplates Get. + */ +public final class GoalTemplatesGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalTemplates_Get_MaximumSet_Gen.json + */ + /** + * Sample code: GoalTemplates_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + goalTemplatesGetMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalTemplates().getWithResponse("qsqjquhxpermcblvegajq", "gt1", com.azure.core.util.Context.NONE); + } +} +``` + +### GoalTemplates_List + +```java +/** + * Samples for GoalTemplates List. + */ +public final class GoalTemplatesListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalTemplates_List_MaximumSet_Gen.json + */ + /** + * Sample code: GoalTemplates_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalTemplatesListMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalTemplates().list("vmmacokmkuxzy", "xntbyoswztnmvitj", 69, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/GoalTemplates_List_MinimumSet_Gen.json + */ + /** + * Sample code: GoalTemplates_List_MinimumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalTemplatesListMinimumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalTemplates().list("sg1", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### GoalTemplates_Update + +```java +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalTemplateInner; +import com.azure.resourcemanager.resiliencemanagement.models.GoalTemplateProperties; +import com.azure.resourcemanager.resiliencemanagement.models.GoalType; +import com.azure.resourcemanager.resiliencemanagement.models.RequirementSelected; + +/** + * Samples for GoalTemplates Update. + */ +public final class GoalTemplatesUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalTemplates_Update_MaximumSet_Gen.json + */ + /** + * Sample code: GoalTemplates_Update_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalTemplatesUpdateMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalTemplates() + .update("ipvrpvfcsfwltkmalhklsyg", "gt1", + new GoalTemplateInner().withProperties( + new GoalTemplateProperties().withRequireHighAvailability(RequirementSelected.REQUIRED) + .withRequireDisasterRecovery(RequirementSelected.NOT_REQUIRED) + .withRegionalRecoveryPointObjective("PT15M") + .withRegionalRecoveryTimeObjective("PT30M") + .withGoalType(GoalType.RESILIENCY)), + com.azure.core.util.Context.NONE); + } +} +``` + +### OperationStatus_Get + +```java +/** + * Samples for OperationStatus Get. + */ +public final class OperationStatusGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/OperationStatus_Get_MaximumSet_Gen.json + */ + /** + * Sample code: OperationStatus_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void operationStatusGetMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.operationStatus() + .getWithResponse("eastus", "12345678-1234-1234-1234-123456789012", com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MinimumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + operationsListMinimumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + operationsListMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryJobResources_Get + +```java +/** + * Samples for RecoveryJobResources Get. + */ +public final class RecoveryJobResourcesGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryJobResources_Get_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryJobResources_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryJobResourcesGetMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryJobResources() + .getWithResponse("sampleServiceGroupName", "samplePlanName", "c56888ef-9ced-4001-a6d4-7145a0309bdb", + "56f942da-a30e-43c0-b5f0-1c22e44f2d94", com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryJobResources_List + +```java +/** + * Samples for RecoveryJobResources List. + */ +public final class RecoveryJobResourcesListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryJobResources_List_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryJobResources_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryJobResourcesListMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryJobResources() + .list("sampleServiceGroupName", "samplePlanName", "c56888ef-9ced-4001-a6d4-7145a0309bdb", + com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryJobs_Cancel + +```java +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryActionRequest; + +/** + * Samples for RecoveryJobs Cancel. + */ +public final class RecoveryJobsCancelSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryJobs_Cancel_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryJobs_Cancel_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryJobsCancelMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryJobs() + .cancel("sampleServiceGroup", null, "samplePlanName", "c56888ef-9ced-4001-a6d4-7145a0309bdb", + new RecoveryActionRequest().withDescription("Cancelling the recovery job due to user request"), + com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryJobs_Get + +```java +/** + * Samples for RecoveryJobs Get. + */ +public final class RecoveryJobsGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryJobs_Get_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryJobs_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + recoveryJobsGetMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryJobs() + .getWithResponse("sampleServiceGroupName", "samplePlanName", "c56888ef-9ced-4001-a6d4-7145a0309bdb", + com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryJobs_List + +```java +/** + * Samples for RecoveryJobs List. + */ +public final class RecoveryJobsListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryJobs_List_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryJobs_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + recoveryJobsListMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryJobs().list("sampleServiceGroupName", "samplePlanName", com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryJobs_Resume + +```java +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryActionRequest; + +/** + * Samples for RecoveryJobs Resume. + */ +public final class RecoveryJobsResumeSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryJobs_Resume_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryJobs_Resume_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryJobsResumeMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryJobs() + .resume("sampleServiceGroupName", null, "samplePlanName", "c56888ef-9ced-4001-a6d4-7145a0309bdb", + new RecoveryActionRequest().withDescription("Resuming the recovery job after user verification"), + com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryJobs_Retry + +```java +/** + * Samples for RecoveryJobs Retry. + */ +public final class RecoveryJobsRetrySamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryJobs_Retry_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryJobs_Retry_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryJobsRetryMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryJobs() + .retry("sampleServiceGroupName", null, "samplePlanName", "c56888ef-9ced-4001-a6d4-7145a0309bdb", + com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryPlanActions_CheckReadiness + +```java +/** + * Samples for RecoveryPlanActions CheckReadiness. + */ +public final class RecoveryPlanActionsCheckReadinessSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_CheckReadiness_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_CheckReadiness_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsCheckReadinessMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .checkReadiness("sampleServiceGroupName", "qmn", "samplePlanName", com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryPlanActions_Failover + +```java +import com.azure.resourcemanager.resiliencemanagement.models.ExecutionConfigurations; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverDirectionTypes; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequestProperties; +import com.azure.resourcemanager.resiliencemanagement.models.UserConsent; +import java.util.Arrays; + +/** + * Samples for RecoveryPlanActions Failover. + */ +public final class RecoveryPlanActionsFailoverSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_Failover_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_Failover_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsFailoverMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .failover("sampleServiceGroupName", null, "samplePlanName", new FailoverRequest() + .withFailoverDirection(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS) + .withFailoverRequestProperties(new FailoverRequestProperties() + .withSourceLocations(Arrays.asList("westus")) + .withSelectedResourceIds(Arrays.asList( + "/providers/Microsoft.Management/serviceGroups/sampleServiceGroupName/providers/Microsoft.AzureResilienceManagement/recoveryPlans/samplePlanName/recoveryResources/12345678-9012-3456-7890-123456789012")) + .withExecutionConfigurations(new ExecutionConfigurations().withUserConsent(UserConsent.ALLOWED))), + com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryPlanActions_FailoverCommit + +```java +/** + * Samples for RecoveryPlanActions FailoverCommit. + */ +public final class RecoveryPlanActionsFailoverCommitSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_FailoverCommit_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_FailoverCommit_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsFailoverCommitMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .failoverCommit("sampleServiceGroupName", null, "samplePlanName", com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryPlanActions_Finalize + +```java +/** + * Samples for RecoveryPlanActions Finalize. + */ +public final class RecoveryPlanActionsFinalizeSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_Finalize_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_Finalize_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsFinalizeMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .finalize("sampleServiceGroupName", null, "samplePlanName", com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryPlanActions_Reprotect + +```java +import com.azure.resourcemanager.resiliencemanagement.models.ReprotectRequest; +import com.azure.resourcemanager.resiliencemanagement.models.ReprotectRequestProperties; +import java.util.Arrays; + +/** + * Samples for RecoveryPlanActions Reprotect. + */ +public final class RecoveryPlanActionsReprotectSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_Reprotect_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_Reprotect_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsReprotectMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .reprotect("sampleServiceGroupName", null, "samplePlanName", new ReprotectRequest() + .withReprotectRequestProperties(new ReprotectRequestProperties().withSelectedResourceIds(Arrays.asList( + "/providers/Microsoft.Management/serviceGroups/sampleServiceGroupName/providers/Microsoft.AzureResilienceManagement/recoveryPlans/samplePlanName/recoveryResources/12345678-9012-3456-7890-123456789012"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryPlanActions_TestFailover + +```java +import com.azure.resourcemanager.resiliencemanagement.models.ExecutionConfigurations; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverDirectionTypes; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequestProperties; +import com.azure.resourcemanager.resiliencemanagement.models.UserConsent; +import java.util.Arrays; + +/** + * Samples for RecoveryPlanActions TestFailover. + */ +public final class RecoveryPlanActionsTestFailoverSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_TestFailover_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_TestFailover_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsTestFailoverMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .testFailover("sampleServiceGroupName", "qmn", "samplePlanName", new FailoverRequest() + .withFailoverDirection(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS) + .withFailoverRequestProperties(new FailoverRequestProperties() + .withSourceLocations(Arrays.asList("westus")) + .withSelectedResourceIds(Arrays.asList( + "/providers/Microsoft.Management/serviceGroups/sampleServiceGroupName/providers/Microsoft.AzureResilienceManagement/recoveryPlans/samplePlanName/recoveryResources/12345678-9012-3456-7890-123456789012")) + .withExecutionConfigurations(new ExecutionConfigurations().withUserConsent(UserConsent.ALLOWED))), + com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryPlanActions_TestFailoverCleanup + +```java +import com.azure.resourcemanager.resiliencemanagement.models.TestFailoverCleanupRequest; + +/** + * Samples for RecoveryPlanActions TestFailoverCleanup. + */ +public final class RecoveryPlanActionsTestFailoverCleanupSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_TestFailoverCleanup_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_TestFailoverCleanup_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsTestFailoverCleanupMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .testFailoverCleanup("sampleServiceGroupName", null, "samplePlanName", + new TestFailoverCleanupRequest().withComments("Test failover clean-up comments"), + com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryPlanActions_UpdateResources + +```java +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryResourceInner; +import com.azure.resourcemanager.resiliencemanagement.models.AssociatedIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryResourceProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceInclusionState; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceNativeProtectionSolutionSetting; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceProtectionSolutionType; +import com.azure.resourcemanager.resiliencemanagement.models.UpdateRecoveryResourcesRequest; +import java.util.Arrays; + +/** + * Samples for RecoveryPlanActions UpdateResources. + */ +public final class RecoveryPlanActionsUpdateResourcesSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_UpdateResources_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_UpdateResources_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsUpdateResourcesMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .updateResources("sampleServiceGroupName", null, "samplePlanName", new UpdateRecoveryResourcesRequest() + .withResourcesToUpdate( + Arrays.asList(new RecoveryResourceInner().withProperties(new RecoveryResourceProperties() + .withRecoveryResourceUniqueId("e2a7b8d1-4c3f-4e2b-9a1c-7f6e2d8b5c4a") + .withInclusionState(ResourceInclusionState.INCLUDED) + .withSelectedProtectionSolutionType(ResourceProtectionSolutionType.AZURE_NATIVE) + .withSelectedProtectionSolutionSetting(new ResourceNativeProtectionSolutionSetting()) + .withRecoveryGroupId("11111111-1111-1111-1111-123456789012") + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))) + .withResourcesToRemove(Arrays.asList( + "/providers/Microsoft.Management/serviceGroups/sampleServiceGroupName/providers/Microsoft.AzureResilienceManagement/recoveryPlans/samplePlanName/recoveryResources/12345678-9012-3456-7890-123456789012")), + com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryPlanActions_ValidateForFailover + +```java +import com.azure.resourcemanager.resiliencemanagement.models.FailoverDirectionTypes; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequestProperties; +import java.util.Arrays; + +/** + * Samples for RecoveryPlanActions ValidateForFailover. + */ +public final class RecoveryPlanActionsValidateForFailoverSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_ValidateForFailover_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_ValidateForFailover_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsValidateForFailoverMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .validateForFailover("sampleServiceGroupName", null, "samplePlanName", + new FailoverRequest().withFailoverDirection(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS) + .withFailoverRequestProperties( + new FailoverRequestProperties().withSourceLocations(Arrays.asList("westus"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryPlanActions_ValidateForFailoverCommit + +```java +/** + * Samples for RecoveryPlanActions ValidateForFailoverCommit. + */ +public final class RecoveryPlanActionsValidateForFailoverCommitSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_ValidateForFailoverCommit_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_ValidateForFailoverCommit_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsValidateForFailoverCommitMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .validateForFailoverCommit("sampleServiceGroupName", null, "samplePlanName", + com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryPlanActions_ValidateForOperation + +```java +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryOperationNames; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForOperationRequest; + +/** + * Samples for RecoveryPlanActions ValidateForOperation. + */ +public final class RecoveryPlanActionsValidateForOperationSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_ValidateForOperation_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_ValidateForOperation_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsValidateForOperationMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .validateForOperation("sampleServiceGroupName", null, "samplePlanName", + new ValidateForOperationRequest().withOperationName(RecoveryOperationNames.FAILOVER), + com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryPlanActions_ValidateForReprotect + +```java +import com.azure.resourcemanager.resiliencemanagement.models.ReprotectRequest; +import com.azure.resourcemanager.resiliencemanagement.models.ReprotectRequestProperties; +import java.util.Arrays; + +/** + * Samples for RecoveryPlanActions ValidateForReprotect. + */ +public final class RecoveryPlanActionsValidateForReprotectSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_ValidateForReprotect_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_ValidateForReprotect_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsValidateForReprotectMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .validateForReprotect("nrhlfd", null, "samplePlanName", new ReprotectRequest() + .withReprotectRequestProperties(new ReprotectRequestProperties().withSelectedResourceIds(Arrays.asList( + "/providers/Microsoft.Management/serviceGroups/sampleServiceGroupName/providers/Microsoft.AzureResilienceManagement/recoveryPlans/samplePlanName/recoveryResources/12345678-9012-3456-7890-123456789012"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryPlanActions_ValidateForTestFailover + +```java +import com.azure.resourcemanager.resiliencemanagement.models.FailoverDirectionTypes; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequestProperties; +import java.util.Arrays; + +/** + * Samples for RecoveryPlanActions ValidateForTestFailover. + */ +public final class RecoveryPlanActionsValidateForTestFailoverSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_ValidateForTestFailover_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_ValidateForTestFailover_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsValidateForTestFailoverMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .validateForTestFailover("sampleServiceGroupName", null, "samplePlanName", + new FailoverRequest().withFailoverDirection(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS) + .withFailoverRequestProperties( + new FailoverRequestProperties().withSourceLocations(Arrays.asList("westus"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryPlanActions_ValidateForTestFailoverCleanup + +```java +/** + * Samples for RecoveryPlanActions ValidateForTestFailoverCleanup. + */ +public final class RecoveryPlanActionsValidateForTestFailoverCleanupSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_ValidateForTestFailoverCleanup_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_ValidateForTestFailoverCleanup_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsValidateForTestFailoverCleanupMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .validateForTestFailoverCleanup("sampleServiceGroupName", null, "samplePlanName", + com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryPlans_CreateOrUpdate + +```java +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryPlanInner; +import com.azure.resourcemanager.resiliencemanagement.models.AssociatedIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroup; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupCustomRunbookAction; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupProperties; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupsSetting; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanProperties; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanType; +import com.azure.resourcemanager.resiliencemanagement.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RecoveryPlans CreateOrUpdate. + */ +public final class RecoveryPlansCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlans_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlans_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlansCreateOrUpdateMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlans() + .createOrUpdate("sampleServiceGroupName", "samplePlanName", new RecoveryPlanInner() + .withProperties(new RecoveryPlanProperties().withPlanType(RecoveryPlanType.REGIONAL) + .withPlanDescription("Sample Plan") + .withRecoveryGroupsSetting(new RecoveryGroupsSetting() + .withDefaultGroup(new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(0) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withDescription("sample group action instructions") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))))) + .withAdditionalGroups(Arrays.asList( + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))))))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1", + new UserAssignedIdentity()))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### RecoveryPlans_Delete + +```java +/** + * Samples for RecoveryPlans Delete. + */ +public final class RecoveryPlansDeleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlans_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlans_Delete_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlansDeleteMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlans().delete("sampleServiceGroupName", "samplePlanName", com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryPlans_Get + +```java +/** + * Samples for RecoveryPlans Get. + */ +public final class RecoveryPlansGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlans_Get_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlans_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + recoveryPlansGetMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlans() + .getWithResponse("sampleServiceGroupName", "samplePlanName", com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryPlans_List + +```java +/** + * Samples for RecoveryPlans List. + */ +public final class RecoveryPlansListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlans_List_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlans_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlansListMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlans().list("sampleServiceGroupName", "jfpmvvhtt", 44, com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryPlans_Update + +```java +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryPlanInner; +import com.azure.resourcemanager.resiliencemanagement.models.AssociatedIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroup; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupCustomRunbookAction; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupProperties; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupsSetting; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanProperties; +import com.azure.resourcemanager.resiliencemanagement.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RecoveryPlans Update. + */ +public final class RecoveryPlansUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlans_Update_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlans_Update_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlansUpdateMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlans() + .update("sampleServiceGroupName", "samplePlanName", new RecoveryPlanInner() + .withProperties(new RecoveryPlanProperties().withPlanDescription("my sample recovery plan") + .withRecoveryGroupsSetting(new RecoveryGroupsSetting() + .withDefaultGroup(new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(3) + .withDescription("sample-recoverygroup") + .withPreActions(Arrays.asList( + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList( + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))))) + .withAdditionalGroups(Arrays.asList( + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))))))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("key7088", new UserAssignedIdentity()))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### RecoveryResources_Get + +```java +/** + * Samples for RecoveryResources Get. + */ +public final class RecoveryResourcesGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryResources_Get_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryResources_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryResourcesGetMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryResources() + .getWithResponse("sampleServiceGroupName", "samplePlanName", "12345678-9012-3456-7890-123456789012", + com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryResources_List + +```java +/** + * Samples for RecoveryResources List. + */ +public final class RecoveryResourcesListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryResources_List_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryResources_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryResourcesListMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryResources().list("sampleServiceGroupName", "plan1", com.azure.core.util.Context.NONE); + } +} +``` + +### UnifiedResilienceItems_Get + +```java +/** + * Samples for UnifiedResilienceItems Get. + */ +public final class UnifiedResilienceItemsGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/UnifiedResilienceItems_Get_MaximumSet_Gen.json + */ + /** + * Sample code: UnifiedResilienceItems_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void unifiedResilienceItemsGetMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.unifiedResilienceItems().getWithResponse("sg1", "uri1", com.azure.core.util.Context.NONE); + } +} +``` + +### UnifiedResilienceItems_List + +```java +/** + * Samples for UnifiedResilienceItems List. + */ +public final class UnifiedResilienceItemsListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/UnifiedResilienceItems_List_MaximumSet_Gen.json + */ + /** + * Sample code: UnifiedResilienceItems_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void unifiedResilienceItemsListMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.unifiedResilienceItems() + .list("zldmpkvqzifygkqau", "xntbyoswztnmvitj", 69, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/UnifiedResilienceItems_List_MinimumSet_Gen.json + */ + /** + * Sample code: UnifiedResilienceItems_List_MaximumSet - generated by [MinimumSet] rule. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void unifiedResilienceItemsListMaximumSetGeneratedByMinimumSetRule( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.unifiedResilienceItems().list("sampleServiceGroupName", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### UsagePlans_CreateOrUpdate + +```java +import com.azure.resourcemanager.resiliencemanagement.models.UsagePlanProperties; +import com.azure.resourcemanager.resiliencemanagement.models.UsagePlanType; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for UsagePlans CreateOrUpdate. + */ +public final class UsagePlansCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/UsagePlans_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: UsagePlans_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void usagePlansCreateOrUpdateMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.usagePlans() + .define("myUsagePlan") + .withRegion("global") + .withExistingResourceGroup("MyResourceGroup") + .withTags(mapOf("environment", "production")) + .withProperties(new UsagePlanProperties().withPlanType(UsagePlanType.STANDARD)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### UsagePlans_Delete + +```java +/** + * Samples for UsagePlans Delete. + */ +public final class UsagePlansDeleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/UsagePlans_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: UsagePlans_Delete_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + usagePlansDeleteMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.usagePlans().delete("MyResourceGroup", "myUsagePlan", com.azure.core.util.Context.NONE); + } +} +``` + +### UsagePlans_GetByResourceGroup + +```java +/** + * Samples for UsagePlans GetByResourceGroup. + */ +public final class UsagePlansGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-04-01-preview/UsagePlans_Get_MaximumSet_Gen.json + */ + /** + * Sample code: UsagePlans_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + usagePlansGetMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.usagePlans() + .getByResourceGroupWithResponse("MyResourceGroup", "myUsagePlan", com.azure.core.util.Context.NONE); + } +} +``` + +### UsagePlans_List + +```java +/** + * Samples for UsagePlans List. + */ +public final class UsagePlansListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/UsagePlans_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: UsagePlans_ListBySubscription_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void usagePlansListBySubscriptionMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.usagePlans().list(com.azure.core.util.Context.NONE); + } +} +``` + +### UsagePlans_ListByResourceGroup + +```java +/** + * Samples for UsagePlans ListByResourceGroup. + */ +public final class UsagePlansListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-04-01-preview/UsagePlans_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: UsagePlans_ListByResourceGroup_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void usagePlansListByResourceGroupMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.usagePlans().listByResourceGroup("MyResourceGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### UsagePlans_Update + +```java +import com.azure.resourcemanager.resiliencemanagement.models.UsagePlan; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for UsagePlans Update. + */ +public final class UsagePlansUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/UsagePlans_Update_MaximumSet_Gen.json + */ + /** + * Sample code: UsagePlans_Update_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + usagePlansUpdateMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + UsagePlan resource = manager.usagePlans() + .getByResourceGroupWithResponse("MyResourceGroup", "myUsagePlan", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("environment", "staging", "costCenter", "12345")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/pom.xml b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/pom.xml new file mode 100644 index 000000000000..023dbd662c45 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/pom.xml @@ -0,0 +1,74 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-resiliencemanagement + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Resilience Management Management + This package contains Microsoft Azure SDK for Resilience Management Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package api-version 2026-04-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 + true + + + + com.azure + azure-core + 1.58.0 + + + com.azure + azure-core-management + 1.19.4 + + + com.azure + azure-core-test + 1.27.0-beta.15 + test + + + com.azure + azure-identity + 1.18.3 + test + + + diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/ResilienceManagementManager.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/ResilienceManagementManager.java new file mode 100644 index 000000000000..5bfb9af7d6d9 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/ResilienceManagementManager.java @@ -0,0 +1,538 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement; + +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.BearerTokenAuthenticationPolicy; +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.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.resiliencemanagement.fluent.ResilienceManagementManagementClient; +import com.azure.resourcemanager.resiliencemanagement.implementation.DrillResourcesImpl; +import com.azure.resourcemanager.resiliencemanagement.implementation.DrillRunResourcesImpl; +import com.azure.resourcemanager.resiliencemanagement.implementation.DrillRunsImpl; +import com.azure.resourcemanager.resiliencemanagement.implementation.DrillsImpl; +import com.azure.resourcemanager.resiliencemanagement.implementation.EnrollmentsImpl; +import com.azure.resourcemanager.resiliencemanagement.implementation.GoalAssignmentsImpl; +import com.azure.resourcemanager.resiliencemanagement.implementation.GoalResourcesImpl; +import com.azure.resourcemanager.resiliencemanagement.implementation.GoalTemplatesImpl; +import com.azure.resourcemanager.resiliencemanagement.implementation.OperationStatusImpl; +import com.azure.resourcemanager.resiliencemanagement.implementation.OperationsImpl; +import com.azure.resourcemanager.resiliencemanagement.implementation.RecoveryJobResourcesImpl; +import com.azure.resourcemanager.resiliencemanagement.implementation.RecoveryJobsImpl; +import com.azure.resourcemanager.resiliencemanagement.implementation.RecoveryPlanActionsImpl; +import com.azure.resourcemanager.resiliencemanagement.implementation.RecoveryPlansImpl; +import com.azure.resourcemanager.resiliencemanagement.implementation.RecoveryResourcesImpl; +import com.azure.resourcemanager.resiliencemanagement.implementation.ResilienceManagementManagementClientBuilder; +import com.azure.resourcemanager.resiliencemanagement.implementation.UnifiedResilienceItemsImpl; +import com.azure.resourcemanager.resiliencemanagement.implementation.UsagePlansImpl; +import com.azure.resourcemanager.resiliencemanagement.models.DrillResources; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunResources; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRuns; +import com.azure.resourcemanager.resiliencemanagement.models.Drills; +import com.azure.resourcemanager.resiliencemanagement.models.Enrollments; +import com.azure.resourcemanager.resiliencemanagement.models.GoalAssignments; +import com.azure.resourcemanager.resiliencemanagement.models.GoalResources; +import com.azure.resourcemanager.resiliencemanagement.models.GoalTemplates; +import com.azure.resourcemanager.resiliencemanagement.models.OperationStatus; +import com.azure.resourcemanager.resiliencemanagement.models.Operations; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryJobResources; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryJobs; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanActions; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlans; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryResources; +import com.azure.resourcemanager.resiliencemanagement.models.UnifiedResilienceItems; +import com.azure.resourcemanager.resiliencemanagement.models.UsagePlans; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to ResilienceManagementManager. + */ +public final class ResilienceManagementManager { + private Operations operations; + + private OperationStatus operationStatus; + + private GoalAssignments goalAssignments; + + private GoalTemplates goalTemplates; + + private GoalResources goalResources; + + private RecoveryPlans recoveryPlans; + + private RecoveryPlanActions recoveryPlanActions; + + private RecoveryResources recoveryResources; + + private RecoveryJobs recoveryJobs; + + private RecoveryJobResources recoveryJobResources; + + private Drills drills; + + private DrillResources drillResources; + + private DrillRuns drillRuns; + + private DrillRunResources drillRunResources; + + private UnifiedResilienceItems unifiedResilienceItems; + + private UsagePlans usagePlans; + + private Enrollments enrollments; + + private final ResilienceManagementManagementClient clientObject; + + private ResilienceManagementManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new ResilienceManagementManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Resilience Management service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Resilience Management service API instance. + */ + public static ResilienceManagementManager 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 Resilience Management service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Resilience Management service API instance. + */ + public static ResilienceManagementManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ResilienceManagementManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create ResilienceManagementManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ResilienceManagementManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-resiliencemanagement.properties"); + + 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 Resilience Management service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Resilience Management service API instance. + */ + public ResilienceManagementManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.resiliencemanagement") + .append("/") + .append(clientVersion); + 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 BearerTokenAuthenticationPolicy(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 ResilienceManagementManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of OperationStatus. + * + * @return Resource collection API of OperationStatus. + */ + public OperationStatus operationStatus() { + if (this.operationStatus == null) { + this.operationStatus = new OperationStatusImpl(clientObject.getOperationStatus(), this); + } + return operationStatus; + } + + /** + * Gets the resource collection API of GoalAssignments. + * + * @return Resource collection API of GoalAssignments. + */ + public GoalAssignments goalAssignments() { + if (this.goalAssignments == null) { + this.goalAssignments = new GoalAssignmentsImpl(clientObject.getGoalAssignments(), this); + } + return goalAssignments; + } + + /** + * Gets the resource collection API of GoalTemplates. + * + * @return Resource collection API of GoalTemplates. + */ + public GoalTemplates goalTemplates() { + if (this.goalTemplates == null) { + this.goalTemplates = new GoalTemplatesImpl(clientObject.getGoalTemplates(), this); + } + return goalTemplates; + } + + /** + * Gets the resource collection API of GoalResources. + * + * @return Resource collection API of GoalResources. + */ + public GoalResources goalResources() { + if (this.goalResources == null) { + this.goalResources = new GoalResourcesImpl(clientObject.getGoalResources(), this); + } + return goalResources; + } + + /** + * Gets the resource collection API of RecoveryPlans. + * + * @return Resource collection API of RecoveryPlans. + */ + public RecoveryPlans recoveryPlans() { + if (this.recoveryPlans == null) { + this.recoveryPlans = new RecoveryPlansImpl(clientObject.getRecoveryPlans(), this); + } + return recoveryPlans; + } + + /** + * Gets the resource collection API of RecoveryPlanActions. + * + * @return Resource collection API of RecoveryPlanActions. + */ + public RecoveryPlanActions recoveryPlanActions() { + if (this.recoveryPlanActions == null) { + this.recoveryPlanActions = new RecoveryPlanActionsImpl(clientObject.getRecoveryPlanActions(), this); + } + return recoveryPlanActions; + } + + /** + * Gets the resource collection API of RecoveryResources. + * + * @return Resource collection API of RecoveryResources. + */ + public RecoveryResources recoveryResources() { + if (this.recoveryResources == null) { + this.recoveryResources = new RecoveryResourcesImpl(clientObject.getRecoveryResources(), this); + } + return recoveryResources; + } + + /** + * Gets the resource collection API of RecoveryJobs. + * + * @return Resource collection API of RecoveryJobs. + */ + public RecoveryJobs recoveryJobs() { + if (this.recoveryJobs == null) { + this.recoveryJobs = new RecoveryJobsImpl(clientObject.getRecoveryJobs(), this); + } + return recoveryJobs; + } + + /** + * Gets the resource collection API of RecoveryJobResources. + * + * @return Resource collection API of RecoveryJobResources. + */ + public RecoveryJobResources recoveryJobResources() { + if (this.recoveryJobResources == null) { + this.recoveryJobResources = new RecoveryJobResourcesImpl(clientObject.getRecoveryJobResources(), this); + } + return recoveryJobResources; + } + + /** + * Gets the resource collection API of Drills. + * + * @return Resource collection API of Drills. + */ + public Drills drills() { + if (this.drills == null) { + this.drills = new DrillsImpl(clientObject.getDrills(), this); + } + return drills; + } + + /** + * Gets the resource collection API of DrillResources. + * + * @return Resource collection API of DrillResources. + */ + public DrillResources drillResources() { + if (this.drillResources == null) { + this.drillResources = new DrillResourcesImpl(clientObject.getDrillResources(), this); + } + return drillResources; + } + + /** + * Gets the resource collection API of DrillRuns. + * + * @return Resource collection API of DrillRuns. + */ + public DrillRuns drillRuns() { + if (this.drillRuns == null) { + this.drillRuns = new DrillRunsImpl(clientObject.getDrillRuns(), this); + } + return drillRuns; + } + + /** + * Gets the resource collection API of DrillRunResources. + * + * @return Resource collection API of DrillRunResources. + */ + public DrillRunResources drillRunResources() { + if (this.drillRunResources == null) { + this.drillRunResources = new DrillRunResourcesImpl(clientObject.getDrillRunResources(), this); + } + return drillRunResources; + } + + /** + * Gets the resource collection API of UnifiedResilienceItems. + * + * @return Resource collection API of UnifiedResilienceItems. + */ + public UnifiedResilienceItems unifiedResilienceItems() { + if (this.unifiedResilienceItems == null) { + this.unifiedResilienceItems + = new UnifiedResilienceItemsImpl(clientObject.getUnifiedResilienceItems(), this); + } + return unifiedResilienceItems; + } + + /** + * Gets the resource collection API of UsagePlans. It manages UsagePlan. + * + * @return Resource collection API of UsagePlans. + */ + public UsagePlans usagePlans() { + if (this.usagePlans == null) { + this.usagePlans = new UsagePlansImpl(clientObject.getUsagePlans(), this); + } + return usagePlans; + } + + /** + * Gets the resource collection API of Enrollments. It manages Enrollment. + * + * @return Resource collection API of Enrollments. + */ + public Enrollments enrollments() { + if (this.enrollments == null) { + this.enrollments = new EnrollmentsImpl(clientObject.getEnrollments(), this); + } + return enrollments; + } + + /** + * Gets wrapped service client ResilienceManagementManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + * + * @return Wrapped service client ResilienceManagementManagementClient. + */ + public ResilienceManagementManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/DrillResourcesClient.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/DrillResourcesClient.java new file mode 100644 index 000000000000..7ba8f22edce6 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/DrillResourcesClient.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.models.DrillResourceInner; + +/** + * An instance of this class provides access to all the operations defined in DrillResourcesClient. + */ +public interface DrillResourcesClient { + /** + * Get a DrillResource. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillResourceName The name of the DrillResource (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 DrillResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String serviceGroupName, String drillName, String drillResourceName, + Context context); + + /** + * Get a DrillResource. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillResourceName The name of the DrillResource (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 DrillResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DrillResourceInner get(String serviceGroupName, String drillName, String drillResourceName); + + /** + * List DrillResource resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName, String drillName); + + /** + * List DrillResource resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName, String drillName, String skipToken, Integer top, + Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/DrillRunResourcesClient.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/DrillRunResourcesClient.java new file mode 100644 index 000000000000..8d87d3ef67dc --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/DrillRunResourcesClient.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.models.DrillRunResourceInner; + +/** + * An instance of this class provides access to all the operations defined in DrillRunResourcesClient. + */ +public interface DrillRunResourcesClient { + /** + * Get a DrillRunResource. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param drillRunResourceName The unique name (GUID) of the recovery job 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 a DrillRunResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String serviceGroupName, String drillName, String drillRunName, + String drillRunResourceName, Context context); + + /** + * Get a DrillRunResource. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param drillRunResourceName The unique name (GUID) of the recovery job 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 a DrillRunResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DrillRunResourceInner get(String serviceGroupName, String drillName, String drillRunName, + String drillRunResourceName); + + /** + * List DrillRunResource resources by DrillRun. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 the response of a DrillRunResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName, String drillName, String drillRunName); + + /** + * List DrillRunResource resources by DrillRun. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillRunResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName, String drillName, String drillRunName, + Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/DrillRunsClient.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/DrillRunsClient.java new file mode 100644 index 000000000000..38be1e03574a --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/DrillRunsClient.java @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.models.DrillRunInner; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunAddNotesRequest; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunFailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.MarkAsCompleteRequest; + +/** + * An instance of this class provides access to all the operations defined in DrillRunsClient. + */ +public interface DrillRunsClient { + /** + * Get a DrillRun. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 DrillRun along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String serviceGroupName, String drillName, String drillRunName, + Context context); + + /** + * Get a DrillRun. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 DrillRun. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DrillRunInner get(String serviceGroupName, String drillName, String drillRunName); + + /** + * List DrillRun resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillRun list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName, String drillName); + + /** + * List DrillRun resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillRun list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName, String drillName, Context context); + + /** + * This initiates a new Failover operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 the {@link SyncPoller} for polling of request body for TestFailoverCleanup API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginFailOver(String serviceGroupName, String operationId, String drillName, + String drillRunName, DrillRunFailoverRequest body); + + /** + * This initiates a new Failover operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 SyncPoller} for polling of request body for TestFailoverCleanup API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginFailOver(String serviceGroupName, String operationId, String drillName, + String drillRunName, DrillRunFailoverRequest body, Context context); + + /** + * This initiates a new Failover operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void failOver(String serviceGroupName, String operationId, String drillName, String drillRunName, + DrillRunFailoverRequest body); + + /** + * This initiates a new Failover operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void failOver(String serviceGroupName, String operationId, String drillName, String drillRunName, + DrillRunFailoverRequest body, Context context); + + /** + * This initiates a new Reprotect operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 the {@link SyncPoller} for polling of request body for TestFailoverCleanup API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReprotect(String serviceGroupName, String operationId, String drillName, + String drillRunName); + + /** + * This initiates a new Reprotect operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 request body for TestFailoverCleanup API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReprotect(String serviceGroupName, String operationId, String drillName, + String drillRunName, Context context); + + /** + * This initiates a new Reprotect operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reprotect(String serviceGroupName, String operationId, String drillName, String drillRunName); + + /** + * This initiates a new Reprotect operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reprotect(String serviceGroupName, String operationId, String drillName, String drillRunName, Context context); + + /** + * This enables the user to add notes on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 the {@link SyncPoller} for polling of request body for TestFailoverCleanup API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginAddNotes(String serviceGroupName, String operationId, String drillName, + String drillRunName, DrillRunAddNotesRequest body); + + /** + * This enables the user to add notes on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 SyncPoller} for polling of request body for TestFailoverCleanup API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginAddNotes(String serviceGroupName, String operationId, String drillName, + String drillRunName, DrillRunAddNotesRequest body, Context context); + + /** + * This enables the user to add notes on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void addNotes(String serviceGroupName, String operationId, String drillName, String drillRunName, + DrillRunAddNotesRequest body); + + /** + * This enables the user to add notes on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void addNotes(String serviceGroupName, String operationId, String drillName, String drillRunName, + DrillRunAddNotesRequest body, Context context); + + /** + * This unblocks a Failover workflow that is paused after the Fault stage, to proceed to the Failover stage. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 the {@link SyncPoller} for polling of request body for TestFailoverCleanup API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResume(String serviceGroupName, String operationId, String drillName, + String drillRunName); + + /** + * This unblocks a Failover workflow that is paused after the Fault stage, to proceed to the Failover stage. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 request body for TestFailoverCleanup API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResume(String serviceGroupName, String operationId, String drillName, + String drillRunName, Context context); + + /** + * This unblocks a Failover workflow that is paused after the Fault stage, to proceed to the Failover stage. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resume(String serviceGroupName, String operationId, String drillName, String drillRunName); + + /** + * This unblocks a Failover workflow that is paused after the Fault stage, to proceed to the Failover stage. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resume(String serviceGroupName, String operationId, String drillName, String drillRunName, Context context); + + /** + * This enables the user to mark this stage as complete, disabling further retries on it. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 the {@link SyncPoller} for polling of response body for MarkAsComplete API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginMarkAsComplete(String serviceGroupName, String operationId, + String drillName, String drillRunName, MarkAsCompleteRequest body); + + /** + * This enables the user to mark this stage as complete, disabling further retries on it. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 SyncPoller} for polling of response body for MarkAsComplete API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginMarkAsComplete(String serviceGroupName, String operationId, + String drillName, String drillRunName, MarkAsCompleteRequest body, Context context); + + /** + * This enables the user to mark this stage as complete, disabling further retries on it. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void markAsComplete(String serviceGroupName, String operationId, String drillName, String drillRunName, + MarkAsCompleteRequest body); + + /** + * This enables the user to mark this stage as complete, disabling further retries on it. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void markAsComplete(String serviceGroupName, String operationId, String drillName, String drillRunName, + MarkAsCompleteRequest body, Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/DrillsClient.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/DrillsClient.java new file mode 100644 index 000000000000..f247144b725d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/DrillsClient.java @@ -0,0 +1,557 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.models.DrillInner; +import com.azure.resourcemanager.resiliencemanagement.models.AddOrUpdateResourcesRequest; +import com.azure.resourcemanager.resiliencemanagement.models.DrillEndRequest; +import com.azure.resourcemanager.resiliencemanagement.models.DrillStartRequest; +import com.azure.resourcemanager.resiliencemanagement.models.DrillUpdate; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForExecutionRequest; + +/** + * An instance of this class provides access to all the operations defined in DrillsClient. + */ +public interface DrillsClient { + /** + * Get a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Drill along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String serviceGroupName, String drillName, Context context); + + /** + * Get a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Drill. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DrillInner get(String serviceGroupName, String drillName); + + /** + * Create a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 drill resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DrillInner> beginCreate(String serviceGroupName, String drillName, + DrillInner resource); + + /** + * Create a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 drill resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DrillInner> beginCreate(String serviceGroupName, String drillName, + DrillInner resource, Context context); + + /** + * Create a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return drill resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DrillInner create(String serviceGroupName, String drillName, DrillInner resource); + + /** + * Create a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return drill resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DrillInner create(String serviceGroupName, String drillName, DrillInner resource, Context context); + + /** + * Update a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 drill resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpdate(String serviceGroupName, String drillName, DrillUpdate properties); + + /** + * Update a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 drill resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpdate(String serviceGroupName, String drillName, DrillUpdate properties, + Context context); + + /** + * Update a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String drillName, DrillUpdate properties); + + /** + * Update a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String drillName, DrillUpdate properties, Context context); + + /** + * Delete a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String serviceGroupName, String drillName); + + /** + * Delete a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String serviceGroupName, String drillName, Context context); + + /** + * Delete a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String drillName); + + /** + * Delete a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String drillName, Context context); + + /** + * List Drill resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Drill list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName); + + /** + * List Drill resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Drill list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName, String skipToken, Integer top, Context context); + + /** + * This returns eligible resource to be faulted or failed over. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 the {@link SyncPoller} for polling of validateForExecution post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginValidateForExecution(String serviceGroupName, String operationId, + String drillName, ValidateForExecutionRequest body); + + /** + * This returns eligible resource to be faulted or failed over. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 SyncPoller} for polling of validateForExecution post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginValidateForExecution(String serviceGroupName, String operationId, + String drillName, ValidateForExecutionRequest body, Context context); + + /** + * This returns eligible resource to be faulted or failed over. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void validateForExecution(String serviceGroupName, String operationId, String drillName, + ValidateForExecutionRequest body); + + /** + * This returns eligible resource to be faulted or failed over. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void validateForExecution(String serviceGroupName, String operationId, String drillName, + ValidateForExecutionRequest body, Context context); + + /** + * This starts a new running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 the {@link SyncPoller} for polling of response body of Drill actions. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String serviceGroupName, String operationId, String drillName, + DrillStartRequest body); + + /** + * This starts a new running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 SyncPoller} for polling of response body of Drill actions. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String serviceGroupName, String operationId, String drillName, + DrillStartRequest body, Context context); + + /** + * This starts a new running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String serviceGroupName, String operationId, String drillName, DrillStartRequest body); + + /** + * This starts a new running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String serviceGroupName, String operationId, String drillName, DrillStartRequest body, Context context); + + /** + * This ends the currently running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 the {@link SyncPoller} for polling of response body of Drill actions. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginEnd(String serviceGroupName, String operationId, String drillName, + DrillEndRequest body); + + /** + * This ends the currently running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 SyncPoller} for polling of response body of Drill actions. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginEnd(String serviceGroupName, String operationId, String drillName, + DrillEndRequest body, Context context); + + /** + * This ends the currently running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void end(String serviceGroupName, String operationId, String drillName, DrillEndRequest body); + + /** + * This ends the currently running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void end(String serviceGroupName, String operationId, String drillName, DrillEndRequest body, Context context); + + /** + * This enables the user to include, exclude or update resources from their Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginAddOrUpdateResources(String serviceGroupName, String operationId, + String drillName, AddOrUpdateResourcesRequest body); + + /** + * This enables the user to include, exclude or update resources from their Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginAddOrUpdateResources(String serviceGroupName, String operationId, + String drillName, AddOrUpdateResourcesRequest body, Context context); + + /** + * This enables the user to include, exclude or update resources from their Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void addOrUpdateResources(String serviceGroupName, String operationId, String drillName, + AddOrUpdateResourcesRequest body); + + /** + * This enables the user to include, exclude or update resources from their Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void addOrUpdateResources(String serviceGroupName, String operationId, String drillName, + AddOrUpdateResourcesRequest body, Context context); + + /** + * This triggers detection of any drifts from the desired state of Resources and RBAC. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResyncReadinessCheck(String serviceGroupName, String operationId, + String drillName); + + /** + * This triggers detection of any drifts from the desired state of Resources and RBAC. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResyncReadinessCheck(String serviceGroupName, String operationId, + String drillName, Context context); + + /** + * This triggers detection of any drifts from the desired state of Resources and RBAC. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resyncReadinessCheck(String serviceGroupName, String operationId, String drillName); + + /** + * This triggers detection of any drifts from the desired state of Resources and RBAC. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resyncReadinessCheck(String serviceGroupName, String operationId, String drillName, Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/EnrollmentsClient.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/EnrollmentsClient.java new file mode 100644 index 000000000000..a57aee1894b2 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/EnrollmentsClient.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.models.EnrollmentInner; + +/** + * An instance of this class provides access to all the operations defined in EnrollmentsClient. + */ +public interface EnrollmentsClient { + /** + * Get an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Enrollment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String usagePlanName, String enrollmentName, + Context context); + + /** + * Get an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Enrollment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnrollmentInner get(String resourceGroupName, String usagePlanName, String enrollmentName); + + /** + * Create or update an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 an enrollment that links a usage plan to a service group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EnrollmentInner> beginCreateOrUpdate(String resourceGroupName, + String usagePlanName, String enrollmentName, EnrollmentInner resource); + + /** + * Create or update an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 an enrollment that links a usage plan to a service group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EnrollmentInner> beginCreateOrUpdate(String resourceGroupName, + String usagePlanName, String enrollmentName, EnrollmentInner resource, Context context); + + /** + * Create or update an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an enrollment that links a usage plan to a service group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnrollmentInner createOrUpdate(String resourceGroupName, String usagePlanName, String enrollmentName, + EnrollmentInner resource); + + /** + * Create or update an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an enrollment that links a usage plan to a service group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnrollmentInner createOrUpdate(String resourceGroupName, String usagePlanName, String enrollmentName, + EnrollmentInner resource, Context context); + + /** + * Delete an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String usagePlanName, + String enrollmentName); + + /** + * Delete an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String usagePlanName, + String enrollmentName, Context context); + + /** + * Delete an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceGroupName, String usagePlanName, String enrollmentName); + + /** + * Delete an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceGroupName, String usagePlanName, String enrollmentName, Context context); + + /** + * List Enrollments by Usage Plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Enrollment list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String usagePlanName); + + /** + * List Enrollments by Usage Plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Enrollment list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String usagePlanName, Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/GoalAssignmentsClient.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/GoalAssignmentsClient.java new file mode 100644 index 000000000000..06ca1a9bfde2 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/GoalAssignmentsClient.java @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.models.GoalAssignmentInner; +import com.azure.resourcemanager.resiliencemanagement.models.RecommendCapacityRequest; +import com.azure.resourcemanager.resiliencemanagement.models.UpdateGoalResourceRequest; + +/** + * An instance of this class provides access to all the operations defined in GoalAssignmentsClient. + */ +public interface GoalAssignmentsClient { + /** + * Get a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 GoalAssignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String serviceGroupName, String goalAssignmentName, Context context); + + /** + * Get a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 GoalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GoalAssignmentInner get(String serviceGroupName, String goalAssignmentName); + + /** + * Create a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 goal assignment a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCreateOrUpdate(String serviceGroupName, String goalAssignmentName, + GoalAssignmentInner resource); + + /** + * Create a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 goal assignment a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCreateOrUpdate(String serviceGroupName, String goalAssignmentName, + GoalAssignmentInner resource, Context context); + + /** + * Create a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 createOrUpdate(String serviceGroupName, String goalAssignmentName, GoalAssignmentInner resource); + + /** + * Create a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 createOrUpdate(String serviceGroupName, String goalAssignmentName, GoalAssignmentInner resource, + Context context); + + /** + * Update a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 goal assignment a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpdate(String serviceGroupName, String goalAssignmentName, + GoalAssignmentInner properties); + + /** + * Update a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 goal assignment a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpdate(String serviceGroupName, String goalAssignmentName, + GoalAssignmentInner properties, Context context); + + /** + * Update a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String goalAssignmentName, GoalAssignmentInner properties); + + /** + * Update a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String goalAssignmentName, GoalAssignmentInner properties, Context context); + + /** + * Action to exclude a resource from goal assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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 the {@link SyncPoller} for polling of response model for update goal resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpdateGoalResources(String serviceGroupName, String goalAssignmentName, + UpdateGoalResourceRequest body); + + /** + * Action to exclude a resource from goal assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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 SyncPoller} for polling of response model for update goal resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpdateGoalResources(String serviceGroupName, String goalAssignmentName, + UpdateGoalResourceRequest body, Context context); + + /** + * Action to exclude a resource from goal assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void updateGoalResources(String serviceGroupName, String goalAssignmentName, UpdateGoalResourceRequest body); + + /** + * Action to exclude a resource from goal assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void updateGoalResources(String serviceGroupName, String goalAssignmentName, UpdateGoalResourceRequest body, + Context context); + + /** + * Refreshes the goal resources under a goal assignment. This operation scans for new resources under the scope of + * the assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 response model for refresh goal resources. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRefreshGoalResources(String serviceGroupName, String goalAssignmentName); + + /** + * Refreshes the goal resources under a goal assignment. This operation scans for new resources under the scope of + * the assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 response model for refresh goal resources. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRefreshGoalResources(String serviceGroupName, String goalAssignmentName, + Context context); + + /** + * Refreshes the goal resources under a goal assignment. This operation scans for new resources under the scope of + * the assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 refreshGoalResources(String serviceGroupName, String goalAssignmentName); + + /** + * Refreshes the goal resources under a goal assignment. This operation scans for new resources under the scope of + * the assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 refreshGoalResources(String serviceGroupName, String goalAssignmentName, Context context); + + /** + * Delete a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String serviceGroupName, String goalAssignmentName); + + /** + * Delete a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String serviceGroupName, String goalAssignmentName, Context context); + + /** + * Delete a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String goalAssignmentName); + + /** + * Delete a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String goalAssignmentName, Context context); + + /** + * Recommends capacity improvements for resources under the goal assignments scope. Returns AI-powered capacity + * assessments and recommendations. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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 the {@link SyncPoller} for polling of result of a completed recommend capacity operation, containing + * per-resource assessments and cross-cutting recommendations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRecommendCapacity(String serviceGroupName, String goalAssignmentName, + RecommendCapacityRequest body); + + /** + * Recommends capacity improvements for resources under the goal assignments scope. Returns AI-powered capacity + * assessments and recommendations. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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 SyncPoller} for polling of result of a completed recommend capacity operation, containing + * per-resource assessments and cross-cutting recommendations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRecommendCapacity(String serviceGroupName, String goalAssignmentName, + RecommendCapacityRequest body, Context context); + + /** + * Recommends capacity improvements for resources under the goal assignments scope. Returns AI-powered capacity + * assessments and recommendations. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void recommendCapacity(String serviceGroupName, String goalAssignmentName, RecommendCapacityRequest body); + + /** + * Recommends capacity improvements for resources under the goal assignments scope. Returns AI-powered capacity + * assessments and recommendations. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void recommendCapacity(String serviceGroupName, String goalAssignmentName, RecommendCapacityRequest body, + Context context); + + /** + * List GoalAssignment resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalAssignment list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName); + + /** + * List GoalAssignment resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalAssignment list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName, String skipToken, Integer top, Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/GoalResourcesClient.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/GoalResourcesClient.java new file mode 100644 index 000000000000..688ada8da5ab --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/GoalResourcesClient.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.models.GoalResourceInner; + +/** + * An instance of this class provides access to all the operations defined in GoalResourcesClient. + */ +public interface GoalResourcesClient { + /** + * Get a GoalResource. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param goalResourceName The name of the GoalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 GoalResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String serviceGroupName, String goalAssignmentName, + String goalResourceName, Context context); + + /** + * Get a GoalResource. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param goalResourceName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 GoalResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GoalResourceInner get(String serviceGroupName, String goalAssignmentName, String goalResourceName); + + /** + * List GoalResource resources by GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName, String goalAssignmentName); + + /** + * List GoalResource resources by GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName, String goalAssignmentName, String skipToken, + Integer top, Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/GoalTemplatesClient.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/GoalTemplatesClient.java new file mode 100644 index 000000000000..5c14a2ccabec --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/GoalTemplatesClient.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.models.GoalTemplateInner; + +/** + * An instance of this class provides access to all the operations defined in GoalTemplatesClient. + */ +public interface GoalTemplatesClient { + /** + * Get a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 GoalTemplate along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String serviceGroupName, String goalTemplateName, Context context); + + /** + * Get a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 GoalTemplate. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GoalTemplateInner get(String serviceGroupName, String goalTemplateName); + + /** + * Create a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 goal template a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GoalTemplateInner> beginCreateOrUpdate(String serviceGroupName, + String goalTemplateName, GoalTemplateInner resource); + + /** + * Create a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 goal template a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GoalTemplateInner> beginCreateOrUpdate(String serviceGroupName, + String goalTemplateName, GoalTemplateInner resource, Context context); + + /** + * Create a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal template a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GoalTemplateInner createOrUpdate(String serviceGroupName, String goalTemplateName, GoalTemplateInner resource); + + /** + * Create a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal template a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GoalTemplateInner createOrUpdate(String serviceGroupName, String goalTemplateName, GoalTemplateInner resource, + Context context); + + /** + * Update a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 goal template a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpdate(String serviceGroupName, String goalTemplateName, + GoalTemplateInner properties); + + /** + * Update a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 goal template a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpdate(String serviceGroupName, String goalTemplateName, + GoalTemplateInner properties, Context context); + + /** + * Update a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String goalTemplateName, GoalTemplateInner properties); + + /** + * Update a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String goalTemplateName, GoalTemplateInner properties, Context context); + + /** + * Delete a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String serviceGroupName, String goalTemplateName); + + /** + * Delete a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String serviceGroupName, String goalTemplateName, Context context); + + /** + * Delete a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String goalTemplateName); + + /** + * Delete a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String goalTemplateName, Context context); + + /** + * List GoalTemplate resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalTemplate list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName); + + /** + * List GoalTemplate resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalTemplate list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName, String skipToken, Integer top, Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/OperationStatusClient.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/OperationStatusClient.java new file mode 100644 index 000000000000..082e7f4d084e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/OperationStatusClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.models.OperationStatusResultInner; + +/** + * An instance of this class provides access to all the operations defined in OperationStatusClient. + */ +public interface OperationStatusClient { + /** + * Returns the current status of an async operation. + * + * @param location The location name. + * @param operationId The ID of an ongoing async 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 current status of an async operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String location, String operationId, Context context); + + /** + * Returns the current status of an async operation. + * + * @param location The location name. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner get(String location, String operationId); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/OperationsClient.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/OperationsClient.java new file mode 100644 index 000000000000..20d8bcb63598 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/OperationsClient.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * List the operations for the 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the operations for the 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryJobResourcesClient.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryJobResourcesClient.java new file mode 100644 index 000000000000..529dae6b6e20 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryJobResourcesClient.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.models.RecoveryJobResourceInner; + +/** + * An instance of this class provides access to all the operations defined in RecoveryJobResourcesClient. + */ +public interface RecoveryJobResourcesClient { + /** + * Get a RecoveryJobResource. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param recoveryJobResourceName The unique name (GUID) of the recovery job 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 a RecoveryJobResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String serviceGroupName, String recoveryPlanName, + String recoveryJobName, String recoveryJobResourceName, Context context); + + /** + * Get a RecoveryJobResource. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param recoveryJobResourceName The unique name (GUID) of the recovery job 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 a RecoveryJobResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryJobResourceInner get(String serviceGroupName, String recoveryPlanName, String recoveryJobName, + String recoveryJobResourceName); + + /** + * List RecoveryJobResource resources by RecoveryJob. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJobResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName, String recoveryPlanName, + String recoveryJobName); + + /** + * List RecoveryJobResource resources by RecoveryJob. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJobResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName, String recoveryPlanName, + String recoveryJobName, Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryJobsClient.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryJobsClient.java new file mode 100644 index 000000000000..31a050699b69 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryJobsClient.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.models.RecoveryJobInner; +import com.azure.resourcemanager.resiliencemanagement.models.ArmResponseErrorResponse; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryActionRequest; + +/** + * An instance of this class provides access to all the operations defined in RecoveryJobsClient. + */ +public interface RecoveryJobsClient { + /** + * Get a RecoveryJob. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 RecoveryJob along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String serviceGroupName, String recoveryPlanName, String recoveryJobName, + Context context); + + /** + * Get a RecoveryJob. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 RecoveryJob. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryJobInner get(String serviceGroupName, String recoveryPlanName, String recoveryJobName); + + /** + * List RecoveryJob resources by RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJob list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName, String recoveryPlanName); + + /** + * List RecoveryJob resources by RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJob list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName, String recoveryPlanName, Context context); + + /** + * This action attempts to cancel the ongoing recovery orchestration job. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArmResponseErrorResponse> beginCancel(String serviceGroupName, + String operationId, String recoveryPlanName, String recoveryJobName, RecoveryActionRequest body); + + /** + * This action attempts to cancel the ongoing recovery orchestration job. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArmResponseErrorResponse> beginCancel(String serviceGroupName, + String operationId, String recoveryPlanName, String recoveryJobName, RecoveryActionRequest body, + Context context); + + /** + * This action attempts to cancel the ongoing recovery orchestration job. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArmResponseErrorResponse cancel(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, RecoveryActionRequest body); + + /** + * This action attempts to cancel the ongoing recovery orchestration job. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArmResponseErrorResponse cancel(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, RecoveryActionRequest body, Context context); + + /** + * This action resumes the ongoing recovery orchestration job that was paused for required user intervention. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArmResponseErrorResponse> beginResume(String serviceGroupName, + String operationId, String recoveryPlanName, String recoveryJobName, RecoveryActionRequest body); + + /** + * This action resumes the ongoing recovery orchestration job that was paused for required user intervention. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArmResponseErrorResponse> beginResume(String serviceGroupName, + String operationId, String recoveryPlanName, String recoveryJobName, RecoveryActionRequest body, + Context context); + + /** + * This action resumes the ongoing recovery orchestration job that was paused for required user intervention. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArmResponseErrorResponse resume(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, RecoveryActionRequest body); + + /** + * This action resumes the ongoing recovery orchestration job that was paused for required user intervention. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArmResponseErrorResponse resume(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, RecoveryActionRequest body, Context context); + + /** + * This action retries the ongoing recovery orchestration job for resources that failed in previous attempts. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArmResponseErrorResponse> beginRetry(String serviceGroupName, + String operationId, String recoveryPlanName, String recoveryJobName); + + /** + * This action retries the ongoing recovery orchestration job for resources that failed in previous attempts. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArmResponseErrorResponse> beginRetry(String serviceGroupName, + String operationId, String recoveryPlanName, String recoveryJobName, Context context); + + /** + * This action retries the ongoing recovery orchestration job for resources that failed in previous attempts. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArmResponseErrorResponse retry(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName); + + /** + * This action retries the ongoing recovery orchestration job for resources that failed in previous attempts. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArmResponseErrorResponse retry(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryPlanActionsClient.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryPlanActionsClient.java new file mode 100644 index 000000000000..ff5340d1e319 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryPlanActionsClient.java @@ -0,0 +1,983 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryPlanActionBaseResponseInner; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.UpdateRecoveryResourcesResponseInner; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.ValidateForRecoveryOperationBaseResponseInner; +import com.azure.resourcemanager.resiliencemanagement.models.ArmResponseErrorResponse; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.ReprotectRequest; +import com.azure.resourcemanager.resiliencemanagement.models.TestFailoverCleanupRequest; +import com.azure.resourcemanager.resiliencemanagement.models.UpdateRecoveryResourcesRequest; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForOperationRequest; + +/** + * An instance of this class provides access to all the operations defined in RecoveryPlanActionsClient. + */ +public interface RecoveryPlanActionsClient { + /** + * This action finalizes the recovery orchestration plan, ensuring all necessary configurations are in place. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArmResponseErrorResponse> beginFinalize(String serviceGroupName, + String operationId, String recoveryPlanName); + + /** + * This action finalizes the recovery orchestration plan, ensuring all necessary configurations are in place. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArmResponseErrorResponse> beginFinalize(String serviceGroupName, + String operationId, String recoveryPlanName, Context context); + + /** + * This action finalizes the recovery orchestration plan, ensuring all necessary configurations are in place. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArmResponseErrorResponse finalize(String serviceGroupName, String operationId, String recoveryPlanName); + + /** + * This action finalizes the recovery orchestration plan, ensuring all necessary configurations are in place. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArmResponseErrorResponse finalize(String serviceGroupName, String operationId, String recoveryPlanName, + Context context); + + /** + * This action adds or updates the resources to be included in the recovery orchestration plan. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of recoveryResources post action request to update in batch. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, UpdateRecoveryResourcesResponseInner> + beginUpdateResources(String serviceGroupName, String operationId, String recoveryPlanName, + UpdateRecoveryResourcesRequest body); + + /** + * This action adds or updates the resources to be included in the recovery orchestration plan. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 SyncPoller} for polling of recoveryResources post action request to update in batch. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, UpdateRecoveryResourcesResponseInner> + beginUpdateResources(String serviceGroupName, String operationId, String recoveryPlanName, + UpdateRecoveryResourcesRequest body, Context context); + + /** + * This action adds or updates the resources to be included in the recovery orchestration plan. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recoveryResources post action request to update in batch. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateRecoveryResourcesResponseInner updateResources(String serviceGroupName, String operationId, + String recoveryPlanName, UpdateRecoveryResourcesRequest body); + + /** + * This action adds or updates the resources to be included in the recovery orchestration plan. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recoveryResources post action request to update in batch. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateRecoveryResourcesResponseInner updateResources(String serviceGroupName, String operationId, + String recoveryPlanName, UpdateRecoveryResourcesRequest body, Context context); + + /** + * This action checks if the recovery orchestration plan is eligible for operations like failover and reprotect, + * ensuring it meets the necessary criteria. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArmResponseErrorResponse> beginValidateForOperation( + String serviceGroupName, String operationId, String recoveryPlanName, ValidateForOperationRequest body); + + /** + * This action checks if the recovery orchestration plan is eligible for operations like failover and reprotect, + * ensuring it meets the necessary criteria. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArmResponseErrorResponse> beginValidateForOperation( + String serviceGroupName, String operationId, String recoveryPlanName, ValidateForOperationRequest body, + Context context); + + /** + * This action checks if the recovery orchestration plan is eligible for operations like failover and reprotect, + * ensuring it meets the necessary criteria. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArmResponseErrorResponse validateForOperation(String serviceGroupName, String operationId, String recoveryPlanName, + ValidateForOperationRequest body); + + /** + * This action checks if the recovery orchestration plan is eligible for operations like failover and reprotect, + * ensuring it meets the necessary criteria. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArmResponseErrorResponse validateForOperation(String serviceGroupName, String operationId, String recoveryPlanName, + ValidateForOperationRequest body, Context context); + + /** + * This action checks if the recovery orchestration plan is eligible for failover operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForFailover(String serviceGroupName, String operationId, String recoveryPlanName, + FailoverRequest body); + + /** + * This action checks if the recovery orchestration plan is eligible for failover operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 SyncPoller} for polling of validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForFailover(String serviceGroupName, String operationId, String recoveryPlanName, + FailoverRequest body, Context context); + + /** + * This action checks if the recovery orchestration plan is eligible for failover operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateForRecoveryOperationBaseResponseInner validateForFailover(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body); + + /** + * This action checks if the recovery orchestration plan is eligible for failover operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateForRecoveryOperationBaseResponseInner validateForFailover(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body, Context context); + + /** + * This action checks if the recovery orchestration plan is eligible for failover commit operation, ensuring it + * meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForFailoverCommit(String serviceGroupName, String operationId, String recoveryPlanName); + + /** + * This action checks if the recovery orchestration plan is eligible for failover commit operation, ensuring it + * meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForFailoverCommit(String serviceGroupName, String operationId, String recoveryPlanName, + Context context); + + /** + * This action checks if the recovery orchestration plan is eligible for failover commit operation, ensuring it + * meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateForRecoveryOperationBaseResponseInner validateForFailoverCommit(String serviceGroupName, String operationId, + String recoveryPlanName); + + /** + * This action checks if the recovery orchestration plan is eligible for failover commit operation, ensuring it + * meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateForRecoveryOperationBaseResponseInner validateForFailoverCommit(String serviceGroupName, String operationId, + String recoveryPlanName, Context context); + + /** + * This action checks if the recovery orchestration plan is eligible for test failover operation, ensuring it meets + * the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForTestFailover(String serviceGroupName, String operationId, String recoveryPlanName, + FailoverRequest body); + + /** + * This action checks if the recovery orchestration plan is eligible for test failover operation, ensuring it meets + * the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 SyncPoller} for polling of validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForTestFailover(String serviceGroupName, String operationId, String recoveryPlanName, + FailoverRequest body, Context context); + + /** + * This action checks if the recovery orchestration plan is eligible for test failover operation, ensuring it meets + * the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateForRecoveryOperationBaseResponseInner validateForTestFailover(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body); + + /** + * This action checks if the recovery orchestration plan is eligible for test failover operation, ensuring it meets + * the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateForRecoveryOperationBaseResponseInner validateForTestFailover(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body, Context context); + + /** + * This action checks if the recovery orchestration plan is eligible for test failover cleanup operation, ensuring + * it meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForTestFailoverCleanup(String serviceGroupName, String operationId, String recoveryPlanName); + + /** + * This action checks if the recovery orchestration plan is eligible for test failover cleanup operation, ensuring + * it meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForTestFailoverCleanup(String serviceGroupName, String operationId, String recoveryPlanName, + Context context); + + /** + * This action checks if the recovery orchestration plan is eligible for test failover cleanup operation, ensuring + * it meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateForRecoveryOperationBaseResponseInner validateForTestFailoverCleanup(String serviceGroupName, + String operationId, String recoveryPlanName); + + /** + * This action checks if the recovery orchestration plan is eligible for test failover cleanup operation, ensuring + * it meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateForRecoveryOperationBaseResponseInner validateForTestFailoverCleanup(String serviceGroupName, + String operationId, String recoveryPlanName, Context context); + + /** + * This action checks if the recovery orchestration plan is eligible for reprotect operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForReprotect(String serviceGroupName, String operationId, String recoveryPlanName); + + /** + * This action checks if the recovery orchestration plan is eligible for reprotect operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 SyncPoller} for polling of validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForReprotect(String serviceGroupName, String operationId, String recoveryPlanName, + ReprotectRequest body, Context context); + + /** + * This action checks if the recovery orchestration plan is eligible for reprotect operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateForRecoveryOperationBaseResponseInner validateForReprotect(String serviceGroupName, String operationId, + String recoveryPlanName); + + /** + * This action checks if the recovery orchestration plan is eligible for reprotect operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateForRecoveryOperationBaseResponseInner validateForReprotect(String serviceGroupName, String operationId, + String recoveryPlanName, ReprotectRequest body, Context context); + + /** + * This action performs the necessary readiness check on the recovery orchestration plan to ensure it is in the + * desired state and eligible for all recovery actions, including all protected resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCheckReadiness(String serviceGroupName, String operationId, + String recoveryPlanName); + + /** + * This action performs the necessary readiness check on the recovery orchestration plan to ensure it is in the + * desired state and eligible for all recovery actions, including all protected resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCheckReadiness(String serviceGroupName, String operationId, + String recoveryPlanName, Context context); + + /** + * This action performs the necessary readiness check on the recovery orchestration plan to ensure it is in the + * desired state and eligible for all recovery actions, including all protected resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 checkReadiness(String serviceGroupName, String operationId, String recoveryPlanName); + + /** + * This action performs the necessary readiness check on the recovery orchestration plan to ensure it is in the + * desired state and eligible for all recovery actions, including all protected resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 checkReadiness(String serviceGroupName, String operationId, String recoveryPlanName, Context context); + + /** + * This action triggers the failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanActionBaseResponseInner> + beginFailover(String serviceGroupName, String operationId, String recoveryPlanName, FailoverRequest body); + + /** + * This action triggers the failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 SyncPoller} for polling of recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanActionBaseResponseInner> beginFailover( + String serviceGroupName, String operationId, String recoveryPlanName, FailoverRequest body, Context context); + + /** + * This action triggers the failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanActionBaseResponseInner failover(String serviceGroupName, String operationId, String recoveryPlanName, + FailoverRequest body); + + /** + * This action triggers the failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanActionBaseResponseInner failover(String serviceGroupName, String operationId, String recoveryPlanName, + FailoverRequest body, Context context); + + /** + * This action triggers the failover commit operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanActionBaseResponseInner> + beginFailoverCommit(String serviceGroupName, String operationId, String recoveryPlanName); + + /** + * This action triggers the failover commit operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanActionBaseResponseInner> + beginFailoverCommit(String serviceGroupName, String operationId, String recoveryPlanName, Context context); + + /** + * This action triggers the failover commit operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanActionBaseResponseInner failoverCommit(String serviceGroupName, String operationId, + String recoveryPlanName); + + /** + * This action triggers the failover commit operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanActionBaseResponseInner failoverCommit(String serviceGroupName, String operationId, + String recoveryPlanName, Context context); + + /** + * This action triggers the reprotect operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanActionBaseResponseInner> + beginReprotect(String serviceGroupName, String operationId, String recoveryPlanName); + + /** + * This action triggers the reprotect operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 SyncPoller} for polling of recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanActionBaseResponseInner> beginReprotect( + String serviceGroupName, String operationId, String recoveryPlanName, ReprotectRequest body, Context context); + + /** + * This action triggers the reprotect operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanActionBaseResponseInner reprotect(String serviceGroupName, String operationId, String recoveryPlanName); + + /** + * This action triggers the reprotect operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanActionBaseResponseInner reprotect(String serviceGroupName, String operationId, String recoveryPlanName, + ReprotectRequest body, Context context); + + /** + * This action triggers the test failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanActionBaseResponseInner> + beginTestFailover(String serviceGroupName, String operationId, String recoveryPlanName, FailoverRequest body); + + /** + * This action triggers the test failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 SyncPoller} for polling of recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanActionBaseResponseInner> beginTestFailover( + String serviceGroupName, String operationId, String recoveryPlanName, FailoverRequest body, Context context); + + /** + * This action triggers the test failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanActionBaseResponseInner testFailover(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body); + + /** + * This action triggers the test failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanActionBaseResponseInner testFailover(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body, Context context); + + /** + * This action triggers the test failover cleanup operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanActionBaseResponseInner> + beginTestFailoverCleanup(String serviceGroupName, String operationId, String recoveryPlanName, + TestFailoverCleanupRequest body); + + /** + * This action triggers the test failover cleanup operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 SyncPoller} for polling of recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanActionBaseResponseInner> + beginTestFailoverCleanup(String serviceGroupName, String operationId, String recoveryPlanName, + TestFailoverCleanupRequest body, Context context); + + /** + * This action triggers the test failover cleanup operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanActionBaseResponseInner testFailoverCleanup(String serviceGroupName, String operationId, + String recoveryPlanName, TestFailoverCleanupRequest body); + + /** + * This action triggers the test failover cleanup operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanActionBaseResponseInner testFailoverCleanup(String serviceGroupName, String operationId, + String recoveryPlanName, TestFailoverCleanupRequest body, Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryPlansClient.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryPlansClient.java new file mode 100644 index 000000000000..b4e0659111dd --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryPlansClient.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.models.RecoveryPlanInner; + +/** + * An instance of this class provides access to all the operations defined in RecoveryPlansClient. + */ +public interface RecoveryPlansClient { + /** + * Get a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 RecoveryPlan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String serviceGroupName, String recoveryPlanName, Context context); + + /** + * Get a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 RecoveryPlan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner get(String serviceGroupName, String recoveryPlanName); + + /** + * Create a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 represents a recovery orchestration plan resource in the Azure + * Resilience Management provider namespace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginCreateOrUpdate(String serviceGroupName, + String recoveryPlanName, RecoveryPlanInner resource); + + /** + * Create a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 represents a recovery orchestration plan resource in the Azure + * Resilience Management provider namespace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginCreateOrUpdate(String serviceGroupName, + String recoveryPlanName, RecoveryPlanInner resource, Context context); + + /** + * Create a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner createOrUpdate(String serviceGroupName, String recoveryPlanName, RecoveryPlanInner resource); + + /** + * Create a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner createOrUpdate(String serviceGroupName, String recoveryPlanName, RecoveryPlanInner resource, + Context context); + + /** + * Update a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 represents a recovery orchestration plan resource in the Azure + * Resilience Management provider namespace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginUpdate(String serviceGroupName, + String recoveryPlanName, RecoveryPlanInner properties); + + /** + * Update a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 represents a recovery orchestration plan resource in the Azure + * Resilience Management provider namespace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginUpdate(String serviceGroupName, + String recoveryPlanName, RecoveryPlanInner properties, Context context); + + /** + * Update a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner update(String serviceGroupName, String recoveryPlanName, RecoveryPlanInner properties); + + /** + * Update a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner update(String serviceGroupName, String recoveryPlanName, RecoveryPlanInner properties, + Context context); + + /** + * Delete a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String serviceGroupName, String recoveryPlanName); + + /** + * Delete a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String serviceGroupName, String recoveryPlanName, Context context); + + /** + * Delete a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String recoveryPlanName); + + /** + * Delete a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String recoveryPlanName, Context context); + + /** + * List RecoveryPlan resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryPlan list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName); + + /** + * List RecoveryPlan resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryPlan list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName, String skipToken, Integer top, Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryResourcesClient.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryResourcesClient.java new file mode 100644 index 000000000000..f5e897246fea --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryResourcesClient.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.models.RecoveryResourceInner; + +/** + * An instance of this class provides access to all the operations defined in RecoveryResourcesClient. + */ +public interface RecoveryResourcesClient { + /** + * Get a RecoveryResource. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryResourceName The unique name (Guid) of the recovery 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 a RecoveryResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String serviceGroupName, String recoveryPlanName, + String recoveryResourceName, Context context); + + /** + * Get a RecoveryResource. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryResourceName The unique name (Guid) of the recovery 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 a RecoveryResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryResourceInner get(String serviceGroupName, String recoveryPlanName, String recoveryResourceName); + + /** + * List RecoveryResource resources by RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName, String recoveryPlanName); + + /** + * List RecoveryResource resources by RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName, String recoveryPlanName, Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/ResilienceManagementManagementClient.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/ResilienceManagementManagementClient.java new file mode 100644 index 000000000000..adfdd4d689dd --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/ResilienceManagementManagementClient.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for ResilienceManagementManagementClient class. + */ +public interface ResilienceManagementManagementClient { + /** + * Gets Service host. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the OperationStatusClient object to access its operations. + * + * @return the OperationStatusClient object. + */ + OperationStatusClient getOperationStatus(); + + /** + * Gets the GoalAssignmentsClient object to access its operations. + * + * @return the GoalAssignmentsClient object. + */ + GoalAssignmentsClient getGoalAssignments(); + + /** + * Gets the GoalTemplatesClient object to access its operations. + * + * @return the GoalTemplatesClient object. + */ + GoalTemplatesClient getGoalTemplates(); + + /** + * Gets the GoalResourcesClient object to access its operations. + * + * @return the GoalResourcesClient object. + */ + GoalResourcesClient getGoalResources(); + + /** + * Gets the RecoveryPlansClient object to access its operations. + * + * @return the RecoveryPlansClient object. + */ + RecoveryPlansClient getRecoveryPlans(); + + /** + * Gets the RecoveryPlanActionsClient object to access its operations. + * + * @return the RecoveryPlanActionsClient object. + */ + RecoveryPlanActionsClient getRecoveryPlanActions(); + + /** + * Gets the RecoveryResourcesClient object to access its operations. + * + * @return the RecoveryResourcesClient object. + */ + RecoveryResourcesClient getRecoveryResources(); + + /** + * Gets the RecoveryJobsClient object to access its operations. + * + * @return the RecoveryJobsClient object. + */ + RecoveryJobsClient getRecoveryJobs(); + + /** + * Gets the RecoveryJobResourcesClient object to access its operations. + * + * @return the RecoveryJobResourcesClient object. + */ + RecoveryJobResourcesClient getRecoveryJobResources(); + + /** + * Gets the DrillsClient object to access its operations. + * + * @return the DrillsClient object. + */ + DrillsClient getDrills(); + + /** + * Gets the DrillResourcesClient object to access its operations. + * + * @return the DrillResourcesClient object. + */ + DrillResourcesClient getDrillResources(); + + /** + * Gets the DrillRunsClient object to access its operations. + * + * @return the DrillRunsClient object. + */ + DrillRunsClient getDrillRuns(); + + /** + * Gets the DrillRunResourcesClient object to access its operations. + * + * @return the DrillRunResourcesClient object. + */ + DrillRunResourcesClient getDrillRunResources(); + + /** + * Gets the UnifiedResilienceItemsClient object to access its operations. + * + * @return the UnifiedResilienceItemsClient object. + */ + UnifiedResilienceItemsClient getUnifiedResilienceItems(); + + /** + * Gets the UsagePlansClient object to access its operations. + * + * @return the UsagePlansClient object. + */ + UsagePlansClient getUsagePlans(); + + /** + * Gets the EnrollmentsClient object to access its operations. + * + * @return the EnrollmentsClient object. + */ + EnrollmentsClient getEnrollments(); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/UnifiedResilienceItemsClient.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/UnifiedResilienceItemsClient.java new file mode 100644 index 000000000000..47a9f65c3693 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/UnifiedResilienceItemsClient.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.models.UnifiedResilienceItemInner; + +/** + * An instance of this class provides access to all the operations defined in UnifiedResilienceItemsClient. + */ +public interface UnifiedResilienceItemsClient { + /** + * Get a UnifiedResilienceItem. + * + * @param serviceGroupName The name of the service group. + * @param unifiedResilienceItemName The name of the unified resilience item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 UnifiedResilienceItem along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String serviceGroupName, String unifiedResilienceItemName, + Context context); + + /** + * Get a UnifiedResilienceItem. + * + * @param serviceGroupName The name of the service group. + * @param unifiedResilienceItemName The name of the unified resilience item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 UnifiedResilienceItem. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UnifiedResilienceItemInner get(String serviceGroupName, String unifiedResilienceItemName); + + /** + * List UnifiedResilienceItem resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UnifiedResilienceItem list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName); + + /** + * List UnifiedResilienceItem resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UnifiedResilienceItem list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceGroupName, String skipToken, Integer top, + Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/UsagePlansClient.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/UsagePlansClient.java new file mode 100644 index 000000000000..0d6ec0f91007 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/UsagePlansClient.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.models.UsagePlanInner; +import com.azure.resourcemanager.resiliencemanagement.models.UsagePlanTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in UsagePlansClient. + */ +public interface UsagePlansClient { + /** + * Get a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 UsagePlan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String usagePlanName, + Context context); + + /** + * Get a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 UsagePlan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UsagePlanInner getByResourceGroup(String resourceGroupName, String usagePlanName); + + /** + * Create a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 a usage plan resource for Resiliency feature billing. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, UsagePlanInner> beginCreateOrUpdate(String resourceGroupName, + String usagePlanName, UsagePlanInner resource); + + /** + * Create a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 a usage plan resource for Resiliency feature billing. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, UsagePlanInner> beginCreateOrUpdate(String resourceGroupName, + String usagePlanName, UsagePlanInner resource, Context context); + + /** + * Create a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 usage plan resource for Resiliency feature billing. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UsagePlanInner createOrUpdate(String resourceGroupName, String usagePlanName, UsagePlanInner resource); + + /** + * Create a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 usage plan resource for Resiliency feature billing. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UsagePlanInner createOrUpdate(String resourceGroupName, String usagePlanName, UsagePlanInner resource, + Context context); + + /** + * Update a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 a usage plan resource for Resiliency feature billing. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, UsagePlanInner> beginUpdate(String resourceGroupName, String usagePlanName, + UsagePlanTagsUpdate properties); + + /** + * Update a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 a usage plan resource for Resiliency feature billing. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, UsagePlanInner> beginUpdate(String resourceGroupName, String usagePlanName, + UsagePlanTagsUpdate properties, Context context); + + /** + * Update a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 usage plan resource for Resiliency feature billing. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UsagePlanInner update(String resourceGroupName, String usagePlanName, UsagePlanTagsUpdate properties); + + /** + * Update a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 usage plan resource for Resiliency feature billing. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UsagePlanInner update(String resourceGroupName, String usagePlanName, UsagePlanTagsUpdate properties, + Context context); + + /** + * Delete a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String usagePlanName); + + /** + * Delete a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String usagePlanName, Context context); + + /** + * Delete a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceGroupName, String usagePlanName); + + /** + * Delete a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceGroupName, String usagePlanName, Context context); + + /** + * List UsagePlan resources by 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 the response of a UsagePlan list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List UsagePlan resources by 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 the response of a UsagePlan list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List UsagePlan resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UsagePlan list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List UsagePlan resources by subscription 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 response of a UsagePlan list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/DrillInner.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/DrillInner.java new file mode 100644 index 000000000000..f823c9e0d8fc --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/DrillInner.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.models.DrillProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentity; +import java.io.IOException; + +/** + * Drill resource. + */ +@Fluent +public final class DrillInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private DrillProperties properties; + + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DrillInner class. + */ + public DrillInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public DrillProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the DrillInner object itself. + */ + public DrillInner withProperties(DrillProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the DrillInner object itself. + */ + public DrillInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DrillInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DrillInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DrillInner. + */ + public static DrillInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DrillInner deserializedDrillInner = new DrillInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDrillInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDrillInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDrillInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDrillInner.properties = DrillProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedDrillInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDrillInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDrillInner; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/DrillResourceInner.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/DrillResourceInner.java new file mode 100644 index 000000000000..69db6846d43a --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/DrillResourceInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.models.DrillResourceProperties; +import java.io.IOException; + +/** + * Drill Resource. + */ +@Immutable +public final class DrillResourceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private DrillResourceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DrillResourceInner class. + */ + private DrillResourceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public DrillResourceProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DrillResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DrillResourceInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DrillResourceInner. + */ + public static DrillResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DrillResourceInner deserializedDrillResourceInner = new DrillResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDrillResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDrillResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDrillResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDrillResourceInner.properties = DrillResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDrillResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDrillResourceInner; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/DrillRunInner.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/DrillRunInner.java new file mode 100644 index 000000000000..5a91962e55f0 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/DrillRunInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunProperties; +import java.io.IOException; + +/** + * DrillRun resource. + */ +@Immutable +public final class DrillRunInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private DrillRunProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DrillRunInner class. + */ + private DrillRunInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public DrillRunProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DrillRunInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DrillRunInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DrillRunInner. + */ + public static DrillRunInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DrillRunInner deserializedDrillRunInner = new DrillRunInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDrillRunInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDrillRunInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDrillRunInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDrillRunInner.properties = DrillRunProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDrillRunInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDrillRunInner; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/DrillRunResourceInner.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/DrillRunResourceInner.java new file mode 100644 index 000000000000..da549f40c455 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/DrillRunResourceInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunResourceProperties; +import java.io.IOException; + +/** + * Represents a Drill Run job resource in the Azure Resilience Management provider namespace. + */ +@Immutable +public final class DrillRunResourceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private DrillRunResourceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DrillRunResourceInner class. + */ + private DrillRunResourceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public DrillRunResourceProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DrillRunResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DrillRunResourceInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DrillRunResourceInner. + */ + public static DrillRunResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DrillRunResourceInner deserializedDrillRunResourceInner = new DrillRunResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDrillRunResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDrillRunResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDrillRunResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDrillRunResourceInner.properties = DrillRunResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDrillRunResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDrillRunResourceInner; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/EnrollmentInner.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/EnrollmentInner.java new file mode 100644 index 000000000000..de672fc60499 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/EnrollmentInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.models.EnrollmentProperties; +import java.io.IOException; + +/** + * An enrollment that links a usage plan to a service group. + */ +@Fluent +public final class EnrollmentInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private EnrollmentProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of EnrollmentInner class. + */ + public EnrollmentInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public EnrollmentProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the EnrollmentInner object itself. + */ + public EnrollmentInner withProperties(EnrollmentProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnrollmentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnrollmentInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EnrollmentInner. + */ + public static EnrollmentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnrollmentInner deserializedEnrollmentInner = new EnrollmentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEnrollmentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEnrollmentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEnrollmentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedEnrollmentInner.properties = EnrollmentProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEnrollmentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEnrollmentInner; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/GoalAssignmentInner.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/GoalAssignmentInner.java new file mode 100644 index 000000000000..e077420bd8e1 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/GoalAssignmentInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.models.GoalAssignmentProperties; +import java.io.IOException; + +/** + * Goal assignment a AzureResilienceProviderHub resource. + */ +@Fluent +public final class GoalAssignmentInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private GoalAssignmentProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of GoalAssignmentInner class. + */ + public GoalAssignmentInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public GoalAssignmentProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the GoalAssignmentInner object itself. + */ + public GoalAssignmentInner withProperties(GoalAssignmentProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GoalAssignmentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GoalAssignmentInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GoalAssignmentInner. + */ + public static GoalAssignmentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GoalAssignmentInner deserializedGoalAssignmentInner = new GoalAssignmentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGoalAssignmentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGoalAssignmentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGoalAssignmentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedGoalAssignmentInner.properties = GoalAssignmentProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGoalAssignmentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGoalAssignmentInner; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/GoalResourceInner.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/GoalResourceInner.java new file mode 100644 index 000000000000..0e4c881eedc6 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/GoalResourceInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.models.GoalResourceProperties; +import java.io.IOException; + +/** + * Goal Resource a AzureResilienceProviderHub resource. + */ +@Fluent +public final class GoalResourceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private GoalResourceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of GoalResourceInner class. + */ + public GoalResourceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public GoalResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the GoalResourceInner object itself. + */ + public GoalResourceInner withProperties(GoalResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GoalResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GoalResourceInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GoalResourceInner. + */ + public static GoalResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GoalResourceInner deserializedGoalResourceInner = new GoalResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGoalResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGoalResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGoalResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedGoalResourceInner.properties = GoalResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGoalResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGoalResourceInner; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/GoalTemplateInner.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/GoalTemplateInner.java new file mode 100644 index 000000000000..cfa5e28081bb --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/GoalTemplateInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.models.GoalTemplateProperties; +import java.io.IOException; + +/** + * Goal template a AzureResilienceProviderHub resource. + */ +@Fluent +public final class GoalTemplateInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private GoalTemplateProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of GoalTemplateInner class. + */ + public GoalTemplateInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public GoalTemplateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the GoalTemplateInner object itself. + */ + public GoalTemplateInner withProperties(GoalTemplateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GoalTemplateInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GoalTemplateInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GoalTemplateInner. + */ + public static GoalTemplateInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GoalTemplateInner deserializedGoalTemplateInner = new GoalTemplateInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGoalTemplateInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGoalTemplateInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGoalTemplateInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedGoalTemplateInner.properties = GoalTemplateProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGoalTemplateInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGoalTemplateInner; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/OperationInner.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/OperationInner.java new file mode 100644 index 000000000000..901d0c7caea7 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/OperationInner.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.models.ActionType; +import com.azure.resourcemanager.resiliencemanagement.models.OperationDisplay; +import com.azure.resourcemanager.resiliencemanagement.models.Origin; +import java.io.IOException; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Immutable +public final class OperationInner implements JsonSerializable { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + + /** + * Creates an instance of OperationInner class. + */ + private OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/OperationStatusResultInner.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/OperationStatusResultInner.java new file mode 100644 index 000000000000..f17eeaa0a4a3 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/OperationStatusResultInner.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * The current status of an async operation. + */ +@Immutable +public final class OperationStatusResultInner implements JsonSerializable { + /* + * Fully qualified ID for the async operation. + */ + private String id; + + /* + * Name of the async operation. + */ + private String name; + + /* + * Operation status. + */ + private String status; + + /* + * Percent of the operation that is complete. + */ + private Double percentComplete; + + /* + * The start time of the operation. + */ + private OffsetDateTime startTime; + + /* + * The end time of the operation. + */ + private OffsetDateTime endTime; + + /* + * The operations list. + */ + private List operations; + + /* + * If present, details of the operation error. + */ + private ManagementError error; + + /* + * Fully qualified ID of the resource against which the original async operation was started. + */ + private String resourceId; + + /** + * Creates an instance of OperationStatusResultInner class. + */ + private OperationStatusResultInner() { + } + + /** + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Name of the async operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + public Double percentComplete() { + return this.percentComplete; + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the operations property: The operations list. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Get the error property: If present, details of the operation error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Get the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("percentComplete", this.percentComplete); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeArrayField("operations", this.operations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusResultInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationStatusResultInner. + */ + public static OperationStatusResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusResultInner deserializedOperationStatusResultInner = new OperationStatusResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedOperationStatusResultInner.status = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedOperationStatusResultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOperationStatusResultInner.name = reader.getString(); + } else if ("percentComplete".equals(fieldName)) { + deserializedOperationStatusResultInner.percentComplete = reader.getNullable(JsonReader::getDouble); + } else if ("startTime".equals(fieldName)) { + deserializedOperationStatusResultInner.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedOperationStatusResultInner.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("operations".equals(fieldName)) { + List operations + = reader.readArray(reader1 -> OperationStatusResultInner.fromJson(reader1)); + deserializedOperationStatusResultInner.operations = operations; + } else if ("error".equals(fieldName)) { + deserializedOperationStatusResultInner.error = ManagementError.fromJson(reader); + } else if ("resourceId".equals(fieldName)) { + deserializedOperationStatusResultInner.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationStatusResultInner; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryJobInner.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryJobInner.java new file mode 100644 index 000000000000..9c4739a0cf3b --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryJobInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryJobProperties; +import java.io.IOException; + +/** + * Represents a recovery job resource in the Azure Resilience Management provider namespace. + */ +@Immutable +public final class RecoveryJobInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private RecoveryJobProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RecoveryJobInner class. + */ + private RecoveryJobInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public RecoveryJobProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryJobInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryJobInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecoveryJobInner. + */ + public static RecoveryJobInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryJobInner deserializedRecoveryJobInner = new RecoveryJobInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRecoveryJobInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRecoveryJobInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRecoveryJobInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRecoveryJobInner.properties = RecoveryJobProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRecoveryJobInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryJobInner; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryJobResourceInner.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryJobResourceInner.java new file mode 100644 index 000000000000..c623eb5ef42b --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryJobResourceInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryJobResourceProperties; +import java.io.IOException; + +/** + * Represents a recovery orchestration job resource in the Azure Resilience Management provider namespace. + */ +@Immutable +public final class RecoveryJobResourceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private RecoveryJobResourceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RecoveryJobResourceInner class. + */ + private RecoveryJobResourceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public RecoveryJobResourceProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryJobResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryJobResourceInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecoveryJobResourceInner. + */ + public static RecoveryJobResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryJobResourceInner deserializedRecoveryJobResourceInner = new RecoveryJobResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRecoveryJobResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRecoveryJobResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRecoveryJobResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRecoveryJobResourceInner.properties = RecoveryJobResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRecoveryJobResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryJobResourceInner; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryPlanActionBaseResponseInner.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryPlanActionBaseResponseInner.java new file mode 100644 index 000000000000..395f1537254d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryPlanActionBaseResponseInner.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Recovery Orchestration Plan post action response. + */ +@Immutable +public final class RecoveryPlanActionBaseResponseInner + implements JsonSerializable { + /* + * JobId of the job triggered for Recovery Orchestration Plan. + */ + private String jobId; + + /** + * Creates an instance of RecoveryPlanActionBaseResponseInner class. + */ + private RecoveryPlanActionBaseResponseInner() { + } + + /** + * Get the jobId property: JobId of the job triggered for Recovery Orchestration Plan. + * + * @return the jobId value. + */ + public String jobId() { + return this.jobId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("jobId", this.jobId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryPlanActionBaseResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryPlanActionBaseResponseInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecoveryPlanActionBaseResponseInner. + */ + public static RecoveryPlanActionBaseResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryPlanActionBaseResponseInner deserializedRecoveryPlanActionBaseResponseInner + = new RecoveryPlanActionBaseResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobId".equals(fieldName)) { + deserializedRecoveryPlanActionBaseResponseInner.jobId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryPlanActionBaseResponseInner; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryPlanInner.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryPlanInner.java new file mode 100644 index 000000000000..8d10b54d680a --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryPlanInner.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanProperties; +import java.io.IOException; + +/** + * Represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace. + */ +@Fluent +public final class RecoveryPlanInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private RecoveryPlanProperties properties; + + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RecoveryPlanInner class. + */ + public RecoveryPlanInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public RecoveryPlanProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the RecoveryPlanInner object itself. + */ + public RecoveryPlanInner withProperties(RecoveryPlanProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the RecoveryPlanInner object itself. + */ + public RecoveryPlanInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryPlanInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryPlanInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecoveryPlanInner. + */ + public static RecoveryPlanInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryPlanInner deserializedRecoveryPlanInner = new RecoveryPlanInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRecoveryPlanInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRecoveryPlanInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRecoveryPlanInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRecoveryPlanInner.properties = RecoveryPlanProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedRecoveryPlanInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRecoveryPlanInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryPlanInner; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryResourceInner.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryResourceInner.java new file mode 100644 index 000000000000..201d12b7ab7f --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryResourceInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryResourceProperties; +import java.io.IOException; + +/** + * RecoveryPlan Resource a AzureResilienceProviderHub resource. + */ +@Fluent +public final class RecoveryResourceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private RecoveryResourceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RecoveryResourceInner class. + */ + public RecoveryResourceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public RecoveryResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the RecoveryResourceInner object itself. + */ + public RecoveryResourceInner withProperties(RecoveryResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryResourceInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecoveryResourceInner. + */ + public static RecoveryResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryResourceInner deserializedRecoveryResourceInner = new RecoveryResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRecoveryResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRecoveryResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRecoveryResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRecoveryResourceInner.properties = RecoveryResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRecoveryResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryResourceInner; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryResourceQualificationInner.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryResourceQualificationInner.java new file mode 100644 index 000000000000..fc9ba964a3cd --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryResourceQualificationInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.models.OperationQualificationDetails; +import java.io.IOException; + +/** + * Details of resource and its qualification for an operation. + */ +@Immutable +public final class RecoveryResourceQualificationInner implements JsonSerializable { + /* + * Recovery orchestration resource. + */ + private RecoveryResourceInner recoveryResource; + + /* + * Details of qualification for the operation. + */ + private OperationQualificationDetails operationQualificationDetails; + + /** + * Creates an instance of RecoveryResourceQualificationInner class. + */ + private RecoveryResourceQualificationInner() { + } + + /** + * Get the recoveryResource property: Recovery orchestration resource. + * + * @return the recoveryResource value. + */ + public RecoveryResourceInner recoveryResource() { + return this.recoveryResource; + } + + /** + * Get the operationQualificationDetails property: Details of qualification for the operation. + * + * @return the operationQualificationDetails value. + */ + public OperationQualificationDetails operationQualificationDetails() { + return this.operationQualificationDetails; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("recoveryResource", this.recoveryResource); + jsonWriter.writeJsonField("operationQualificationDetails", this.operationQualificationDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryResourceQualificationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryResourceQualificationInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecoveryResourceQualificationInner. + */ + public static RecoveryResourceQualificationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryResourceQualificationInner deserializedRecoveryResourceQualificationInner + = new RecoveryResourceQualificationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recoveryResource".equals(fieldName)) { + deserializedRecoveryResourceQualificationInner.recoveryResource + = RecoveryResourceInner.fromJson(reader); + } else if ("operationQualificationDetails".equals(fieldName)) { + deserializedRecoveryResourceQualificationInner.operationQualificationDetails + = OperationQualificationDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryResourceQualificationInner; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/UnifiedResilienceItemInner.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/UnifiedResilienceItemInner.java new file mode 100644 index 000000000000..afdb7c0feda6 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/UnifiedResilienceItemInner.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.models.UnifiedResilienceItemProperties; +import java.io.IOException; + +/** + * A unified resilience item represents a computed and aggregated resilience information of Azure Applications. + */ +@Immutable +public final class UnifiedResilienceItemInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private UnifiedResilienceItemProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of UnifiedResilienceItemInner class. + */ + private UnifiedResilienceItemInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public UnifiedResilienceItemProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UnifiedResilienceItemInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UnifiedResilienceItemInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UnifiedResilienceItemInner. + */ + public static UnifiedResilienceItemInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UnifiedResilienceItemInner deserializedUnifiedResilienceItemInner = new UnifiedResilienceItemInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedUnifiedResilienceItemInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedUnifiedResilienceItemInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedUnifiedResilienceItemInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedUnifiedResilienceItemInner.properties + = UnifiedResilienceItemProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedUnifiedResilienceItemInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUnifiedResilienceItemInner; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/UpdateRecoveryResourcesResponseInner.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/UpdateRecoveryResourcesResponseInner.java new file mode 100644 index 000000000000..2203f85819c8 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/UpdateRecoveryResourcesResponseInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * RecoveryResources post action request to update in batch. + */ +@Immutable +public final class UpdateRecoveryResourcesResponseInner + implements JsonSerializable { + /* + * A list of error details associated with resources for which the update has failed. + */ + private List failedResources; + + /** + * Creates an instance of UpdateRecoveryResourcesResponseInner class. + */ + private UpdateRecoveryResourcesResponseInner() { + } + + /** + * Get the failedResources property: A list of error details associated with resources for which the update has + * failed. + * + * @return the failedResources value. + */ + public List failedResources() { + return this.failedResources; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("failedResources", this.failedResources, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateRecoveryResourcesResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateRecoveryResourcesResponseInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UpdateRecoveryResourcesResponseInner. + */ + public static UpdateRecoveryResourcesResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateRecoveryResourcesResponseInner deserializedUpdateRecoveryResourcesResponseInner + = new UpdateRecoveryResourcesResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("failedResources".equals(fieldName)) { + List failedResources + = reader.readArray(reader1 -> RecoveryResourceInner.fromJson(reader1)); + deserializedUpdateRecoveryResourcesResponseInner.failedResources = failedResources; + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateRecoveryResourcesResponseInner; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/UsagePlanInner.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/UsagePlanInner.java new file mode 100644 index 000000000000..f4ded5f4caa6 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/UsagePlanInner.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.models.UsagePlanProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A usage plan resource for Resiliency feature billing. + */ +@Fluent +public final class UsagePlanInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private UsagePlanProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of UsagePlanInner class. + */ + public UsagePlanInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public UsagePlanProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the UsagePlanInner object itself. + */ + public UsagePlanInner withProperties(UsagePlanProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public UsagePlanInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public UsagePlanInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsagePlanInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsagePlanInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UsagePlanInner. + */ + public static UsagePlanInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsagePlanInner deserializedUsagePlanInner = new UsagePlanInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedUsagePlanInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedUsagePlanInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedUsagePlanInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedUsagePlanInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedUsagePlanInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedUsagePlanInner.properties = UsagePlanProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedUsagePlanInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUsagePlanInner; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/ValidateForRecoveryOperationBaseResponseInner.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/ValidateForRecoveryOperationBaseResponseInner.java new file mode 100644 index 000000000000..7d7053401f14 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/ValidateForRecoveryOperationBaseResponseInner.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * ValidateForRecoveryOperation post action response. + */ +@Immutable +public final class ValidateForRecoveryOperationBaseResponseInner + implements JsonSerializable { + /* + * Qualification details of resources for the operation. + */ + private List recoveryResourceQualifications; + + /** + * Creates an instance of ValidateForRecoveryOperationBaseResponseInner class. + */ + private ValidateForRecoveryOperationBaseResponseInner() { + } + + /** + * Get the recoveryResourceQualifications property: Qualification details of resources for the operation. + * + * @return the recoveryResourceQualifications value. + */ + public List recoveryResourceQualifications() { + return this.recoveryResourceQualifications; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("recoveryResourceQualifications", this.recoveryResourceQualifications, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidateForRecoveryOperationBaseResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidateForRecoveryOperationBaseResponseInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ValidateForRecoveryOperationBaseResponseInner. + */ + public static ValidateForRecoveryOperationBaseResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidateForRecoveryOperationBaseResponseInner deserializedValidateForRecoveryOperationBaseResponseInner + = new ValidateForRecoveryOperationBaseResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recoveryResourceQualifications".equals(fieldName)) { + List recoveryResourceQualifications + = reader.readArray(reader1 -> RecoveryResourceQualificationInner.fromJson(reader1)); + deserializedValidateForRecoveryOperationBaseResponseInner.recoveryResourceQualifications + = recoveryResourceQualifications; + } else { + reader.skipChildren(); + } + } + + return deserializedValidateForRecoveryOperationBaseResponseInner; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/package-info.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/package-info.java new file mode 100644 index 000000000000..3e4783291af6 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the inner data models for ResilienceManagement. + */ +package com.azure.resourcemanager.resiliencemanagement.fluent.models; diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/package-info.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/package-info.java new file mode 100644 index 000000000000..89f46ee6533b --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the service clients for ResilienceManagement. + */ +package com.azure.resourcemanager.resiliencemanagement.fluent; diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillImpl.java new file mode 100644 index 000000000000..0f75bc759d6b --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillImpl.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillInner; +import com.azure.resourcemanager.resiliencemanagement.models.Drill; +import com.azure.resourcemanager.resiliencemanagement.models.DrillProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentity; + +public final class DrillImpl implements Drill { + private DrillInner innerObject; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + DrillImpl(DrillInner innerObject, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager 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 DrillProperties properties() { + return this.innerModel().properties(); + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DrillInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillResourceImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillResourceImpl.java new file mode 100644 index 000000000000..1770c1b41f2d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillResourceImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillResourceInner; +import com.azure.resourcemanager.resiliencemanagement.models.DrillResource; +import com.azure.resourcemanager.resiliencemanagement.models.DrillResourceProperties; + +public final class DrillResourceImpl implements DrillResource { + private DrillResourceInner innerObject; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + DrillResourceImpl(DrillResourceInner innerObject, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager 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 DrillResourceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DrillResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillResourcesClientImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillResourcesClientImpl.java new file mode 100644 index 000000000000..a8f0ce73601b --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillResourcesClientImpl.java @@ -0,0 +1,390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.DrillResourcesClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillResourceInner; +import com.azure.resourcemanager.resiliencemanagement.implementation.models.DrillResourceListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DrillResourcesClient. + */ +public final class DrillResourcesClientImpl implements DrillResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final DrillResourcesService service; + + /** + * The service client containing this operation class. + */ + private final ResilienceManagementManagementClientImpl client; + + /** + * Initializes an instance of DrillResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DrillResourcesClientImpl(ResilienceManagementManagementClientImpl client) { + this.service + = RestProxy.create(DrillResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResilienceManagementManagementClientDrillResources to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ResilienceManagementManagementClientDrillResources") + public interface DrillResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillResources/{drillResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("drillName") String drillName, @PathParam("drillResourceName") String drillResourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillResources/{drillResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("drillName") String drillName, @PathParam("drillResourceName") String drillResourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @PathParam("drillName") String drillName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @PathParam("drillName") String drillName, @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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a DrillResource. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillResourceName The name of the DrillResource (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 DrillResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String serviceGroupName, String drillName, + String drillResourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), drillName, drillResourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a DrillResource. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillResourceName The name of the DrillResource (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 DrillResource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String serviceGroupName, String drillName, String drillResourceName) { + return getWithResponseAsync(serviceGroupName, drillName, drillResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a DrillResource. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillResourceName The name of the DrillResource (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 DrillResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String serviceGroupName, String drillName, + String drillResourceName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), drillName, + drillResourceName, accept, context); + } + + /** + * Get a DrillResource. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillResourceName The name of the DrillResource (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 DrillResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DrillResourceInner get(String serviceGroupName, String drillName, String drillResourceName) { + return getWithResponse(serviceGroupName, drillName, drillResourceName, Context.NONE).getValue(); + } + + /** + * List DrillResource resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillResource list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String serviceGroupName, String drillName, + String skipToken, Integer top) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, drillName, 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 DrillResource resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String serviceGroupName, String drillName, String skipToken, + Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(serviceGroupName, drillName, skipToken, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List DrillResource resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String serviceGroupName, String drillName) { + final String skipToken = null; + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(serviceGroupName, drillName, skipToken, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List DrillResource resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String drillName, + String skipToken, Integer top) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, drillName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List DrillResource resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String drillName, + String skipToken, Integer top, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, drillName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List DrillResource resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName, String drillName) { + final String skipToken = null; + final Integer top = null; + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, drillName, skipToken, top), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List DrillResource resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName, String drillName, String skipToken, + Integer top, Context context) { + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, drillName, skipToken, top, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillResource list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillResourcesImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillResourcesImpl.java new file mode 100644 index 000000000000..9a7afb9877e8 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillResourcesImpl.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.DrillResourcesClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillResourceInner; +import com.azure.resourcemanager.resiliencemanagement.models.DrillResource; +import com.azure.resourcemanager.resiliencemanagement.models.DrillResources; + +public final class DrillResourcesImpl implements DrillResources { + private static final ClientLogger LOGGER = new ClientLogger(DrillResourcesImpl.class); + + private final DrillResourcesClient innerClient; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + public DrillResourcesImpl(DrillResourcesClient innerClient, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String serviceGroupName, String drillName, String drillResourceName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(serviceGroupName, drillName, drillResourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DrillResourceImpl(inner.getValue(), this.manager())); + } + + public DrillResource get(String serviceGroupName, String drillName, String drillResourceName) { + DrillResourceInner inner = this.serviceClient().get(serviceGroupName, drillName, drillResourceName); + if (inner != null) { + return new DrillResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String serviceGroupName, String drillName) { + PagedIterable inner = this.serviceClient().list(serviceGroupName, drillName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DrillResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String serviceGroupName, String drillName, String skipToken, Integer top, + Context context) { + PagedIterable inner + = this.serviceClient().list(serviceGroupName, drillName, skipToken, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DrillResourceImpl(inner1, this.manager())); + } + + private DrillResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunImpl.java new file mode 100644 index 000000000000..83c1948e2e15 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillRunInner; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRun; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunProperties; + +public final class DrillRunImpl implements DrillRun { + private DrillRunInner innerObject; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + DrillRunImpl(DrillRunInner innerObject, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager 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 DrillRunProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DrillRunInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunResourceImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunResourceImpl.java new file mode 100644 index 000000000000..6d18779dfa99 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunResourceImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillRunResourceInner; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunResource; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunResourceProperties; + +public final class DrillRunResourceImpl implements DrillRunResource { + private DrillRunResourceInner innerObject; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + DrillRunResourceImpl(DrillRunResourceInner innerObject, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager 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 DrillRunResourceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DrillRunResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunResourcesClientImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunResourcesClientImpl.java new file mode 100644 index 000000000000..a25b04968f69 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunResourcesClientImpl.java @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.DrillRunResourcesClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillRunResourceInner; +import com.azure.resourcemanager.resiliencemanagement.implementation.models.DrillRunResourceListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DrillRunResourcesClient. + */ +public final class DrillRunResourcesClientImpl implements DrillRunResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final DrillRunResourcesService service; + + /** + * The service client containing this operation class. + */ + private final ResilienceManagementManagementClientImpl client; + + /** + * Initializes an instance of DrillRunResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DrillRunResourcesClientImpl(ResilienceManagementManagementClientImpl client) { + this.service + = RestProxy.create(DrillRunResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResilienceManagementManagementClientDrillRunResources to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ResilienceManagementManagementClientDrillRunResources") + public interface DrillRunResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillRuns/{drillRunName}/drillRunResources/{drillRunResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("drillName") String drillName, @PathParam("drillRunName") String drillRunName, + @PathParam("drillRunResourceName") String drillRunResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillRuns/{drillRunName}/drillRunResources/{drillRunResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("drillName") String drillName, @PathParam("drillRunName") String drillRunName, + @PathParam("drillRunResourceName") String drillRunResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillRuns/{drillRunName}/drillRunResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("drillName") String drillName, @PathParam("drillRunName") String drillRunName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillRuns/{drillRunName}/drillRunResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("drillName") String drillName, @PathParam("drillRunName") String drillRunName, + @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a DrillRunResource. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param drillRunResourceName The unique name (GUID) of the recovery job 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 a DrillRunResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String serviceGroupName, String drillName, + String drillRunName, String drillRunResourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), drillName, drillRunName, drillRunResourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a DrillRunResource. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param drillRunResourceName The unique name (GUID) of the recovery job 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 a DrillRunResource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String serviceGroupName, String drillName, String drillRunName, + String drillRunResourceName) { + return getWithResponseAsync(serviceGroupName, drillName, drillRunName, drillRunResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a DrillRunResource. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param drillRunResourceName The unique name (GUID) of the recovery job 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 a DrillRunResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String serviceGroupName, String drillName, + String drillRunName, String drillRunResourceName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), drillName, + drillRunName, drillRunResourceName, accept, context); + } + + /** + * Get a DrillRunResource. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param drillRunResourceName The unique name (GUID) of the recovery job 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 a DrillRunResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DrillRunResourceInner get(String serviceGroupName, String drillName, String drillRunName, + String drillRunResourceName) { + return getWithResponse(serviceGroupName, drillName, drillRunName, drillRunResourceName, Context.NONE) + .getValue(); + } + + /** + * List DrillRunResource resources by DrillRun. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 the response of a DrillRunResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String serviceGroupName, String drillName, + String drillRunName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), drillName, drillRunName, 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 DrillRunResource resources by DrillRun. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 the response of a DrillRunResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String serviceGroupName, String drillName, String drillRunName) { + return new PagedFlux<>(() -> listSinglePageAsync(serviceGroupName, drillName, drillRunName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List DrillRunResource resources by DrillRun. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 the response of a DrillRunResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String drillName, + String drillRunName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), drillName, drillRunName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List DrillRunResource resources by DrillRun. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillRunResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String drillName, + String drillRunName, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), drillName, drillRunName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List DrillRunResource resources by DrillRun. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 the response of a DrillRunResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName, String drillName, String drillRunName) { + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, drillName, drillRunName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List DrillRunResource resources by DrillRun. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillRunResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName, String drillName, String drillRunName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, drillName, drillRunName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillRunResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillRunResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillRunResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunResourcesImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunResourcesImpl.java new file mode 100644 index 000000000000..e0cb88bb661d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunResourcesImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.DrillRunResourcesClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillRunResourceInner; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunResource; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunResources; + +public final class DrillRunResourcesImpl implements DrillRunResources { + private static final ClientLogger LOGGER = new ClientLogger(DrillRunResourcesImpl.class); + + private final DrillRunResourcesClient innerClient; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + public DrillRunResourcesImpl(DrillRunResourcesClient innerClient, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String serviceGroupName, String drillName, String drillRunName, + String drillRunResourceName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(serviceGroupName, drillName, drillRunName, drillRunResourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DrillRunResourceImpl(inner.getValue(), this.manager())); + } + + public DrillRunResource get(String serviceGroupName, String drillName, String drillRunName, + String drillRunResourceName) { + DrillRunResourceInner inner + = this.serviceClient().get(serviceGroupName, drillName, drillRunName, drillRunResourceName); + if (inner != null) { + return new DrillRunResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String serviceGroupName, String drillName, String drillRunName) { + PagedIterable inner + = this.serviceClient().list(serviceGroupName, drillName, drillRunName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DrillRunResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String serviceGroupName, String drillName, String drillRunName, + Context context) { + PagedIterable inner + = this.serviceClient().list(serviceGroupName, drillName, drillRunName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DrillRunResourceImpl(inner1, this.manager())); + } + + private DrillRunResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunsClientImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunsClientImpl.java new file mode 100644 index 000000000000..158748f132ca --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunsClientImpl.java @@ -0,0 +1,1390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.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.BinaryData; +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.resiliencemanagement.fluent.DrillRunsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillRunInner; +import com.azure.resourcemanager.resiliencemanagement.implementation.models.DrillRunListResult; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunAddNotesRequest; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunFailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.MarkAsCompleteRequest; +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 DrillRunsClient. + */ +public final class DrillRunsClientImpl implements DrillRunsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DrillRunsService service; + + /** + * The service client containing this operation class. + */ + private final ResilienceManagementManagementClientImpl client; + + /** + * Initializes an instance of DrillRunsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DrillRunsClientImpl(ResilienceManagementManagementClientImpl client) { + this.service + = RestProxy.create(DrillRunsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResilienceManagementManagementClientDrillRuns to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ResilienceManagementManagementClientDrillRuns") + public interface DrillRunsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillRuns/{drillRunName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("drillName") String drillName, @PathParam("drillRunName") String drillRunName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillRuns/{drillRunName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("drillName") String drillName, @PathParam("drillRunName") String drillRunName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillRuns") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("drillName") String drillName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillRuns") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("drillName") String drillName, @HeaderParam("Accept") String accept, Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillRuns/{drillRunName}/failOver") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> failOver(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("drillName") String drillName, + @PathParam("drillRunName") String drillRunName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DrillRunFailoverRequest body, + Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillRuns/{drillRunName}/failOver") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response failOverSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("drillName") String drillName, + @PathParam("drillRunName") String drillRunName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DrillRunFailoverRequest body, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillRuns/{drillRunName}/reprotect") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reprotect(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("drillName") String drillName, + @PathParam("drillRunName") String drillRunName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillRuns/{drillRunName}/reprotect") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response reprotectSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("drillName") String drillName, + @PathParam("drillRunName") String drillRunName, @HeaderParam("Accept") String accept, Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillRuns/{drillRunName}/addNotes") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> addNotes(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("drillName") String drillName, + @PathParam("drillRunName") String drillRunName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DrillRunAddNotesRequest body, + Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillRuns/{drillRunName}/addNotes") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response addNotesSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("drillName") String drillName, + @PathParam("drillRunName") String drillRunName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DrillRunAddNotesRequest body, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillRuns/{drillRunName}/resume") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resume(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("drillName") String drillName, + @PathParam("drillRunName") String drillRunName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillRuns/{drillRunName}/resume") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response resumeSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("drillName") String drillName, + @PathParam("drillRunName") String drillRunName, @HeaderParam("Accept") String accept, Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillRuns/{drillRunName}/markAsComplete") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> markAsComplete(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("drillName") String drillName, + @PathParam("drillRunName") String drillRunName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") MarkAsCompleteRequest body, + Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/drillRuns/{drillRunName}/markAsComplete") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response markAsCompleteSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("drillName") String drillName, + @PathParam("drillRunName") String drillRunName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") MarkAsCompleteRequest body, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a DrillRun. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 DrillRun along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String serviceGroupName, String drillName, + String drillRunName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), drillName, drillRunName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a DrillRun. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 DrillRun on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String serviceGroupName, String drillName, String drillRunName) { + return getWithResponseAsync(serviceGroupName, drillName, drillRunName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a DrillRun. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 DrillRun along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String serviceGroupName, String drillName, String drillRunName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), drillName, + drillRunName, accept, context); + } + + /** + * Get a DrillRun. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 DrillRun. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DrillRunInner get(String serviceGroupName, String drillName, String drillRunName) { + return getWithResponse(serviceGroupName, drillName, drillRunName, Context.NONE).getValue(); + } + + /** + * List DrillRun resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillRun list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String serviceGroupName, String drillName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), drillName, 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 DrillRun resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillRun list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String serviceGroupName, String drillName) { + return new PagedFlux<>(() -> listSinglePageAsync(serviceGroupName, drillName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List DrillRun resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillRun list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String drillName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), drillName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List DrillRun resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillRun list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String drillName, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), drillName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List DrillRun resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillRun list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName, String drillName) { + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, drillName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List DrillRun resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillRun list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName, String drillName, Context context) { + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, drillName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * This initiates a new Failover operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 request body for TestFailoverCleanup API along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failOverWithResponseAsync(String serviceGroupName, String operationId, + String drillName, String drillRunName, DrillRunFailoverRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.failOver(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, drillName, drillRunName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This initiates a new Failover operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 request body for TestFailoverCleanup API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response failOverWithResponse(String serviceGroupName, String operationId, String drillName, + String drillRunName, DrillRunFailoverRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.failOverSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, drillName, drillRunName, contentType, accept, body, Context.NONE); + } + + /** + * This initiates a new Failover operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 request body for TestFailoverCleanup API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response failOverWithResponse(String serviceGroupName, String operationId, String drillName, + String drillRunName, DrillRunFailoverRequest body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.failOverSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, drillName, drillRunName, contentType, accept, body, context); + } + + /** + * This initiates a new Failover operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 the {@link PollerFlux} for polling of request body for TestFailoverCleanup API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginFailOverAsync(String serviceGroupName, String operationId, + String drillName, String drillRunName, DrillRunFailoverRequest body) { + Mono>> mono + = failOverWithResponseAsync(serviceGroupName, operationId, drillName, drillRunName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * This initiates a new Failover operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 the {@link SyncPoller} for polling of request body for TestFailoverCleanup API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginFailOver(String serviceGroupName, String operationId, + String drillName, String drillRunName, DrillRunFailoverRequest body) { + Response response + = failOverWithResponse(serviceGroupName, operationId, drillName, drillRunName, body); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * This initiates a new Failover operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 the {@link SyncPoller} for polling of request body for TestFailoverCleanup API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginFailOver(String serviceGroupName, String operationId, + String drillName, String drillRunName, DrillRunFailoverRequest body, Context context) { + Response response + = failOverWithResponse(serviceGroupName, operationId, drillName, drillRunName, body, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * This initiates a new Failover operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 request body for TestFailoverCleanup API on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failOverAsync(String serviceGroupName, String operationId, String drillName, String drillRunName, + DrillRunFailoverRequest body) { + return beginFailOverAsync(serviceGroupName, operationId, drillName, drillRunName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This initiates a new Failover operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void failOver(String serviceGroupName, String operationId, String drillName, String drillRunName, + DrillRunFailoverRequest body) { + beginFailOver(serviceGroupName, operationId, drillName, drillRunName, body).getFinalResult(); + } + + /** + * This initiates a new Failover operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void failOver(String serviceGroupName, String operationId, String drillName, String drillRunName, + DrillRunFailoverRequest body, Context context) { + beginFailOver(serviceGroupName, operationId, drillName, drillRunName, body, context).getFinalResult(); + } + + /** + * This initiates a new Reprotect operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 request body for TestFailoverCleanup API along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reprotectWithResponseAsync(String serviceGroupName, String operationId, + String drillName, String drillRunName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.reprotect(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, drillName, drillRunName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This initiates a new Reprotect operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 request body for TestFailoverCleanup API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response reprotectWithResponse(String serviceGroupName, String operationId, String drillName, + String drillRunName) { + final String accept = "application/json"; + return service.reprotectSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, drillName, drillRunName, accept, Context.NONE); + } + + /** + * This initiates a new Reprotect operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return request body for TestFailoverCleanup API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response reprotectWithResponse(String serviceGroupName, String operationId, String drillName, + String drillRunName, Context context) { + final String accept = "application/json"; + return service.reprotectSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, drillName, drillRunName, accept, context); + } + + /** + * This initiates a new Reprotect operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 the {@link PollerFlux} for polling of request body for TestFailoverCleanup API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginReprotectAsync(String serviceGroupName, String operationId, + String drillName, String drillRunName) { + Mono>> mono + = reprotectWithResponseAsync(serviceGroupName, operationId, drillName, drillRunName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * This initiates a new Reprotect operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 the {@link SyncPoller} for polling of request body for TestFailoverCleanup API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReprotect(String serviceGroupName, String operationId, + String drillName, String drillRunName) { + Response response = reprotectWithResponse(serviceGroupName, operationId, drillName, drillRunName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * This initiates a new Reprotect operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 request body for TestFailoverCleanup API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReprotect(String serviceGroupName, String operationId, + String drillName, String drillRunName, Context context) { + Response response + = reprotectWithResponse(serviceGroupName, operationId, drillName, drillRunName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * This initiates a new Reprotect operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 request body for TestFailoverCleanup API on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reprotectAsync(String serviceGroupName, String operationId, String drillName, + String drillRunName) { + return beginReprotectAsync(serviceGroupName, operationId, drillName, drillRunName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This initiates a new Reprotect operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reprotect(String serviceGroupName, String operationId, String drillName, String drillRunName) { + beginReprotect(serviceGroupName, operationId, drillName, drillRunName).getFinalResult(); + } + + /** + * This initiates a new Reprotect operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 reprotect(String serviceGroupName, String operationId, String drillName, String drillRunName, + Context context) { + beginReprotect(serviceGroupName, operationId, drillName, drillRunName, context).getFinalResult(); + } + + /** + * This enables the user to add notes on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 request body for TestFailoverCleanup API along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> addNotesWithResponseAsync(String serviceGroupName, String operationId, + String drillName, String drillRunName, DrillRunAddNotesRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.addNotes(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, drillName, drillRunName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This enables the user to add notes on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 request body for TestFailoverCleanup API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response addNotesWithResponse(String serviceGroupName, String operationId, String drillName, + String drillRunName, DrillRunAddNotesRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.addNotesSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, drillName, drillRunName, contentType, accept, body, Context.NONE); + } + + /** + * This enables the user to add notes on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 request body for TestFailoverCleanup API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response addNotesWithResponse(String serviceGroupName, String operationId, String drillName, + String drillRunName, DrillRunAddNotesRequest body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.addNotesSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, drillName, drillRunName, contentType, accept, body, context); + } + + /** + * This enables the user to add notes on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 the {@link PollerFlux} for polling of request body for TestFailoverCleanup API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginAddNotesAsync(String serviceGroupName, String operationId, + String drillName, String drillRunName, DrillRunAddNotesRequest body) { + Mono>> mono + = addNotesWithResponseAsync(serviceGroupName, operationId, drillName, drillRunName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * This enables the user to add notes on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 the {@link SyncPoller} for polling of request body for TestFailoverCleanup API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginAddNotes(String serviceGroupName, String operationId, + String drillName, String drillRunName, DrillRunAddNotesRequest body) { + Response response + = addNotesWithResponse(serviceGroupName, operationId, drillName, drillRunName, body); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * This enables the user to add notes on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 the {@link SyncPoller} for polling of request body for TestFailoverCleanup API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginAddNotes(String serviceGroupName, String operationId, + String drillName, String drillRunName, DrillRunAddNotesRequest body, Context context) { + Response response + = addNotesWithResponse(serviceGroupName, operationId, drillName, drillRunName, body, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * This enables the user to add notes on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 request body for TestFailoverCleanup API on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono addNotesAsync(String serviceGroupName, String operationId, String drillName, String drillRunName, + DrillRunAddNotesRequest body) { + return beginAddNotesAsync(serviceGroupName, operationId, drillName, drillRunName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This enables the user to add notes on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void addNotes(String serviceGroupName, String operationId, String drillName, String drillRunName, + DrillRunAddNotesRequest body) { + beginAddNotes(serviceGroupName, operationId, drillName, drillRunName, body).getFinalResult(); + } + + /** + * This enables the user to add notes on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void addNotes(String serviceGroupName, String operationId, String drillName, String drillRunName, + DrillRunAddNotesRequest body, Context context) { + beginAddNotes(serviceGroupName, operationId, drillName, drillRunName, body, context).getFinalResult(); + } + + /** + * This unblocks a Failover workflow that is paused after the Fault stage, to proceed to the Failover stage. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 request body for TestFailoverCleanup API along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resumeWithResponseAsync(String serviceGroupName, String operationId, + String drillName, String drillRunName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.resume(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, drillName, drillRunName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This unblocks a Failover workflow that is paused after the Fault stage, to proceed to the Failover stage. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 request body for TestFailoverCleanup API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response resumeWithResponse(String serviceGroupName, String operationId, String drillName, + String drillRunName) { + final String accept = "application/json"; + return service.resumeSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), operationId, + drillName, drillRunName, accept, Context.NONE); + } + + /** + * This unblocks a Failover workflow that is paused after the Fault stage, to proceed to the Failover stage. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return request body for TestFailoverCleanup API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response resumeWithResponse(String serviceGroupName, String operationId, String drillName, + String drillRunName, Context context) { + final String accept = "application/json"; + return service.resumeSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), operationId, + drillName, drillRunName, accept, context); + } + + /** + * This unblocks a Failover workflow that is paused after the Fault stage, to proceed to the Failover stage. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 the {@link PollerFlux} for polling of request body for TestFailoverCleanup API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginResumeAsync(String serviceGroupName, String operationId, + String drillName, String drillRunName) { + Mono>> mono + = resumeWithResponseAsync(serviceGroupName, operationId, drillName, drillRunName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * This unblocks a Failover workflow that is paused after the Fault stage, to proceed to the Failover stage. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 the {@link SyncPoller} for polling of request body for TestFailoverCleanup API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResume(String serviceGroupName, String operationId, String drillName, + String drillRunName) { + Response response = resumeWithResponse(serviceGroupName, operationId, drillName, drillRunName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * This unblocks a Failover workflow that is paused after the Fault stage, to proceed to the Failover stage. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 request body for TestFailoverCleanup API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResume(String serviceGroupName, String operationId, String drillName, + String drillRunName, Context context) { + Response response + = resumeWithResponse(serviceGroupName, operationId, drillName, drillRunName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * This unblocks a Failover workflow that is paused after the Fault stage, to proceed to the Failover stage. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 request body for TestFailoverCleanup API on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumeAsync(String serviceGroupName, String operationId, String drillName, String drillRunName) { + return beginResumeAsync(serviceGroupName, operationId, drillName, drillRunName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This unblocks a Failover workflow that is paused after the Fault stage, to proceed to the Failover stage. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resume(String serviceGroupName, String operationId, String drillName, String drillRunName) { + beginResume(serviceGroupName, operationId, drillName, drillRunName).getFinalResult(); + } + + /** + * This unblocks a Failover workflow that is paused after the Fault stage, to proceed to the Failover stage. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resume(String serviceGroupName, String operationId, String drillName, String drillRunName, + Context context) { + beginResume(serviceGroupName, operationId, drillName, drillRunName, context).getFinalResult(); + } + + /** + * This enables the user to mark this stage as complete, disabling further retries on it. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 response body for MarkAsComplete API along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> markAsCompleteWithResponseAsync(String serviceGroupName, + String operationId, String drillName, String drillRunName, MarkAsCompleteRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.markAsComplete(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, drillName, drillRunName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This enables the user to mark this stage as complete, disabling further retries on it. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 response body for MarkAsComplete API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response markAsCompleteWithResponse(String serviceGroupName, String operationId, + String drillName, String drillRunName, MarkAsCompleteRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.markAsCompleteSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, drillName, drillRunName, contentType, accept, body, Context.NONE); + } + + /** + * This enables the user to mark this stage as complete, disabling further retries on it. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 response body for MarkAsComplete API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response markAsCompleteWithResponse(String serviceGroupName, String operationId, + String drillName, String drillRunName, MarkAsCompleteRequest body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.markAsCompleteSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, drillName, drillRunName, contentType, accept, body, context); + } + + /** + * This enables the user to mark this stage as complete, disabling further retries on it. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 the {@link PollerFlux} for polling of response body for MarkAsComplete API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginMarkAsCompleteAsync(String serviceGroupName, String operationId, + String drillName, String drillRunName, MarkAsCompleteRequest body) { + Mono>> mono + = markAsCompleteWithResponseAsync(serviceGroupName, operationId, drillName, drillRunName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * This enables the user to mark this stage as complete, disabling further retries on it. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 the {@link SyncPoller} for polling of response body for MarkAsComplete API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginMarkAsComplete(String serviceGroupName, String operationId, + String drillName, String drillRunName, MarkAsCompleteRequest body) { + Response response + = markAsCompleteWithResponse(serviceGroupName, operationId, drillName, drillRunName, body); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * This enables the user to mark this stage as complete, disabling further retries on it. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 the {@link SyncPoller} for polling of response body for MarkAsComplete API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginMarkAsComplete(String serviceGroupName, String operationId, + String drillName, String drillRunName, MarkAsCompleteRequest body, Context context) { + Response response + = markAsCompleteWithResponse(serviceGroupName, operationId, drillName, drillRunName, body, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * This enables the user to mark this stage as complete, disabling further retries on it. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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 response body for MarkAsComplete API on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono markAsCompleteAsync(String serviceGroupName, String operationId, String drillName, + String drillRunName, MarkAsCompleteRequest body) { + return beginMarkAsCompleteAsync(serviceGroupName, operationId, drillName, drillRunName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This enables the user to mark this stage as complete, disabling further retries on it. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void markAsComplete(String serviceGroupName, String operationId, String drillName, String drillRunName, + MarkAsCompleteRequest body) { + beginMarkAsComplete(serviceGroupName, operationId, drillName, drillRunName, body).getFinalResult(); + } + + /** + * This enables the user to mark this stage as complete, disabling further retries on it. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void markAsComplete(String serviceGroupName, String operationId, String drillName, String drillRunName, + MarkAsCompleteRequest body, Context context) { + beginMarkAsComplete(serviceGroupName, operationId, drillName, drillRunName, body, context).getFinalResult(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillRun list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillRun list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillRun list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunsImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunsImpl.java new file mode 100644 index 000000000000..ba910cd3d62f --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunsImpl.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.DrillRunsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillRunInner; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRun; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunAddNotesRequest; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunFailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRuns; +import com.azure.resourcemanager.resiliencemanagement.models.MarkAsCompleteRequest; + +public final class DrillRunsImpl implements DrillRuns { + private static final ClientLogger LOGGER = new ClientLogger(DrillRunsImpl.class); + + private final DrillRunsClient innerClient; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + public DrillRunsImpl(DrillRunsClient innerClient, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String serviceGroupName, String drillName, String drillRunName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(serviceGroupName, drillName, drillRunName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DrillRunImpl(inner.getValue(), this.manager())); + } + + public DrillRun get(String serviceGroupName, String drillName, String drillRunName) { + DrillRunInner inner = this.serviceClient().get(serviceGroupName, drillName, drillRunName); + if (inner != null) { + return new DrillRunImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String serviceGroupName, String drillName) { + PagedIterable inner = this.serviceClient().list(serviceGroupName, drillName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DrillRunImpl(inner1, this.manager())); + } + + public PagedIterable list(String serviceGroupName, String drillName, Context context) { + PagedIterable inner = this.serviceClient().list(serviceGroupName, drillName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DrillRunImpl(inner1, this.manager())); + } + + public void failOver(String serviceGroupName, String operationId, String drillName, String drillRunName, + DrillRunFailoverRequest body) { + this.serviceClient().failOver(serviceGroupName, operationId, drillName, drillRunName, body); + } + + public void failOver(String serviceGroupName, String operationId, String drillName, String drillRunName, + DrillRunFailoverRequest body, Context context) { + this.serviceClient().failOver(serviceGroupName, operationId, drillName, drillRunName, body, context); + } + + public void reprotect(String serviceGroupName, String operationId, String drillName, String drillRunName) { + this.serviceClient().reprotect(serviceGroupName, operationId, drillName, drillRunName); + } + + public void reprotect(String serviceGroupName, String operationId, String drillName, String drillRunName, + Context context) { + this.serviceClient().reprotect(serviceGroupName, operationId, drillName, drillRunName, context); + } + + public void addNotes(String serviceGroupName, String operationId, String drillName, String drillRunName, + DrillRunAddNotesRequest body) { + this.serviceClient().addNotes(serviceGroupName, operationId, drillName, drillRunName, body); + } + + public void addNotes(String serviceGroupName, String operationId, String drillName, String drillRunName, + DrillRunAddNotesRequest body, Context context) { + this.serviceClient().addNotes(serviceGroupName, operationId, drillName, drillRunName, body, context); + } + + public void resume(String serviceGroupName, String operationId, String drillName, String drillRunName) { + this.serviceClient().resume(serviceGroupName, operationId, drillName, drillRunName); + } + + public void resume(String serviceGroupName, String operationId, String drillName, String drillRunName, + Context context) { + this.serviceClient().resume(serviceGroupName, operationId, drillName, drillRunName, context); + } + + public void markAsComplete(String serviceGroupName, String operationId, String drillName, String drillRunName, + MarkAsCompleteRequest body) { + this.serviceClient().markAsComplete(serviceGroupName, operationId, drillName, drillRunName, body); + } + + public void markAsComplete(String serviceGroupName, String operationId, String drillName, String drillRunName, + MarkAsCompleteRequest body, Context context) { + this.serviceClient().markAsComplete(serviceGroupName, operationId, drillName, drillRunName, body, context); + } + + private DrillRunsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillsClientImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillsClientImpl.java new file mode 100644 index 000000000000..8e85287a9bbb --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillsClientImpl.java @@ -0,0 +1,1884 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.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.management.polling.PollResult; +import com.azure.core.util.BinaryData; +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.resiliencemanagement.fluent.DrillsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillInner; +import com.azure.resourcemanager.resiliencemanagement.implementation.models.DrillListResult; +import com.azure.resourcemanager.resiliencemanagement.models.AddOrUpdateResourcesRequest; +import com.azure.resourcemanager.resiliencemanagement.models.DrillEndRequest; +import com.azure.resourcemanager.resiliencemanagement.models.DrillStartRequest; +import com.azure.resourcemanager.resiliencemanagement.models.DrillUpdate; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForExecutionRequest; +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 DrillsClient. + */ +public final class DrillsClientImpl implements DrillsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DrillsService service; + + /** + * The service client containing this operation class. + */ + private final ResilienceManagementManagementClientImpl client; + + /** + * Initializes an instance of DrillsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DrillsClientImpl(ResilienceManagementManagementClientImpl client) { + this.service = RestProxy.create(DrillsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResilienceManagementManagementClientDrills to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ResilienceManagementManagementClientDrills") + public interface DrillsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("drillName") String drillName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("drillName") String drillName, @HeaderParam("Accept") String accept, Context context); + + @Put("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("drillName") String drillName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DrillInner resource, Context context); + + @Put("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("drillName") String drillName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DrillInner resource, Context context); + + @Patch("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("drillName") String drillName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DrillUpdate properties, + Context context); + + @Patch("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("drillName") String drillName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DrillUpdate properties, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("drillName") String drillName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("drillName") String drillName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/validateForExecution") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validateForExecution(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("drillName") String drillName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ValidateForExecutionRequest body, Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/validateForExecution") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response validateForExecutionSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("drillName") String drillName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ValidateForExecutionRequest body, Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/start") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("drillName") String drillName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DrillStartRequest body, Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/start") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response startSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("drillName") String drillName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DrillStartRequest body, Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/end") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> end(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("drillName") String drillName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DrillEndRequest body, Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/end") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response endSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("drillName") String drillName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DrillEndRequest body, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/addOrUpdateResources") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> addOrUpdateResources(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("drillName") String drillName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") AddOrUpdateResourcesRequest body, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/addOrUpdateResources") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response addOrUpdateResourcesSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("drillName") String drillName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") AddOrUpdateResourcesRequest body, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/resyncReadinessCheck") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resyncReadinessCheck(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("drillName") String drillName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/drills/{drillName}/resyncReadinessCheck") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response resyncReadinessCheckSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("drillName") String drillName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Drill along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String serviceGroupName, String drillName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), drillName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Drill on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String serviceGroupName, String drillName) { + return getWithResponseAsync(serviceGroupName, drillName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Drill along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String serviceGroupName, String drillName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), drillName, + accept, context); + } + + /** + * Get a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Drill. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DrillInner get(String serviceGroupName, String drillName) { + return getWithResponse(serviceGroupName, drillName, Context.NONE).getValue(); + } + + /** + * Create a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return drill resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String serviceGroupName, String drillName, + DrillInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), drillName, contentType, accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return drill resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String serviceGroupName, String drillName, DrillInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), drillName, + contentType, accept, resource, Context.NONE); + } + + /** + * Create a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return drill resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String serviceGroupName, String drillName, DrillInner resource, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), drillName, + contentType, accept, resource, context); + } + + /** + * Create a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 drill resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DrillInner> beginCreateAsync(String serviceGroupName, String drillName, + DrillInner resource) { + Mono>> mono = createWithResponseAsync(serviceGroupName, drillName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), DrillInner.class, + DrillInner.class, this.client.getContext()); + } + + /** + * Create a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 drill resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DrillInner> beginCreate(String serviceGroupName, String drillName, + DrillInner resource) { + Response response = createWithResponse(serviceGroupName, drillName, resource); + return this.client.getLroResult(response, DrillInner.class, DrillInner.class, + Context.NONE); + } + + /** + * Create a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 drill resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DrillInner> beginCreate(String serviceGroupName, String drillName, + DrillInner resource, Context context) { + Response response = createWithResponse(serviceGroupName, drillName, resource, context); + return this.client.getLroResult(response, DrillInner.class, DrillInner.class, context); + } + + /** + * Create a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return drill resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String serviceGroupName, String drillName, DrillInner resource) { + return beginCreateAsync(serviceGroupName, drillName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return drill resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DrillInner create(String serviceGroupName, String drillName, DrillInner resource) { + return beginCreate(serviceGroupName, drillName, resource).getFinalResult(); + } + + /** + * Create a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return drill resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DrillInner create(String serviceGroupName, String drillName, DrillInner resource, Context context) { + return beginCreate(serviceGroupName, drillName, resource, context).getFinalResult(); + } + + /** + * Update a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return drill resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String serviceGroupName, String drillName, + DrillUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), drillName, contentType, accept, properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return drill resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String serviceGroupName, String drillName, DrillUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), drillName, + contentType, accept, properties, Context.NONE); + } + + /** + * Update a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return drill resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String serviceGroupName, String drillName, DrillUpdate properties, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), drillName, + contentType, accept, properties, context); + } + + /** + * Update a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 drill resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpdateAsync(String serviceGroupName, String drillName, + DrillUpdate properties) { + Mono>> mono = updateWithResponseAsync(serviceGroupName, drillName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Update a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 drill resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpdate(String serviceGroupName, String drillName, + DrillUpdate properties) { + Response response = updateWithResponse(serviceGroupName, drillName, properties); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Update a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 drill resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpdate(String serviceGroupName, String drillName, + DrillUpdate properties, Context context) { + Response response = updateWithResponse(serviceGroupName, drillName, properties, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Update a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return drill resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String serviceGroupName, String drillName, DrillUpdate properties) { + return beginUpdateAsync(serviceGroupName, drillName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceGroupName, String drillName, DrillUpdate properties) { + beginUpdate(serviceGroupName, drillName, properties).getFinalResult(); + } + + /** + * Update a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceGroupName, String drillName, DrillUpdate properties, Context context) { + beginUpdate(serviceGroupName, drillName, properties, context).getFinalResult(); + } + + /** + * Delete a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceGroupName, String drillName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), drillName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String serviceGroupName, String drillName) { + return service.deleteSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), drillName, + Context.NONE); + } + + /** + * Delete a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String serviceGroupName, String drillName, Context context) { + return service.deleteSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), drillName, + context); + } + + /** + * Delete a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String serviceGroupName, String drillName) { + Mono>> mono = deleteWithResponseAsync(serviceGroupName, drillName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String serviceGroupName, String drillName) { + Response response = deleteWithResponse(serviceGroupName, drillName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String serviceGroupName, String drillName, Context context) { + Response response = deleteWithResponse(serviceGroupName, drillName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceGroupName, String drillName) { + return beginDeleteAsync(serviceGroupName, drillName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceGroupName, String drillName) { + beginDelete(serviceGroupName, drillName).getFinalResult(); + } + + /** + * Delete a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceGroupName, String drillName, Context context) { + beginDelete(serviceGroupName, drillName, context).getFinalResult(); + } + + /** + * List Drill resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Drill list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String serviceGroupName, String skipToken, + Integer top) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, 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 Drill resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Drill list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String serviceGroupName, String skipToken, Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(serviceGroupName, skipToken, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Drill resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Drill list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String serviceGroupName) { + final String skipToken = null; + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(serviceGroupName, skipToken, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Drill resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Drill list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String skipToken, Integer top) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Drill resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Drill list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String skipToken, Integer top, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Drill resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Drill list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName) { + final String skipToken = null; + final Integer top = null; + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, skipToken, top), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List Drill resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Drill list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName, String skipToken, Integer top, Context context) { + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, skipToken, top, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * This returns eligible resource to be faulted or failed over. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 validateForExecution post action response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateForExecutionWithResponseAsync(String serviceGroupName, + String operationId, String drillName, ValidateForExecutionRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.validateForExecution(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, drillName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This returns eligible resource to be faulted or failed over. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 validateForExecution post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response validateForExecutionWithResponse(String serviceGroupName, String operationId, + String drillName, ValidateForExecutionRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.validateForExecutionSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, drillName, contentType, accept, body, Context.NONE); + } + + /** + * This returns eligible resource to be faulted or failed over. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 validateForExecution post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response validateForExecutionWithResponse(String serviceGroupName, String operationId, + String drillName, ValidateForExecutionRequest body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.validateForExecutionSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, drillName, contentType, accept, body, context); + } + + /** + * This returns eligible resource to be faulted or failed over. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 the {@link PollerFlux} for polling of validateForExecution post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginValidateForExecutionAsync(String serviceGroupName, + String operationId, String drillName, ValidateForExecutionRequest body) { + Mono>> mono + = validateForExecutionWithResponseAsync(serviceGroupName, operationId, drillName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * This returns eligible resource to be faulted or failed over. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 the {@link SyncPoller} for polling of validateForExecution post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginValidateForExecution(String serviceGroupName, String operationId, + String drillName, ValidateForExecutionRequest body) { + Response response + = validateForExecutionWithResponse(serviceGroupName, operationId, drillName, body); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * This returns eligible resource to be faulted or failed over. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 the {@link SyncPoller} for polling of validateForExecution post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginValidateForExecution(String serviceGroupName, String operationId, + String drillName, ValidateForExecutionRequest body, Context context) { + Response response + = validateForExecutionWithResponse(serviceGroupName, operationId, drillName, body, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * This returns eligible resource to be faulted or failed over. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 validateForExecution post action response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateForExecutionAsync(String serviceGroupName, String operationId, String drillName, + ValidateForExecutionRequest body) { + return beginValidateForExecutionAsync(serviceGroupName, operationId, drillName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This returns eligible resource to be faulted or failed over. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void validateForExecution(String serviceGroupName, String operationId, String drillName, + ValidateForExecutionRequest body) { + beginValidateForExecution(serviceGroupName, operationId, drillName, body).getFinalResult(); + } + + /** + * This returns eligible resource to be faulted or failed over. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void validateForExecution(String serviceGroupName, String operationId, String drillName, + ValidateForExecutionRequest body, Context context) { + beginValidateForExecution(serviceGroupName, operationId, drillName, body, context).getFinalResult(); + } + + /** + * This starts a new running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 response body of Drill actions along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String serviceGroupName, String operationId, + String drillName, DrillStartRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.start(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, drillName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This starts a new running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 response body of Drill actions along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response startWithResponse(String serviceGroupName, String operationId, String drillName, + DrillStartRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.startSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), operationId, + drillName, contentType, accept, body, Context.NONE); + } + + /** + * This starts a new running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 response body of Drill actions along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response startWithResponse(String serviceGroupName, String operationId, String drillName, + DrillStartRequest body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.startSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), operationId, + drillName, contentType, accept, body, context); + } + + /** + * This starts a new running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 the {@link PollerFlux} for polling of response body of Drill actions. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync(String serviceGroupName, String operationId, + String drillName, DrillStartRequest body) { + Mono>> mono = startWithResponseAsync(serviceGroupName, operationId, drillName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * This starts a new running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 the {@link SyncPoller} for polling of response body of Drill actions. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String serviceGroupName, String operationId, String drillName, + DrillStartRequest body) { + Response response = startWithResponse(serviceGroupName, operationId, drillName, body); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * This starts a new running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 the {@link SyncPoller} for polling of response body of Drill actions. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String serviceGroupName, String operationId, String drillName, + DrillStartRequest body, Context context) { + Response response = startWithResponse(serviceGroupName, operationId, drillName, body, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * This starts a new running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 response body of Drill actions on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String serviceGroupName, String operationId, String drillName, + DrillStartRequest body) { + return beginStartAsync(serviceGroupName, operationId, drillName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This starts a new running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String serviceGroupName, String operationId, String drillName, DrillStartRequest body) { + beginStart(serviceGroupName, operationId, drillName, body).getFinalResult(); + } + + /** + * This starts a new running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String serviceGroupName, String operationId, String drillName, DrillStartRequest body, + Context context) { + beginStart(serviceGroupName, operationId, drillName, body, context).getFinalResult(); + } + + /** + * This ends the currently running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 response body of Drill actions along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> endWithResponseAsync(String serviceGroupName, String operationId, + String drillName, DrillEndRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.end(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, drillName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This ends the currently running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 response body of Drill actions along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response endWithResponse(String serviceGroupName, String operationId, String drillName, + DrillEndRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.endSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), operationId, + drillName, contentType, accept, body, Context.NONE); + } + + /** + * This ends the currently running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 response body of Drill actions along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response endWithResponse(String serviceGroupName, String operationId, String drillName, + DrillEndRequest body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.endSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), operationId, + drillName, contentType, accept, body, context); + } + + /** + * This ends the currently running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 the {@link PollerFlux} for polling of response body of Drill actions. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginEndAsync(String serviceGroupName, String operationId, + String drillName, DrillEndRequest body) { + Mono>> mono = endWithResponseAsync(serviceGroupName, operationId, drillName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * This ends the currently running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 the {@link SyncPoller} for polling of response body of Drill actions. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginEnd(String serviceGroupName, String operationId, String drillName, + DrillEndRequest body) { + Response response = endWithResponse(serviceGroupName, operationId, drillName, body); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * This ends the currently running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 the {@link SyncPoller} for polling of response body of Drill actions. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginEnd(String serviceGroupName, String operationId, String drillName, + DrillEndRequest body, Context context) { + Response response = endWithResponse(serviceGroupName, operationId, drillName, body, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * This ends the currently running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 response body of Drill actions on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono endAsync(String serviceGroupName, String operationId, String drillName, DrillEndRequest body) { + return beginEndAsync(serviceGroupName, operationId, drillName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This ends the currently running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void end(String serviceGroupName, String operationId, String drillName, DrillEndRequest body) { + beginEnd(serviceGroupName, operationId, drillName, body).getFinalResult(); + } + + /** + * This ends the currently running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void end(String serviceGroupName, String operationId, String drillName, DrillEndRequest body, + Context context) { + beginEnd(serviceGroupName, operationId, drillName, body, context).getFinalResult(); + } + + /** + * This enables the user to include, exclude or update resources from their Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> addOrUpdateResourcesWithResponseAsync(String serviceGroupName, + String operationId, String drillName, AddOrUpdateResourcesRequest body) { + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.addOrUpdateResources(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, drillName, contentType, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This enables the user to include, exclude or update resources from their Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response addOrUpdateResourcesWithResponse(String serviceGroupName, String operationId, + String drillName, AddOrUpdateResourcesRequest body) { + final String contentType = "application/json"; + return service.addOrUpdateResourcesSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, drillName, contentType, body, Context.NONE); + } + + /** + * This enables the user to include, exclude or update resources from their Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response addOrUpdateResourcesWithResponse(String serviceGroupName, String operationId, + String drillName, AddOrUpdateResourcesRequest body, Context context) { + final String contentType = "application/json"; + return service.addOrUpdateResourcesSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, drillName, contentType, body, context); + } + + /** + * This enables the user to include, exclude or update resources from their Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginAddOrUpdateResourcesAsync(String serviceGroupName, + String operationId, String drillName, AddOrUpdateResourcesRequest body) { + Mono>> mono + = addOrUpdateResourcesWithResponseAsync(serviceGroupName, operationId, drillName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * This enables the user to include, exclude or update resources from their Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginAddOrUpdateResources(String serviceGroupName, String operationId, + String drillName, AddOrUpdateResourcesRequest body) { + Response response + = addOrUpdateResourcesWithResponse(serviceGroupName, operationId, drillName, body); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * This enables the user to include, exclude or update resources from their Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginAddOrUpdateResources(String serviceGroupName, String operationId, + String drillName, AddOrUpdateResourcesRequest body, Context context) { + Response response + = addOrUpdateResourcesWithResponse(serviceGroupName, operationId, drillName, body, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * This enables the user to include, exclude or update resources from their Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono addOrUpdateResourcesAsync(String serviceGroupName, String operationId, String drillName, + AddOrUpdateResourcesRequest body) { + return beginAddOrUpdateResourcesAsync(serviceGroupName, operationId, drillName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This enables the user to include, exclude or update resources from their Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void addOrUpdateResources(String serviceGroupName, String operationId, String drillName, + AddOrUpdateResourcesRequest body) { + beginAddOrUpdateResources(serviceGroupName, operationId, drillName, body).getFinalResult(); + } + + /** + * This enables the user to include, exclude or update resources from their Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void addOrUpdateResources(String serviceGroupName, String operationId, String drillName, + AddOrUpdateResourcesRequest body, Context context) { + beginAddOrUpdateResources(serviceGroupName, operationId, drillName, body, context).getFinalResult(); + } + + /** + * This triggers detection of any drifts from the desired state of Resources and RBAC. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> resyncReadinessCheckWithResponseAsync(String serviceGroupName, + String operationId, String drillName) { + return FluxUtil + .withContext(context -> service.resyncReadinessCheck(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, drillName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This triggers detection of any drifts from the desired state of Resources and RBAC. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response resyncReadinessCheckWithResponse(String serviceGroupName, String operationId, + String drillName) { + return service.resyncReadinessCheckSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, drillName, Context.NONE); + } + + /** + * This triggers detection of any drifts from the desired state of Resources and RBAC. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response resyncReadinessCheckWithResponse(String serviceGroupName, String operationId, + String drillName, Context context) { + return service.resyncReadinessCheckSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, drillName, context); + } + + /** + * This triggers detection of any drifts from the desired state of Resources and RBAC. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginResyncReadinessCheckAsync(String serviceGroupName, + String operationId, String drillName) { + Mono>> mono + = resyncReadinessCheckWithResponseAsync(serviceGroupName, operationId, drillName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * This triggers detection of any drifts from the desired state of Resources and RBAC. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResyncReadinessCheck(String serviceGroupName, String operationId, + String drillName) { + Response response = resyncReadinessCheckWithResponse(serviceGroupName, operationId, drillName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * This triggers detection of any drifts from the desired state of Resources and RBAC. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResyncReadinessCheck(String serviceGroupName, String operationId, + String drillName, Context context) { + Response response + = resyncReadinessCheckWithResponse(serviceGroupName, operationId, drillName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * This triggers detection of any drifts from the desired state of Resources and RBAC. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resyncReadinessCheckAsync(String serviceGroupName, String operationId, String drillName) { + return beginResyncReadinessCheckAsync(serviceGroupName, operationId, drillName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This triggers detection of any drifts from the desired state of Resources and RBAC. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resyncReadinessCheck(String serviceGroupName, String operationId, String drillName) { + beginResyncReadinessCheck(serviceGroupName, operationId, drillName).getFinalResult(); + } + + /** + * This triggers detection of any drifts from the desired state of Resources and RBAC. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resyncReadinessCheck(String serviceGroupName, String operationId, String drillName, Context context) { + beginResyncReadinessCheck(serviceGroupName, operationId, drillName, context).getFinalResult(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Drill list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Drill list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Drill list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillsImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillsImpl.java new file mode 100644 index 000000000000..b3076f041314 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillsImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.DrillsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillInner; +import com.azure.resourcemanager.resiliencemanagement.models.AddOrUpdateResourcesRequest; +import com.azure.resourcemanager.resiliencemanagement.models.Drill; +import com.azure.resourcemanager.resiliencemanagement.models.DrillEndRequest; +import com.azure.resourcemanager.resiliencemanagement.models.DrillStartRequest; +import com.azure.resourcemanager.resiliencemanagement.models.DrillUpdate; +import com.azure.resourcemanager.resiliencemanagement.models.Drills; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForExecutionRequest; + +public final class DrillsImpl implements Drills { + private static final ClientLogger LOGGER = new ClientLogger(DrillsImpl.class); + + private final DrillsClient innerClient; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + public DrillsImpl(DrillsClient innerClient, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String serviceGroupName, String drillName, Context context) { + Response inner = this.serviceClient().getWithResponse(serviceGroupName, drillName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DrillImpl(inner.getValue(), this.manager())); + } + + public Drill get(String serviceGroupName, String drillName) { + DrillInner inner = this.serviceClient().get(serviceGroupName, drillName); + if (inner != null) { + return new DrillImpl(inner, this.manager()); + } else { + return null; + } + } + + public Drill create(String serviceGroupName, String drillName, DrillInner resource) { + DrillInner inner = this.serviceClient().create(serviceGroupName, drillName, resource); + if (inner != null) { + return new DrillImpl(inner, this.manager()); + } else { + return null; + } + } + + public Drill create(String serviceGroupName, String drillName, DrillInner resource, Context context) { + DrillInner inner = this.serviceClient().create(serviceGroupName, drillName, resource, context); + if (inner != null) { + return new DrillImpl(inner, this.manager()); + } else { + return null; + } + } + + public void update(String serviceGroupName, String drillName, DrillUpdate properties) { + this.serviceClient().update(serviceGroupName, drillName, properties); + } + + public void update(String serviceGroupName, String drillName, DrillUpdate properties, Context context) { + this.serviceClient().update(serviceGroupName, drillName, properties, context); + } + + public void deleteByResourceGroup(String serviceGroupName, String drillName) { + this.serviceClient().delete(serviceGroupName, drillName); + } + + public void delete(String serviceGroupName, String drillName, Context context) { + this.serviceClient().delete(serviceGroupName, drillName, context); + } + + public PagedIterable list(String serviceGroupName) { + PagedIterable inner = this.serviceClient().list(serviceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DrillImpl(inner1, this.manager())); + } + + public PagedIterable list(String serviceGroupName, String skipToken, Integer top, Context context) { + PagedIterable inner = this.serviceClient().list(serviceGroupName, skipToken, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DrillImpl(inner1, this.manager())); + } + + public void validateForExecution(String serviceGroupName, String operationId, String drillName, + ValidateForExecutionRequest body) { + this.serviceClient().validateForExecution(serviceGroupName, operationId, drillName, body); + } + + public void validateForExecution(String serviceGroupName, String operationId, String drillName, + ValidateForExecutionRequest body, Context context) { + this.serviceClient().validateForExecution(serviceGroupName, operationId, drillName, body, context); + } + + public void start(String serviceGroupName, String operationId, String drillName, DrillStartRequest body) { + this.serviceClient().start(serviceGroupName, operationId, drillName, body); + } + + public void start(String serviceGroupName, String operationId, String drillName, DrillStartRequest body, + Context context) { + this.serviceClient().start(serviceGroupName, operationId, drillName, body, context); + } + + public void end(String serviceGroupName, String operationId, String drillName, DrillEndRequest body) { + this.serviceClient().end(serviceGroupName, operationId, drillName, body); + } + + public void end(String serviceGroupName, String operationId, String drillName, DrillEndRequest body, + Context context) { + this.serviceClient().end(serviceGroupName, operationId, drillName, body, context); + } + + public void addOrUpdateResources(String serviceGroupName, String operationId, String drillName, + AddOrUpdateResourcesRequest body) { + this.serviceClient().addOrUpdateResources(serviceGroupName, operationId, drillName, body); + } + + public void addOrUpdateResources(String serviceGroupName, String operationId, String drillName, + AddOrUpdateResourcesRequest body, Context context) { + this.serviceClient().addOrUpdateResources(serviceGroupName, operationId, drillName, body, context); + } + + public void resyncReadinessCheck(String serviceGroupName, String operationId, String drillName) { + this.serviceClient().resyncReadinessCheck(serviceGroupName, operationId, drillName); + } + + public void resyncReadinessCheck(String serviceGroupName, String operationId, String drillName, Context context) { + this.serviceClient().resyncReadinessCheck(serviceGroupName, operationId, drillName, context); + } + + private DrillsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/EnrollmentImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/EnrollmentImpl.java new file mode 100644 index 000000000000..b3e93d987c3f --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/EnrollmentImpl.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.EnrollmentInner; +import com.azure.resourcemanager.resiliencemanagement.models.Enrollment; +import com.azure.resourcemanager.resiliencemanagement.models.EnrollmentProperties; + +public final class EnrollmentImpl implements Enrollment, Enrollment.Definition, Enrollment.Update { + private EnrollmentInner innerObject; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public EnrollmentProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public EnrollmentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String usagePlanName; + + private String enrollmentName; + + public EnrollmentImpl withExistingUsagePlan(String resourceGroupName, String usagePlanName) { + this.resourceGroupName = resourceGroupName; + this.usagePlanName = usagePlanName; + return this; + } + + public Enrollment create() { + this.innerObject = serviceManager.serviceClient() + .getEnrollments() + .createOrUpdate(resourceGroupName, usagePlanName, enrollmentName, this.innerModel(), Context.NONE); + return this; + } + + public Enrollment create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEnrollments() + .createOrUpdate(resourceGroupName, usagePlanName, enrollmentName, this.innerModel(), context); + return this; + } + + EnrollmentImpl(String name, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerObject = new EnrollmentInner(); + this.serviceManager = serviceManager; + this.enrollmentName = name; + } + + public EnrollmentImpl update() { + return this; + } + + public Enrollment apply() { + this.innerObject = serviceManager.serviceClient() + .getEnrollments() + .createOrUpdate(resourceGroupName, usagePlanName, enrollmentName, this.innerModel(), Context.NONE); + return this; + } + + public Enrollment apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEnrollments() + .createOrUpdate(resourceGroupName, usagePlanName, enrollmentName, this.innerModel(), context); + return this; + } + + EnrollmentImpl(EnrollmentInner innerObject, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.usagePlanName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "usagePlans"); + this.enrollmentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "enrollments"); + } + + public Enrollment refresh() { + this.innerObject = serviceManager.serviceClient() + .getEnrollments() + .getWithResponse(resourceGroupName, usagePlanName, enrollmentName, Context.NONE) + .getValue(); + return this; + } + + public Enrollment refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEnrollments() + .getWithResponse(resourceGroupName, usagePlanName, enrollmentName, context) + .getValue(); + return this; + } + + public EnrollmentImpl withProperties(EnrollmentProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/EnrollmentsClientImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/EnrollmentsClientImpl.java new file mode 100644 index 000000000000..9f92c4819023 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/EnrollmentsClientImpl.java @@ -0,0 +1,755 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.management.polling.PollResult; +import com.azure.core.util.BinaryData; +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.resiliencemanagement.fluent.EnrollmentsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.EnrollmentInner; +import com.azure.resourcemanager.resiliencemanagement.implementation.models.EnrollmentListResult; +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 EnrollmentsClient. + */ +public final class EnrollmentsClientImpl implements EnrollmentsClient { + /** + * The proxy service used to perform REST calls. + */ + private final EnrollmentsService service; + + /** + * The service client containing this operation class. + */ + private final ResilienceManagementManagementClientImpl client; + + /** + * Initializes an instance of EnrollmentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EnrollmentsClientImpl(ResilienceManagementManagementClientImpl client) { + this.service + = RestProxy.create(EnrollmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResilienceManagementManagementClientEnrollments to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ResilienceManagementManagementClientEnrollments") + public interface EnrollmentsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureResilienceManagement/usagePlans/{usagePlanName}/enrollments/{enrollmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("usagePlanName") String usagePlanName, + @PathParam("enrollmentName") String enrollmentName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureResilienceManagement/usagePlans/{usagePlanName}/enrollments/{enrollmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("usagePlanName") String usagePlanName, + @PathParam("enrollmentName") String enrollmentName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureResilienceManagement/usagePlans/{usagePlanName}/enrollments/{enrollmentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("usagePlanName") String usagePlanName, + @PathParam("enrollmentName") String enrollmentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") EnrollmentInner resource, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureResilienceManagement/usagePlans/{usagePlanName}/enrollments/{enrollmentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("usagePlanName") String usagePlanName, + @PathParam("enrollmentName") String enrollmentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") EnrollmentInner resource, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureResilienceManagement/usagePlans/{usagePlanName}/enrollments/{enrollmentName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("usagePlanName") String usagePlanName, + @PathParam("enrollmentName") String enrollmentName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureResilienceManagement/usagePlans/{usagePlanName}/enrollments/{enrollmentName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("usagePlanName") String usagePlanName, + @PathParam("enrollmentName") String enrollmentName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureResilienceManagement/usagePlans/{usagePlanName}/enrollments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("usagePlanName") String usagePlanName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureResilienceManagement/usagePlans/{usagePlanName}/enrollments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("usagePlanName") String usagePlanName, + @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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Enrollment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String usagePlanName, + String enrollmentName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, enrollmentName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Enrollment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String usagePlanName, String enrollmentName) { + return getWithResponseAsync(resourceGroupName, usagePlanName, enrollmentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Enrollment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String usagePlanName, + String enrollmentName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, usagePlanName, enrollmentName, accept, context); + } + + /** + * Get an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Enrollment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnrollmentInner get(String resourceGroupName, String usagePlanName, String enrollmentName) { + return getWithResponse(resourceGroupName, usagePlanName, enrollmentName, Context.NONE).getValue(); + } + + /** + * Create or update an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an enrollment that links a usage plan to a service group along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String usagePlanName, String enrollmentName, EnrollmentInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, enrollmentName, contentType, accept, + resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an enrollment that links a usage plan to a service group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String usagePlanName, + String enrollmentName, EnrollmentInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, enrollmentName, contentType, accept, + resource, Context.NONE); + } + + /** + * Create or update an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an enrollment that links a usage plan to a service group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String usagePlanName, + String enrollmentName, EnrollmentInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, enrollmentName, contentType, accept, + resource, context); + } + + /** + * Create or update an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an enrollment that links a usage plan to a service group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EnrollmentInner> beginCreateOrUpdateAsync(String resourceGroupName, + String usagePlanName, String enrollmentName, EnrollmentInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, usagePlanName, enrollmentName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EnrollmentInner.class, EnrollmentInner.class, this.client.getContext()); + } + + /** + * Create or update an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an enrollment that links a usage plan to a service group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EnrollmentInner> beginCreateOrUpdate(String resourceGroupName, + String usagePlanName, String enrollmentName, EnrollmentInner resource) { + Response response + = createOrUpdateWithResponse(resourceGroupName, usagePlanName, enrollmentName, resource); + return this.client.getLroResult(response, EnrollmentInner.class, + EnrollmentInner.class, Context.NONE); + } + + /** + * Create or update an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an enrollment that links a usage plan to a service group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EnrollmentInner> beginCreateOrUpdate(String resourceGroupName, + String usagePlanName, String enrollmentName, EnrollmentInner resource, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, usagePlanName, enrollmentName, resource, context); + return this.client.getLroResult(response, EnrollmentInner.class, + EnrollmentInner.class, context); + } + + /** + * Create or update an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an enrollment that links a usage plan to a service group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String usagePlanName, + String enrollmentName, EnrollmentInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, usagePlanName, enrollmentName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an enrollment that links a usage plan to a service group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnrollmentInner createOrUpdate(String resourceGroupName, String usagePlanName, String enrollmentName, + EnrollmentInner resource) { + return beginCreateOrUpdate(resourceGroupName, usagePlanName, enrollmentName, resource).getFinalResult(); + } + + /** + * Create or update an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an enrollment that links a usage plan to a service group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnrollmentInner createOrUpdate(String resourceGroupName, String usagePlanName, String enrollmentName, + EnrollmentInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, usagePlanName, enrollmentName, resource, context) + .getFinalResult(); + } + + /** + * Delete an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceGroupName, String usagePlanName, + String enrollmentName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, enrollmentName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String usagePlanName, + String enrollmentName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, enrollmentName, Context.NONE); + } + + /** + * Delete an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String usagePlanName, + String enrollmentName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, enrollmentName, context); + } + + /** + * Delete an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String usagePlanName, + String enrollmentName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, usagePlanName, enrollmentName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String usagePlanName, + String enrollmentName) { + Response response = deleteWithResponse(resourceGroupName, usagePlanName, enrollmentName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String usagePlanName, + String enrollmentName, Context context) { + Response response = deleteWithResponse(resourceGroupName, usagePlanName, enrollmentName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceGroupName, String usagePlanName, String enrollmentName) { + return beginDeleteAsync(resourceGroupName, usagePlanName, enrollmentName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceGroupName, String usagePlanName, String enrollmentName) { + beginDelete(resourceGroupName, usagePlanName, enrollmentName).getFinalResult(); + } + + /** + * Delete an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceGroupName, String usagePlanName, String enrollmentName, Context context) { + beginDelete(resourceGroupName, usagePlanName, enrollmentName, context).getFinalResult(); + } + + /** + * List Enrollments by Usage Plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Enrollment list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String usagePlanName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, 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 Enrollments by Usage Plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Enrollment list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String usagePlanName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, usagePlanName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Enrollments by Usage Plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Enrollment list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String usagePlanName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Enrollments by Usage Plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Enrollment list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String usagePlanName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Enrollments by Usage Plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Enrollment list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String usagePlanName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, usagePlanName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List Enrollments by Usage Plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Enrollment list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String usagePlanName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, usagePlanName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Enrollment list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Enrollment list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Enrollment list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/EnrollmentsImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/EnrollmentsImpl.java new file mode 100644 index 000000000000..a1cb1afb7454 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/EnrollmentsImpl.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.EnrollmentsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.EnrollmentInner; +import com.azure.resourcemanager.resiliencemanagement.models.Enrollment; +import com.azure.resourcemanager.resiliencemanagement.models.Enrollments; + +public final class EnrollmentsImpl implements Enrollments { + private static final ClientLogger LOGGER = new ClientLogger(EnrollmentsImpl.class); + + private final EnrollmentsClient innerClient; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + public EnrollmentsImpl(EnrollmentsClient innerClient, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String usagePlanName, String enrollmentName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, usagePlanName, enrollmentName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EnrollmentImpl(inner.getValue(), this.manager())); + } + + public Enrollment get(String resourceGroupName, String usagePlanName, String enrollmentName) { + EnrollmentInner inner = this.serviceClient().get(resourceGroupName, usagePlanName, enrollmentName); + if (inner != null) { + return new EnrollmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String usagePlanName, String enrollmentName) { + this.serviceClient().delete(resourceGroupName, usagePlanName, enrollmentName); + } + + public void delete(String resourceGroupName, String usagePlanName, String enrollmentName, Context context) { + this.serviceClient().delete(resourceGroupName, usagePlanName, enrollmentName, context); + } + + public PagedIterable list(String resourceGroupName, String usagePlanName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, usagePlanName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EnrollmentImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String usagePlanName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, usagePlanName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EnrollmentImpl(inner1, this.manager())); + } + + public Enrollment getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String usagePlanName = ResourceManagerUtils.getValueFromIdByName(id, "usagePlans"); + if (usagePlanName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'usagePlans'.", id))); + } + String enrollmentName = ResourceManagerUtils.getValueFromIdByName(id, "enrollments"); + if (enrollmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'enrollments'.", id))); + } + return this.getWithResponse(resourceGroupName, usagePlanName, enrollmentName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String usagePlanName = ResourceManagerUtils.getValueFromIdByName(id, "usagePlans"); + if (usagePlanName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'usagePlans'.", id))); + } + String enrollmentName = ResourceManagerUtils.getValueFromIdByName(id, "enrollments"); + if (enrollmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'enrollments'.", id))); + } + return this.getWithResponse(resourceGroupName, usagePlanName, enrollmentName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String usagePlanName = ResourceManagerUtils.getValueFromIdByName(id, "usagePlans"); + if (usagePlanName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'usagePlans'.", id))); + } + String enrollmentName = ResourceManagerUtils.getValueFromIdByName(id, "enrollments"); + if (enrollmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'enrollments'.", id))); + } + this.delete(resourceGroupName, usagePlanName, enrollmentName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String usagePlanName = ResourceManagerUtils.getValueFromIdByName(id, "usagePlans"); + if (usagePlanName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'usagePlans'.", id))); + } + String enrollmentName = ResourceManagerUtils.getValueFromIdByName(id, "enrollments"); + if (enrollmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'enrollments'.", id))); + } + this.delete(resourceGroupName, usagePlanName, enrollmentName, context); + } + + private EnrollmentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } + + public EnrollmentImpl define(String name) { + return new EnrollmentImpl(name, this.manager()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalAssignmentImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalAssignmentImpl.java new file mode 100644 index 000000000000..200c8e4ecdf2 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalAssignmentImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalAssignmentInner; +import com.azure.resourcemanager.resiliencemanagement.models.GoalAssignment; +import com.azure.resourcemanager.resiliencemanagement.models.GoalAssignmentProperties; + +public final class GoalAssignmentImpl implements GoalAssignment { + private GoalAssignmentInner innerObject; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + GoalAssignmentImpl(GoalAssignmentInner innerObject, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager 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 GoalAssignmentProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public GoalAssignmentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalAssignmentsClientImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalAssignmentsClientImpl.java new file mode 100644 index 000000000000..d2f77cdf8ce5 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalAssignmentsClientImpl.java @@ -0,0 +1,1513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.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.management.polling.PollResult; +import com.azure.core.util.BinaryData; +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.resiliencemanagement.fluent.GoalAssignmentsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalAssignmentInner; +import com.azure.resourcemanager.resiliencemanagement.implementation.models.GoalAssignmentListResult; +import com.azure.resourcemanager.resiliencemanagement.models.RecommendCapacityRequest; +import com.azure.resourcemanager.resiliencemanagement.models.UpdateGoalResourceRequest; +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 GoalAssignmentsClient. + */ +public final class GoalAssignmentsClientImpl implements GoalAssignmentsClient { + /** + * The proxy service used to perform REST calls. + */ + private final GoalAssignmentsService service; + + /** + * The service client containing this operation class. + */ + private final ResilienceManagementManagementClientImpl client; + + /** + * Initializes an instance of GoalAssignmentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GoalAssignmentsClientImpl(ResilienceManagementManagementClientImpl client) { + this.service + = RestProxy.create(GoalAssignmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResilienceManagementManagementClientGoalAssignments to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ResilienceManagementManagementClientGoalAssignments") + public interface GoalAssignmentsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalAssignments/{goalAssignmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalAssignmentName") String goalAssignmentName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalAssignments/{goalAssignmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalAssignmentName") String goalAssignmentName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalAssignments/{goalAssignmentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalAssignmentName") String goalAssignmentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") GoalAssignmentInner resource, + Context context); + + @Put("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalAssignments/{goalAssignmentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalAssignmentName") String goalAssignmentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") GoalAssignmentInner resource, + Context context); + + @Patch("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalAssignments/{goalAssignmentName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalAssignmentName") String goalAssignmentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") GoalAssignmentInner properties, + Context context); + + @Patch("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalAssignments/{goalAssignmentName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalAssignmentName") String goalAssignmentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") GoalAssignmentInner properties, + Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalAssignments/{goalAssignmentName}/updateGoalResources") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateGoalResources(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalAssignmentName") String goalAssignmentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") UpdateGoalResourceRequest body, + Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalAssignments/{goalAssignmentName}/updateGoalResources") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateGoalResourcesSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalAssignmentName") String goalAssignmentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") UpdateGoalResourceRequest body, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalAssignments/{goalAssignmentName}/refreshGoalResources") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> refreshGoalResources(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalAssignmentName") String goalAssignmentName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalAssignments/{goalAssignmentName}/refreshGoalResources") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response refreshGoalResourcesSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalAssignmentName") String goalAssignmentName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalAssignments/{goalAssignmentName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalAssignmentName") String goalAssignmentName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalAssignments/{goalAssignmentName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalAssignmentName") String goalAssignmentName, Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalAssignments/{goalAssignmentName}/recommendCapacity") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> recommendCapacity(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalAssignmentName") String goalAssignmentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RecommendCapacityRequest body, + Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalAssignments/{goalAssignmentName}/recommendCapacity") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response recommendCapacitySync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalAssignmentName") String goalAssignmentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RecommendCapacityRequest body, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalAssignments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalAssignments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 GoalAssignment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String serviceGroupName, + String goalAssignmentName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), goalAssignmentName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 GoalAssignment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String serviceGroupName, String goalAssignmentName) { + return getWithResponseAsync(serviceGroupName, goalAssignmentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 GoalAssignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String serviceGroupName, String goalAssignmentName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + goalAssignmentName, accept, context); + } + + /** + * Get a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 GoalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GoalAssignmentInner get(String serviceGroupName, String goalAssignmentName) { + return getWithResponse(serviceGroupName, goalAssignmentName, Context.NONE).getValue(); + } + + /** + * Create a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal assignment a AzureResilienceProviderHub resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String serviceGroupName, + String goalAssignmentName, GoalAssignmentInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), goalAssignmentName, contentType, accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal assignment a AzureResilienceProviderHub resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String serviceGroupName, String goalAssignmentName, + GoalAssignmentInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + goalAssignmentName, contentType, accept, resource, Context.NONE); + } + + /** + * Create a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal assignment a AzureResilienceProviderHub resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String serviceGroupName, String goalAssignmentName, + GoalAssignmentInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + goalAssignmentName, contentType, accept, resource, context); + } + + /** + * Create a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 goal assignment a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCreateOrUpdateAsync(String serviceGroupName, + String goalAssignmentName, GoalAssignmentInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(serviceGroupName, goalAssignmentName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Create a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 goal assignment a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCreateOrUpdate(String serviceGroupName, String goalAssignmentName, + GoalAssignmentInner resource) { + Response response = createOrUpdateWithResponse(serviceGroupName, goalAssignmentName, resource); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Create a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 goal assignment a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCreateOrUpdate(String serviceGroupName, String goalAssignmentName, + GoalAssignmentInner resource, Context context) { + Response response + = createOrUpdateWithResponse(serviceGroupName, goalAssignmentName, resource, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Create a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal assignment a AzureResilienceProviderHub resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String serviceGroupName, String goalAssignmentName, + GoalAssignmentInner resource) { + return beginCreateOrUpdateAsync(serviceGroupName, goalAssignmentName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 createOrUpdate(String serviceGroupName, String goalAssignmentName, GoalAssignmentInner resource) { + beginCreateOrUpdate(serviceGroupName, goalAssignmentName, resource).getFinalResult(); + } + + /** + * Create a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 createOrUpdate(String serviceGroupName, String goalAssignmentName, GoalAssignmentInner resource, + Context context) { + beginCreateOrUpdate(serviceGroupName, goalAssignmentName, resource, context).getFinalResult(); + } + + /** + * Update a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal assignment a AzureResilienceProviderHub resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String serviceGroupName, String goalAssignmentName, + GoalAssignmentInner properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), goalAssignmentName, contentType, accept, properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal assignment a AzureResilienceProviderHub resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String serviceGroupName, String goalAssignmentName, + GoalAssignmentInner properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + goalAssignmentName, contentType, accept, properties, Context.NONE); + } + + /** + * Update a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal assignment a AzureResilienceProviderHub resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String serviceGroupName, String goalAssignmentName, + GoalAssignmentInner properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + goalAssignmentName, contentType, accept, properties, context); + } + + /** + * Update a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 goal assignment a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpdateAsync(String serviceGroupName, String goalAssignmentName, + GoalAssignmentInner properties) { + Mono>> mono + = updateWithResponseAsync(serviceGroupName, goalAssignmentName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Update a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 goal assignment a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpdate(String serviceGroupName, String goalAssignmentName, + GoalAssignmentInner properties) { + Response response = updateWithResponse(serviceGroupName, goalAssignmentName, properties); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Update a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 goal assignment a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpdate(String serviceGroupName, String goalAssignmentName, + GoalAssignmentInner properties, Context context) { + Response response = updateWithResponse(serviceGroupName, goalAssignmentName, properties, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Update a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal assignment a AzureResilienceProviderHub resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String serviceGroupName, String goalAssignmentName, GoalAssignmentInner properties) { + return beginUpdateAsync(serviceGroupName, goalAssignmentName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceGroupName, String goalAssignmentName, GoalAssignmentInner properties) { + beginUpdate(serviceGroupName, goalAssignmentName, properties).getFinalResult(); + } + + /** + * Update a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceGroupName, String goalAssignmentName, GoalAssignmentInner properties, + Context context) { + beginUpdate(serviceGroupName, goalAssignmentName, properties, context).getFinalResult(); + } + + /** + * Action to exclude a resource from goal assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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 response model for update goal resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateGoalResourcesWithResponseAsync(String serviceGroupName, + String goalAssignmentName, UpdateGoalResourceRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.updateGoalResources(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), goalAssignmentName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Action to exclude a resource from goal assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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 response model for update goal resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateGoalResourcesWithResponse(String serviceGroupName, String goalAssignmentName, + UpdateGoalResourceRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateGoalResourcesSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + goalAssignmentName, contentType, accept, body, Context.NONE); + } + + /** + * Action to exclude a resource from goal assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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 response model for update goal resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateGoalResourcesWithResponse(String serviceGroupName, String goalAssignmentName, + UpdateGoalResourceRequest body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateGoalResourcesSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + goalAssignmentName, contentType, accept, body, context); + } + + /** + * Action to exclude a resource from goal assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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 the {@link PollerFlux} for polling of response model for update goal resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpdateGoalResourcesAsync(String serviceGroupName, + String goalAssignmentName, UpdateGoalResourceRequest body) { + Mono>> mono + = updateGoalResourcesWithResponseAsync(serviceGroupName, goalAssignmentName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Action to exclude a resource from goal assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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 the {@link SyncPoller} for polling of response model for update goal resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpdateGoalResources(String serviceGroupName, + String goalAssignmentName, UpdateGoalResourceRequest body) { + Response response = updateGoalResourcesWithResponse(serviceGroupName, goalAssignmentName, body); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Action to exclude a resource from goal assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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 the {@link SyncPoller} for polling of response model for update goal resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpdateGoalResources(String serviceGroupName, + String goalAssignmentName, UpdateGoalResourceRequest body, Context context) { + Response response + = updateGoalResourcesWithResponse(serviceGroupName, goalAssignmentName, body, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Action to exclude a resource from goal assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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 response model for update goal resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateGoalResourcesAsync(String serviceGroupName, String goalAssignmentName, + UpdateGoalResourceRequest body) { + return beginUpdateGoalResourcesAsync(serviceGroupName, goalAssignmentName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Action to exclude a resource from goal assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateGoalResources(String serviceGroupName, String goalAssignmentName, + UpdateGoalResourceRequest body) { + beginUpdateGoalResources(serviceGroupName, goalAssignmentName, body).getFinalResult(); + } + + /** + * Action to exclude a resource from goal assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateGoalResources(String serviceGroupName, String goalAssignmentName, UpdateGoalResourceRequest body, + Context context) { + beginUpdateGoalResources(serviceGroupName, goalAssignmentName, body, context).getFinalResult(); + } + + /** + * Refreshes the goal resources under a goal assignment. This operation scans for new resources under the scope of + * the assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response model for refresh goal resources along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> refreshGoalResourcesWithResponseAsync(String serviceGroupName, + String goalAssignmentName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.refreshGoalResources(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), goalAssignmentName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Refreshes the goal resources under a goal assignment. This operation scans for new resources under the scope of + * the assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response model for refresh goal resources along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response refreshGoalResourcesWithResponse(String serviceGroupName, String goalAssignmentName) { + final String accept = "application/json"; + return service.refreshGoalResourcesSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), goalAssignmentName, accept, Context.NONE); + } + + /** + * Refreshes the goal resources under a goal assignment. This operation scans for new resources under the scope of + * the assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response model for refresh goal resources along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response refreshGoalResourcesWithResponse(String serviceGroupName, String goalAssignmentName, + Context context) { + final String accept = "application/json"; + return service.refreshGoalResourcesSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), goalAssignmentName, accept, context); + } + + /** + * Refreshes the goal resources under a goal assignment. This operation scans for new resources under the scope of + * the assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 response model for refresh goal resources. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRefreshGoalResourcesAsync(String serviceGroupName, + String goalAssignmentName) { + Mono>> mono + = refreshGoalResourcesWithResponseAsync(serviceGroupName, goalAssignmentName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Refreshes the goal resources under a goal assignment. This operation scans for new resources under the scope of + * the assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 response model for refresh goal resources. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRefreshGoalResources(String serviceGroupName, + String goalAssignmentName) { + Response response = refreshGoalResourcesWithResponse(serviceGroupName, goalAssignmentName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Refreshes the goal resources under a goal assignment. This operation scans for new resources under the scope of + * the assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 response model for refresh goal resources. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRefreshGoalResources(String serviceGroupName, + String goalAssignmentName, Context context) { + Response response = refreshGoalResourcesWithResponse(serviceGroupName, goalAssignmentName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Refreshes the goal resources under a goal assignment. This operation scans for new resources under the scope of + * the assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response model for refresh goal resources on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshGoalResourcesAsync(String serviceGroupName, String goalAssignmentName) { + return beginRefreshGoalResourcesAsync(serviceGroupName, goalAssignmentName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refreshes the goal resources under a goal assignment. This operation scans for new resources under the scope of + * the assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 refreshGoalResources(String serviceGroupName, String goalAssignmentName) { + beginRefreshGoalResources(serviceGroupName, goalAssignmentName).getFinalResult(); + } + + /** + * Refreshes the goal resources under a goal assignment. This operation scans for new resources under the scope of + * the assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 refreshGoalResources(String serviceGroupName, String goalAssignmentName, Context context) { + beginRefreshGoalResources(serviceGroupName, goalAssignmentName, context).getFinalResult(); + } + + /** + * Delete a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceGroupName, + String goalAssignmentName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), goalAssignmentName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String serviceGroupName, String goalAssignmentName) { + return service.deleteSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + goalAssignmentName, Context.NONE); + } + + /** + * Delete a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String serviceGroupName, String goalAssignmentName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + goalAssignmentName, context); + } + + /** + * Delete a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String serviceGroupName, String goalAssignmentName) { + Mono>> mono = deleteWithResponseAsync(serviceGroupName, goalAssignmentName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String serviceGroupName, String goalAssignmentName) { + Response response = deleteWithResponse(serviceGroupName, goalAssignmentName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String serviceGroupName, String goalAssignmentName, + Context context) { + Response response = deleteWithResponse(serviceGroupName, goalAssignmentName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceGroupName, String goalAssignmentName) { + return beginDeleteAsync(serviceGroupName, goalAssignmentName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceGroupName, String goalAssignmentName) { + beginDelete(serviceGroupName, goalAssignmentName).getFinalResult(); + } + + /** + * Delete a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceGroupName, String goalAssignmentName, Context context) { + beginDelete(serviceGroupName, goalAssignmentName, context).getFinalResult(); + } + + /** + * Recommends capacity improvements for resources under the goal assignments scope. Returns AI-powered capacity + * assessments and recommendations. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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 result of a completed recommend capacity operation, containing per-resource assessments and cross-cutting + * recommendations along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> recommendCapacityWithResponseAsync(String serviceGroupName, + String goalAssignmentName, RecommendCapacityRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.recommendCapacity(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), goalAssignmentName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Recommends capacity improvements for resources under the goal assignments scope. Returns AI-powered capacity + * assessments and recommendations. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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 result of a completed recommend capacity operation, containing per-resource assessments and cross-cutting + * recommendations along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response recommendCapacityWithResponse(String serviceGroupName, String goalAssignmentName, + RecommendCapacityRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.recommendCapacitySync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + goalAssignmentName, contentType, accept, body, Context.NONE); + } + + /** + * Recommends capacity improvements for resources under the goal assignments scope. Returns AI-powered capacity + * assessments and recommendations. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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 result of a completed recommend capacity operation, containing per-resource assessments and cross-cutting + * recommendations along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response recommendCapacityWithResponse(String serviceGroupName, String goalAssignmentName, + RecommendCapacityRequest body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.recommendCapacitySync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + goalAssignmentName, contentType, accept, body, context); + } + + /** + * Recommends capacity improvements for resources under the goal assignments scope. Returns AI-powered capacity + * assessments and recommendations. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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 the {@link PollerFlux} for polling of result of a completed recommend capacity operation, containing + * per-resource assessments and cross-cutting recommendations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRecommendCapacityAsync(String serviceGroupName, + String goalAssignmentName, RecommendCapacityRequest body) { + Mono>> mono + = recommendCapacityWithResponseAsync(serviceGroupName, goalAssignmentName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Recommends capacity improvements for resources under the goal assignments scope. Returns AI-powered capacity + * assessments and recommendations. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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 the {@link SyncPoller} for polling of result of a completed recommend capacity operation, containing + * per-resource assessments and cross-cutting recommendations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRecommendCapacity(String serviceGroupName, String goalAssignmentName, + RecommendCapacityRequest body) { + Response response = recommendCapacityWithResponse(serviceGroupName, goalAssignmentName, body); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Recommends capacity improvements for resources under the goal assignments scope. Returns AI-powered capacity + * assessments and recommendations. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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 the {@link SyncPoller} for polling of result of a completed recommend capacity operation, containing + * per-resource assessments and cross-cutting recommendations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRecommendCapacity(String serviceGroupName, String goalAssignmentName, + RecommendCapacityRequest body, Context context) { + Response response + = recommendCapacityWithResponse(serviceGroupName, goalAssignmentName, body, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Recommends capacity improvements for resources under the goal assignments scope. Returns AI-powered capacity + * assessments and recommendations. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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 result of a completed recommend capacity operation, containing per-resource assessments and cross-cutting + * recommendations on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono recommendCapacityAsync(String serviceGroupName, String goalAssignmentName, + RecommendCapacityRequest body) { + return beginRecommendCapacityAsync(serviceGroupName, goalAssignmentName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Recommends capacity improvements for resources under the goal assignments scope. Returns AI-powered capacity + * assessments and recommendations. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void recommendCapacity(String serviceGroupName, String goalAssignmentName, RecommendCapacityRequest body) { + beginRecommendCapacity(serviceGroupName, goalAssignmentName, body).getFinalResult(); + } + + /** + * Recommends capacity improvements for resources under the goal assignments scope. Returns AI-powered capacity + * assessments and recommendations. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void recommendCapacity(String serviceGroupName, String goalAssignmentName, RecommendCapacityRequest body, + Context context) { + beginRecommendCapacity(serviceGroupName, goalAssignmentName, body, context).getFinalResult(); + } + + /** + * List GoalAssignment resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalAssignment list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String serviceGroupName, String skipToken, + Integer top) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, 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 GoalAssignment resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalAssignment list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String serviceGroupName, String skipToken, Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(serviceGroupName, skipToken, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List GoalAssignment resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalAssignment list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String serviceGroupName) { + final String skipToken = null; + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(serviceGroupName, skipToken, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List GoalAssignment resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalAssignment list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String skipToken, Integer top) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List GoalAssignment resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalAssignment list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String skipToken, Integer top, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List GoalAssignment resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalAssignment list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName) { + final String skipToken = null; + final Integer top = null; + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, skipToken, top), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List GoalAssignment resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalAssignment list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName, String skipToken, Integer top, + Context context) { + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, skipToken, top, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalAssignment list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalAssignment list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalAssignment list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalAssignmentsImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalAssignmentsImpl.java new file mode 100644 index 000000000000..73d2db83e092 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalAssignmentsImpl.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.GoalAssignmentsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalAssignmentInner; +import com.azure.resourcemanager.resiliencemanagement.models.GoalAssignment; +import com.azure.resourcemanager.resiliencemanagement.models.GoalAssignments; +import com.azure.resourcemanager.resiliencemanagement.models.RecommendCapacityRequest; +import com.azure.resourcemanager.resiliencemanagement.models.UpdateGoalResourceRequest; + +public final class GoalAssignmentsImpl implements GoalAssignments { + private static final ClientLogger LOGGER = new ClientLogger(GoalAssignmentsImpl.class); + + private final GoalAssignmentsClient innerClient; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + public GoalAssignmentsImpl(GoalAssignmentsClient innerClient, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String serviceGroupName, String goalAssignmentName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(serviceGroupName, goalAssignmentName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GoalAssignmentImpl(inner.getValue(), this.manager())); + } + + public GoalAssignment get(String serviceGroupName, String goalAssignmentName) { + GoalAssignmentInner inner = this.serviceClient().get(serviceGroupName, goalAssignmentName); + if (inner != null) { + return new GoalAssignmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public void createOrUpdate(String serviceGroupName, String goalAssignmentName, GoalAssignmentInner resource) { + this.serviceClient().createOrUpdate(serviceGroupName, goalAssignmentName, resource); + } + + public void createOrUpdate(String serviceGroupName, String goalAssignmentName, GoalAssignmentInner resource, + Context context) { + this.serviceClient().createOrUpdate(serviceGroupName, goalAssignmentName, resource, context); + } + + public void update(String serviceGroupName, String goalAssignmentName, GoalAssignmentInner properties) { + this.serviceClient().update(serviceGroupName, goalAssignmentName, properties); + } + + public void update(String serviceGroupName, String goalAssignmentName, GoalAssignmentInner properties, + Context context) { + this.serviceClient().update(serviceGroupName, goalAssignmentName, properties, context); + } + + public void updateGoalResources(String serviceGroupName, String goalAssignmentName, + UpdateGoalResourceRequest body) { + this.serviceClient().updateGoalResources(serviceGroupName, goalAssignmentName, body); + } + + public void updateGoalResources(String serviceGroupName, String goalAssignmentName, UpdateGoalResourceRequest body, + Context context) { + this.serviceClient().updateGoalResources(serviceGroupName, goalAssignmentName, body, context); + } + + public void refreshGoalResources(String serviceGroupName, String goalAssignmentName) { + this.serviceClient().refreshGoalResources(serviceGroupName, goalAssignmentName); + } + + public void refreshGoalResources(String serviceGroupName, String goalAssignmentName, Context context) { + this.serviceClient().refreshGoalResources(serviceGroupName, goalAssignmentName, context); + } + + public void deleteByResourceGroup(String serviceGroupName, String goalAssignmentName) { + this.serviceClient().delete(serviceGroupName, goalAssignmentName); + } + + public void delete(String serviceGroupName, String goalAssignmentName, Context context) { + this.serviceClient().delete(serviceGroupName, goalAssignmentName, context); + } + + public void recommendCapacity(String serviceGroupName, String goalAssignmentName, RecommendCapacityRequest body) { + this.serviceClient().recommendCapacity(serviceGroupName, goalAssignmentName, body); + } + + public void recommendCapacity(String serviceGroupName, String goalAssignmentName, RecommendCapacityRequest body, + Context context) { + this.serviceClient().recommendCapacity(serviceGroupName, goalAssignmentName, body, context); + } + + public PagedIterable list(String serviceGroupName) { + PagedIterable inner = this.serviceClient().list(serviceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GoalAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable list(String serviceGroupName, String skipToken, Integer top, Context context) { + PagedIterable inner = this.serviceClient().list(serviceGroupName, skipToken, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GoalAssignmentImpl(inner1, this.manager())); + } + + private GoalAssignmentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalResourceImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalResourceImpl.java new file mode 100644 index 000000000000..72da3a732cb9 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalResourceImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalResourceInner; +import com.azure.resourcemanager.resiliencemanagement.models.GoalResource; +import com.azure.resourcemanager.resiliencemanagement.models.GoalResourceProperties; + +public final class GoalResourceImpl implements GoalResource { + private GoalResourceInner innerObject; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + GoalResourceImpl(GoalResourceInner innerObject, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager 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 GoalResourceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public GoalResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalResourcesClientImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalResourcesClientImpl.java new file mode 100644 index 000000000000..d334ffda274e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalResourcesClientImpl.java @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.GoalResourcesClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalResourceInner; +import com.azure.resourcemanager.resiliencemanagement.implementation.models.GoalResourceListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in GoalResourcesClient. + */ +public final class GoalResourcesClientImpl implements GoalResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final GoalResourcesService service; + + /** + * The service client containing this operation class. + */ + private final ResilienceManagementManagementClientImpl client; + + /** + * Initializes an instance of GoalResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GoalResourcesClientImpl(ResilienceManagementManagementClientImpl client) { + this.service + = RestProxy.create(GoalResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResilienceManagementManagementClientGoalResources to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ResilienceManagementManagementClientGoalResources") + public interface GoalResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalAssignments/{goalAssignmentName}/goalResources/{goalResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalAssignmentName") String goalAssignmentName, + @PathParam("goalResourceName") String goalResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalAssignments/{goalAssignmentName}/goalResources/{goalResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalAssignmentName") String goalAssignmentName, + @PathParam("goalResourceName") String goalResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalAssignments/{goalAssignmentName}/goalResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @PathParam("goalAssignmentName") String goalAssignmentName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalAssignments/{goalAssignmentName}/goalResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @PathParam("goalAssignmentName") String goalAssignmentName, @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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a GoalResource. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param goalResourceName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 GoalResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String serviceGroupName, String goalAssignmentName, + String goalResourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), goalAssignmentName, goalResourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a GoalResource. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param goalResourceName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 GoalResource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String serviceGroupName, String goalAssignmentName, + String goalResourceName) { + return getWithResponseAsync(serviceGroupName, goalAssignmentName, goalResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a GoalResource. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param goalResourceName The name of the GoalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 GoalResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String serviceGroupName, String goalAssignmentName, + String goalResourceName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + goalAssignmentName, goalResourceName, accept, context); + } + + /** + * Get a GoalResource. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param goalResourceName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 GoalResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GoalResourceInner get(String serviceGroupName, String goalAssignmentName, String goalResourceName) { + return getWithResponse(serviceGroupName, goalAssignmentName, goalResourceName, Context.NONE).getValue(); + } + + /** + * List GoalResource resources by GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalResource list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String serviceGroupName, + String goalAssignmentName, String skipToken, Integer top) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, goalAssignmentName, 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 GoalResource resources by GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String serviceGroupName, String goalAssignmentName, String skipToken, + Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(serviceGroupName, goalAssignmentName, skipToken, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List GoalResource resources by GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String serviceGroupName, String goalAssignmentName) { + final String skipToken = null; + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(serviceGroupName, goalAssignmentName, skipToken, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List GoalResource resources by GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String goalAssignmentName, + String skipToken, Integer top) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, goalAssignmentName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List GoalResource resources by GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String goalAssignmentName, + String skipToken, Integer top, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, goalAssignmentName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List GoalResource resources by GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName, String goalAssignmentName) { + final String skipToken = null; + final Integer top = null; + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, goalAssignmentName, skipToken, top), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List GoalResource resources by GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName, String goalAssignmentName, String skipToken, + Integer top, Context context) { + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, goalAssignmentName, skipToken, top, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalResource list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalResourcesImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalResourcesImpl.java new file mode 100644 index 000000000000..150c3041ca46 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalResourcesImpl.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.GoalResourcesClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalResourceInner; +import com.azure.resourcemanager.resiliencemanagement.models.GoalResource; +import com.azure.resourcemanager.resiliencemanagement.models.GoalResources; + +public final class GoalResourcesImpl implements GoalResources { + private static final ClientLogger LOGGER = new ClientLogger(GoalResourcesImpl.class); + + private final GoalResourcesClient innerClient; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + public GoalResourcesImpl(GoalResourcesClient innerClient, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String serviceGroupName, String goalAssignmentName, + String goalResourceName, Context context) { + Response inner + = this.serviceClient().getWithResponse(serviceGroupName, goalAssignmentName, goalResourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GoalResourceImpl(inner.getValue(), this.manager())); + } + + public GoalResource get(String serviceGroupName, String goalAssignmentName, String goalResourceName) { + GoalResourceInner inner = this.serviceClient().get(serviceGroupName, goalAssignmentName, goalResourceName); + if (inner != null) { + return new GoalResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String serviceGroupName, String goalAssignmentName) { + PagedIterable inner = this.serviceClient().list(serviceGroupName, goalAssignmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GoalResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String serviceGroupName, String goalAssignmentName, String skipToken, + Integer top, Context context) { + PagedIterable inner + = this.serviceClient().list(serviceGroupName, goalAssignmentName, skipToken, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GoalResourceImpl(inner1, this.manager())); + } + + private GoalResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalTemplateImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalTemplateImpl.java new file mode 100644 index 000000000000..2447640e982b --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalTemplateImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalTemplateInner; +import com.azure.resourcemanager.resiliencemanagement.models.GoalTemplate; +import com.azure.resourcemanager.resiliencemanagement.models.GoalTemplateProperties; + +public final class GoalTemplateImpl implements GoalTemplate { + private GoalTemplateInner innerObject; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + GoalTemplateImpl(GoalTemplateInner innerObject, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager 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 GoalTemplateProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public GoalTemplateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalTemplatesClientImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalTemplatesClientImpl.java new file mode 100644 index 000000000000..87416c4e77eb --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalTemplatesClientImpl.java @@ -0,0 +1,931 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.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.management.polling.PollResult; +import com.azure.core.util.BinaryData; +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.resiliencemanagement.fluent.GoalTemplatesClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalTemplateInner; +import com.azure.resourcemanager.resiliencemanagement.implementation.models.GoalTemplateListResult; +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 GoalTemplatesClient. + */ +public final class GoalTemplatesClientImpl implements GoalTemplatesClient { + /** + * The proxy service used to perform REST calls. + */ + private final GoalTemplatesService service; + + /** + * The service client containing this operation class. + */ + private final ResilienceManagementManagementClientImpl client; + + /** + * Initializes an instance of GoalTemplatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GoalTemplatesClientImpl(ResilienceManagementManagementClientImpl client) { + this.service + = RestProxy.create(GoalTemplatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResilienceManagementManagementClientGoalTemplates to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ResilienceManagementManagementClientGoalTemplates") + public interface GoalTemplatesService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalTemplates/{goalTemplateName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalTemplateName") String goalTemplateName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalTemplates/{goalTemplateName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalTemplateName") String goalTemplateName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalTemplates/{goalTemplateName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalTemplateName") String goalTemplateName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") GoalTemplateInner resource, + Context context); + + @Put("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalTemplates/{goalTemplateName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalTemplateName") String goalTemplateName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") GoalTemplateInner resource, + Context context); + + @Patch("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalTemplates/{goalTemplateName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalTemplateName") String goalTemplateName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") GoalTemplateInner properties, + Context context); + + @Patch("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalTemplates/{goalTemplateName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalTemplateName") String goalTemplateName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") GoalTemplateInner properties, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalTemplates/{goalTemplateName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalTemplateName") String goalTemplateName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalTemplates/{goalTemplateName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("goalTemplateName") String goalTemplateName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalTemplates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/goalTemplates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 GoalTemplate along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String serviceGroupName, String goalTemplateName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), goalTemplateName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 GoalTemplate on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String serviceGroupName, String goalTemplateName) { + return getWithResponseAsync(serviceGroupName, goalTemplateName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 GoalTemplate along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String serviceGroupName, String goalTemplateName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + goalTemplateName, accept, context); + } + + /** + * Get a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 GoalTemplate. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GoalTemplateInner get(String serviceGroupName, String goalTemplateName) { + return getWithResponse(serviceGroupName, goalTemplateName, Context.NONE).getValue(); + } + + /** + * Create a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal template a AzureResilienceProviderHub resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String serviceGroupName, + String goalTemplateName, GoalTemplateInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), goalTemplateName, contentType, accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal template a AzureResilienceProviderHub resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String serviceGroupName, String goalTemplateName, + GoalTemplateInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + goalTemplateName, contentType, accept, resource, Context.NONE); + } + + /** + * Create a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal template a AzureResilienceProviderHub resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String serviceGroupName, String goalTemplateName, + GoalTemplateInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + goalTemplateName, contentType, accept, resource, context); + } + + /** + * Create a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 goal template a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GoalTemplateInner> + beginCreateOrUpdateAsync(String serviceGroupName, String goalTemplateName, GoalTemplateInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(serviceGroupName, goalTemplateName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + GoalTemplateInner.class, GoalTemplateInner.class, this.client.getContext()); + } + + /** + * Create a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 goal template a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GoalTemplateInner> beginCreateOrUpdate(String serviceGroupName, + String goalTemplateName, GoalTemplateInner resource) { + Response response = createOrUpdateWithResponse(serviceGroupName, goalTemplateName, resource); + return this.client.getLroResult(response, GoalTemplateInner.class, + GoalTemplateInner.class, Context.NONE); + } + + /** + * Create a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 goal template a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GoalTemplateInner> beginCreateOrUpdate(String serviceGroupName, + String goalTemplateName, GoalTemplateInner resource, Context context) { + Response response + = createOrUpdateWithResponse(serviceGroupName, goalTemplateName, resource, context); + return this.client.getLroResult(response, GoalTemplateInner.class, + GoalTemplateInner.class, context); + } + + /** + * Create a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal template a AzureResilienceProviderHub resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String serviceGroupName, String goalTemplateName, + GoalTemplateInner resource) { + return beginCreateOrUpdateAsync(serviceGroupName, goalTemplateName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal template a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GoalTemplateInner createOrUpdate(String serviceGroupName, String goalTemplateName, + GoalTemplateInner resource) { + return beginCreateOrUpdate(serviceGroupName, goalTemplateName, resource).getFinalResult(); + } + + /** + * Create a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal template a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GoalTemplateInner createOrUpdate(String serviceGroupName, String goalTemplateName, + GoalTemplateInner resource, Context context) { + return beginCreateOrUpdate(serviceGroupName, goalTemplateName, resource, context).getFinalResult(); + } + + /** + * Update a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal template a AzureResilienceProviderHub resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String serviceGroupName, String goalTemplateName, + GoalTemplateInner properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), goalTemplateName, contentType, accept, properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal template a AzureResilienceProviderHub resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String serviceGroupName, String goalTemplateName, + GoalTemplateInner properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + goalTemplateName, contentType, accept, properties, Context.NONE); + } + + /** + * Update a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal template a AzureResilienceProviderHub resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String serviceGroupName, String goalTemplateName, + GoalTemplateInner properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + goalTemplateName, contentType, accept, properties, context); + } + + /** + * Update a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 goal template a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpdateAsync(String serviceGroupName, String goalTemplateName, + GoalTemplateInner properties) { + Mono>> mono = updateWithResponseAsync(serviceGroupName, goalTemplateName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Update a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 goal template a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpdate(String serviceGroupName, String goalTemplateName, + GoalTemplateInner properties) { + Response response = updateWithResponse(serviceGroupName, goalTemplateName, properties); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Update a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 goal template a AzureResilienceProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpdate(String serviceGroupName, String goalTemplateName, + GoalTemplateInner properties, Context context) { + Response response = updateWithResponse(serviceGroupName, goalTemplateName, properties, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Update a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal template a AzureResilienceProviderHub resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String serviceGroupName, String goalTemplateName, GoalTemplateInner properties) { + return beginUpdateAsync(serviceGroupName, goalTemplateName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceGroupName, String goalTemplateName, GoalTemplateInner properties) { + beginUpdate(serviceGroupName, goalTemplateName, properties).getFinalResult(); + } + + /** + * Update a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceGroupName, String goalTemplateName, GoalTemplateInner properties, + Context context) { + beginUpdate(serviceGroupName, goalTemplateName, properties, context).getFinalResult(); + } + + /** + * Delete a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceGroupName, String goalTemplateName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), goalTemplateName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String serviceGroupName, String goalTemplateName) { + return service.deleteSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + goalTemplateName, Context.NONE); + } + + /** + * Delete a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String serviceGroupName, String goalTemplateName, Context context) { + return service.deleteSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + goalTemplateName, context); + } + + /** + * Delete a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String serviceGroupName, String goalTemplateName) { + Mono>> mono = deleteWithResponseAsync(serviceGroupName, goalTemplateName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String serviceGroupName, String goalTemplateName) { + Response response = deleteWithResponse(serviceGroupName, goalTemplateName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String serviceGroupName, String goalTemplateName, + Context context) { + Response response = deleteWithResponse(serviceGroupName, goalTemplateName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceGroupName, String goalTemplateName) { + return beginDeleteAsync(serviceGroupName, goalTemplateName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceGroupName, String goalTemplateName) { + beginDelete(serviceGroupName, goalTemplateName).getFinalResult(); + } + + /** + * Delete a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceGroupName, String goalTemplateName, Context context) { + beginDelete(serviceGroupName, goalTemplateName, context).getFinalResult(); + } + + /** + * List GoalTemplate resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalTemplate list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String serviceGroupName, String skipToken, + Integer top) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, 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 GoalTemplate resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalTemplate list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String serviceGroupName, String skipToken, Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(serviceGroupName, skipToken, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List GoalTemplate resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalTemplate list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String serviceGroupName) { + final String skipToken = null; + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(serviceGroupName, skipToken, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List GoalTemplate resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalTemplate list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String skipToken, Integer top) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List GoalTemplate resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalTemplate list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String skipToken, Integer top, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List GoalTemplate resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalTemplate list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName) { + final String skipToken = null; + final Integer top = null; + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, skipToken, top), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List GoalTemplate resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalTemplate list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName, String skipToken, Integer top, + Context context) { + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, skipToken, top, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalTemplate list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalTemplate list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalTemplate list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalTemplatesImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalTemplatesImpl.java new file mode 100644 index 000000000000..88d0eccb0afa --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalTemplatesImpl.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.GoalTemplatesClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalTemplateInner; +import com.azure.resourcemanager.resiliencemanagement.models.GoalTemplate; +import com.azure.resourcemanager.resiliencemanagement.models.GoalTemplates; + +public final class GoalTemplatesImpl implements GoalTemplates { + private static final ClientLogger LOGGER = new ClientLogger(GoalTemplatesImpl.class); + + private final GoalTemplatesClient innerClient; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + public GoalTemplatesImpl(GoalTemplatesClient innerClient, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String serviceGroupName, String goalTemplateName, Context context) { + Response inner + = this.serviceClient().getWithResponse(serviceGroupName, goalTemplateName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GoalTemplateImpl(inner.getValue(), this.manager())); + } + + public GoalTemplate get(String serviceGroupName, String goalTemplateName) { + GoalTemplateInner inner = this.serviceClient().get(serviceGroupName, goalTemplateName); + if (inner != null) { + return new GoalTemplateImpl(inner, this.manager()); + } else { + return null; + } + } + + public GoalTemplate createOrUpdate(String serviceGroupName, String goalTemplateName, GoalTemplateInner resource) { + GoalTemplateInner inner = this.serviceClient().createOrUpdate(serviceGroupName, goalTemplateName, resource); + if (inner != null) { + return new GoalTemplateImpl(inner, this.manager()); + } else { + return null; + } + } + + public GoalTemplate createOrUpdate(String serviceGroupName, String goalTemplateName, GoalTemplateInner resource, + Context context) { + GoalTemplateInner inner + = this.serviceClient().createOrUpdate(serviceGroupName, goalTemplateName, resource, context); + if (inner != null) { + return new GoalTemplateImpl(inner, this.manager()); + } else { + return null; + } + } + + public void update(String serviceGroupName, String goalTemplateName, GoalTemplateInner properties) { + this.serviceClient().update(serviceGroupName, goalTemplateName, properties); + } + + public void update(String serviceGroupName, String goalTemplateName, GoalTemplateInner properties, + Context context) { + this.serviceClient().update(serviceGroupName, goalTemplateName, properties, context); + } + + public void deleteByResourceGroup(String serviceGroupName, String goalTemplateName) { + this.serviceClient().delete(serviceGroupName, goalTemplateName); + } + + public void delete(String serviceGroupName, String goalTemplateName, Context context) { + this.serviceClient().delete(serviceGroupName, goalTemplateName, context); + } + + public PagedIterable list(String serviceGroupName) { + PagedIterable inner = this.serviceClient().list(serviceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GoalTemplateImpl(inner1, this.manager())); + } + + public PagedIterable list(String serviceGroupName, String skipToken, Integer top, Context context) { + PagedIterable inner = this.serviceClient().list(serviceGroupName, skipToken, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GoalTemplateImpl(inner1, this.manager())); + } + + private GoalTemplatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationImpl.java new file mode 100644 index 000000000000..990c27bee661 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.resourcemanager.resiliencemanagement.fluent.models.OperationInner; +import com.azure.resourcemanager.resiliencemanagement.models.ActionType; +import com.azure.resourcemanager.resiliencemanagement.models.Operation; +import com.azure.resourcemanager.resiliencemanagement.models.OperationDisplay; +import com.azure.resourcemanager.resiliencemanagement.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + OperationImpl(OperationInner innerObject, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager 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 Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationStatusClientImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationStatusClientImpl.java new file mode 100644 index 000000000000..7000b2d39b12 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationStatusClientImpl.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.OperationStatusClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.OperationStatusResultInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationStatusClient. + */ +public final class OperationStatusClientImpl implements OperationStatusClient { + /** + * The proxy service used to perform REST calls. + */ + private final OperationStatusService service; + + /** + * The service client containing this operation class. + */ + private final ResilienceManagementManagementClientImpl client; + + /** + * Initializes an instance of OperationStatusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationStatusClientImpl(ResilienceManagementManagementClientImpl client) { + this.service + = RestProxy.create(OperationStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResilienceManagementManagementClientOperationStatus to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ResilienceManagementManagementClientOperationStatus") + public interface OperationStatusService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.AzureResilienceManagement/locations/{location}/operationStatuses/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("location") String location, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.AzureResilienceManagement/locations/{location}/operationStatuses/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("location") String location, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Returns the current status of an async operation. + * + * @param location The location name. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String location, String operationId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), location, + operationId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the current status of an async operation. + * + * @param location The location name. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String operationId) { + return getWithResponseAsync(location, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns the current status of an async operation. + * + * @param location The location name. + * @param operationId The ID of an ongoing async 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 current status of an async operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String location, String operationId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), location, operationId, accept, + context); + } + + /** + * Returns the current status of an async operation. + * + * @param location The location name. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner get(String location, String operationId) { + return getWithResponse(location, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationStatusImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationStatusImpl.java new file mode 100644 index 000000000000..ac1910eea575 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationStatusImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.OperationStatusClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.resiliencemanagement.models.OperationStatus; +import com.azure.resourcemanager.resiliencemanagement.models.OperationStatusResult; + +public final class OperationStatusImpl implements OperationStatus { + private static final ClientLogger LOGGER = new ClientLogger(OperationStatusImpl.class); + + private final OperationStatusClient innerClient; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + public OperationStatusImpl(OperationStatusClient innerClient, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String location, String operationId, Context context) { + Response inner + = this.serviceClient().getWithResponse(location, operationId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OperationStatusResultImpl(inner.getValue(), this.manager())); + } + + public OperationStatusResult get(String location, String operationId) { + OperationStatusResultInner inner = this.serviceClient().get(location, operationId); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private OperationStatusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationStatusResultImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationStatusResultImpl.java new file mode 100644 index 000000000000..4ff3b1e1204c --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationStatusResultImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.resiliencemanagement.models.OperationStatusResult; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class OperationStatusResultImpl implements OperationStatusResult { + private OperationStatusResultInner innerObject; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + OperationStatusResultImpl(OperationStatusResultInner innerObject, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String status() { + return this.innerModel().status(); + } + + public Double percentComplete() { + return this.innerModel().percentComplete(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public List operations() { + List inner = this.innerModel().operations(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new OperationStatusResultImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ManagementError error() { + return this.innerModel().error(); + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public OperationStatusResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationsClientImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..9a5d53c4444e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationsClientImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.OperationsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.OperationInner; +import com.azure.resourcemanager.resiliencemanagement.implementation.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 ResilienceManagementManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ResilienceManagementManagementClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResilienceManagementManagementClientOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ResilienceManagementManagementClientOperations") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.AzureResilienceManagement/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.AzureResilienceManagement/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the operations for the 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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the operations for the 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the operations for the 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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the operations for the 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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the operations for the 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List the operations for the 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationsImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationsImpl.java new file mode 100644 index 000000000000..a2cc50829eb1 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.OperationsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.OperationInner; +import com.azure.resourcemanager.resiliencemanagement.models.Operation; +import com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.ResilienceManagementManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobImpl.java new file mode 100644 index 000000000000..bb73c7f648c7 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryJobInner; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryJob; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryJobProperties; + +public final class RecoveryJobImpl implements RecoveryJob { + private RecoveryJobInner innerObject; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + RecoveryJobImpl(RecoveryJobInner innerObject, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager 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 RecoveryJobProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public RecoveryJobInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobResourceImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobResourceImpl.java new file mode 100644 index 000000000000..054029e0adfb --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobResourceImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryJobResourceInner; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryJobResource; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryJobResourceProperties; + +public final class RecoveryJobResourceImpl implements RecoveryJobResource { + private RecoveryJobResourceInner innerObject; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + RecoveryJobResourceImpl(RecoveryJobResourceInner innerObject, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager 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 RecoveryJobResourceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public RecoveryJobResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobResourcesClientImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobResourcesClientImpl.java new file mode 100644 index 000000000000..d288b65c78e0 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobResourcesClientImpl.java @@ -0,0 +1,383 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.RecoveryJobResourcesClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryJobResourceInner; +import com.azure.resourcemanager.resiliencemanagement.implementation.models.RecoveryJobResourceListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RecoveryJobResourcesClient. + */ +public final class RecoveryJobResourcesClientImpl implements RecoveryJobResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final RecoveryJobResourcesService service; + + /** + * The service client containing this operation class. + */ + private final ResilienceManagementManagementClientImpl client; + + /** + * Initializes an instance of RecoveryJobResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RecoveryJobResourcesClientImpl(ResilienceManagementManagementClientImpl client) { + this.service = RestProxy.create(RecoveryJobResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResilienceManagementManagementClientRecoveryJobResources to be used + * by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ResilienceManagementManagementClientRecoveryJobResources") + public interface RecoveryJobResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/recoveryJobs/{recoveryJobName}/recoveryJobResources/{recoveryJobResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("recoveryPlanName") String recoveryPlanName, + @PathParam("recoveryJobName") String recoveryJobName, + @PathParam("recoveryJobResourceName") String recoveryJobResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/recoveryJobs/{recoveryJobName}/recoveryJobResources/{recoveryJobResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("recoveryPlanName") String recoveryPlanName, + @PathParam("recoveryJobName") String recoveryJobName, + @PathParam("recoveryJobResourceName") String recoveryJobResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/recoveryJobs/{recoveryJobName}/recoveryJobResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("recoveryPlanName") String recoveryPlanName, + @PathParam("recoveryJobName") String recoveryJobName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/recoveryJobs/{recoveryJobName}/recoveryJobResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("recoveryPlanName") String recoveryPlanName, + @PathParam("recoveryJobName") String recoveryJobName, @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a RecoveryJobResource. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param recoveryJobResourceName The unique name (GUID) of the recovery job 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 a RecoveryJobResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String serviceGroupName, + String recoveryPlanName, String recoveryJobName, String recoveryJobResourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + recoveryPlanName, recoveryJobName, recoveryJobResourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a RecoveryJobResource. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param recoveryJobResourceName The unique name (GUID) of the recovery job 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 a RecoveryJobResource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String serviceGroupName, String recoveryPlanName, + String recoveryJobName, String recoveryJobResourceName) { + return getWithResponseAsync(serviceGroupName, recoveryPlanName, recoveryJobName, recoveryJobResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a RecoveryJobResource. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param recoveryJobResourceName The unique name (GUID) of the recovery job 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 a RecoveryJobResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String serviceGroupName, String recoveryPlanName, + String recoveryJobName, String recoveryJobResourceName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + recoveryPlanName, recoveryJobName, recoveryJobResourceName, accept, context); + } + + /** + * Get a RecoveryJobResource. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param recoveryJobResourceName The unique name (GUID) of the recovery job 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 a RecoveryJobResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryJobResourceInner get(String serviceGroupName, String recoveryPlanName, String recoveryJobName, + String recoveryJobResourceName) { + return getWithResponse(serviceGroupName, recoveryPlanName, recoveryJobName, recoveryJobResourceName, + Context.NONE).getValue(); + } + + /** + * List RecoveryJobResource resources by RecoveryJob. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJobResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String serviceGroupName, + String recoveryPlanName, String recoveryJobName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), recoveryPlanName, recoveryJobName, 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 RecoveryJobResource resources by RecoveryJob. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJobResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String serviceGroupName, String recoveryPlanName, + String recoveryJobName) { + return new PagedFlux<>(() -> listSinglePageAsync(serviceGroupName, recoveryPlanName, recoveryJobName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List RecoveryJobResource resources by RecoveryJob. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJobResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String recoveryPlanName, + String recoveryJobName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), recoveryPlanName, recoveryJobName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List RecoveryJobResource resources by RecoveryJob. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJobResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String recoveryPlanName, + String recoveryJobName, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), recoveryPlanName, recoveryJobName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List RecoveryJobResource resources by RecoveryJob. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJobResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName, String recoveryPlanName, + String recoveryJobName) { + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, recoveryPlanName, recoveryJobName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List RecoveryJobResource resources by RecoveryJob. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJobResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName, String recoveryPlanName, + String recoveryJobName, Context context) { + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, recoveryPlanName, recoveryJobName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJobResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJobResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJobResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobResourcesImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobResourcesImpl.java new file mode 100644 index 000000000000..297fbbe71b8e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobResourcesImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.RecoveryJobResourcesClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryJobResourceInner; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryJobResource; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryJobResources; + +public final class RecoveryJobResourcesImpl implements RecoveryJobResources { + private static final ClientLogger LOGGER = new ClientLogger(RecoveryJobResourcesImpl.class); + + private final RecoveryJobResourcesClient innerClient; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + public RecoveryJobResourcesImpl(RecoveryJobResourcesClient innerClient, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String serviceGroupName, String recoveryPlanName, + String recoveryJobName, String recoveryJobResourceName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(serviceGroupName, recoveryPlanName, recoveryJobName, recoveryJobResourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RecoveryJobResourceImpl(inner.getValue(), this.manager())); + } + + public RecoveryJobResource get(String serviceGroupName, String recoveryPlanName, String recoveryJobName, + String recoveryJobResourceName) { + RecoveryJobResourceInner inner + = this.serviceClient().get(serviceGroupName, recoveryPlanName, recoveryJobName, recoveryJobResourceName); + if (inner != null) { + return new RecoveryJobResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String serviceGroupName, String recoveryPlanName, + String recoveryJobName) { + PagedIterable inner + = this.serviceClient().list(serviceGroupName, recoveryPlanName, recoveryJobName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RecoveryJobResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String serviceGroupName, String recoveryPlanName, + String recoveryJobName, Context context) { + PagedIterable inner + = this.serviceClient().list(serviceGroupName, recoveryPlanName, recoveryJobName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RecoveryJobResourceImpl(inner1, this.manager())); + } + + private RecoveryJobResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobsClientImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobsClientImpl.java new file mode 100644 index 000000000000..1ffee30acf78 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobsClientImpl.java @@ -0,0 +1,1037 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.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.BinaryData; +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.resiliencemanagement.fluent.RecoveryJobsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryJobInner; +import com.azure.resourcemanager.resiliencemanagement.implementation.models.RecoveryJobListResult; +import com.azure.resourcemanager.resiliencemanagement.models.ArmResponseErrorResponse; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryActionRequest; +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 RecoveryJobsClient. + */ +public final class RecoveryJobsClientImpl implements RecoveryJobsClient { + /** + * The proxy service used to perform REST calls. + */ + private final RecoveryJobsService service; + + /** + * The service client containing this operation class. + */ + private final ResilienceManagementManagementClientImpl client; + + /** + * Initializes an instance of RecoveryJobsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RecoveryJobsClientImpl(ResilienceManagementManagementClientImpl client) { + this.service + = RestProxy.create(RecoveryJobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResilienceManagementManagementClientRecoveryJobs to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ResilienceManagementManagementClientRecoveryJobs") + public interface RecoveryJobsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/recoveryJobs/{recoveryJobName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("recoveryPlanName") String recoveryPlanName, + @PathParam("recoveryJobName") String recoveryJobName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/recoveryJobs/{recoveryJobName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("recoveryPlanName") String recoveryPlanName, + @PathParam("recoveryJobName") String recoveryJobName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/recoveryJobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("recoveryPlanName") String recoveryPlanName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/recoveryJobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("recoveryPlanName") String recoveryPlanName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/recoveryJobs/{recoveryJobName}/cancel") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cancel(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @PathParam("recoveryJobName") String recoveryJobName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") RecoveryActionRequest body, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/recoveryJobs/{recoveryJobName}/cancel") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response cancelSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @PathParam("recoveryJobName") String recoveryJobName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") RecoveryActionRequest body, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/recoveryJobs/{recoveryJobName}/resume") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resume(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @PathParam("recoveryJobName") String recoveryJobName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") RecoveryActionRequest body, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/recoveryJobs/{recoveryJobName}/resume") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response resumeSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @PathParam("recoveryJobName") String recoveryJobName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") RecoveryActionRequest body, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/recoveryJobs/{recoveryJobName}/retry") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> retry(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @PathParam("recoveryJobName") String recoveryJobName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/recoveryJobs/{recoveryJobName}/retry") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response retrySync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @PathParam("recoveryJobName") String recoveryJobName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a RecoveryJob. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 RecoveryJob along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String serviceGroupName, String recoveryPlanName, + String recoveryJobName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), recoveryPlanName, recoveryJobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a RecoveryJob. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 RecoveryJob on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String serviceGroupName, String recoveryPlanName, String recoveryJobName) { + return getWithResponseAsync(serviceGroupName, recoveryPlanName, recoveryJobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a RecoveryJob. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 RecoveryJob along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String serviceGroupName, String recoveryPlanName, + String recoveryJobName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + recoveryPlanName, recoveryJobName, accept, context); + } + + /** + * Get a RecoveryJob. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 RecoveryJob. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryJobInner get(String serviceGroupName, String recoveryPlanName, String recoveryJobName) { + return getWithResponse(serviceGroupName, recoveryPlanName, recoveryJobName, Context.NONE).getValue(); + } + + /** + * List RecoveryJob resources by RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJob list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String serviceGroupName, + String recoveryPlanName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), recoveryPlanName, 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 RecoveryJob resources by RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJob list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String serviceGroupName, String recoveryPlanName) { + return new PagedFlux<>(() -> listSinglePageAsync(serviceGroupName, recoveryPlanName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List RecoveryJob resources by RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJob list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String recoveryPlanName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), recoveryPlanName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List RecoveryJob resources by RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJob list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String recoveryPlanName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), recoveryPlanName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List RecoveryJob resources by RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJob list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName, String recoveryPlanName) { + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, recoveryPlanName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List RecoveryJob resources by RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJob list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName, String recoveryPlanName, Context context) { + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, recoveryPlanName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * This action attempts to cancel the ongoing recovery orchestration job. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @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 serviceGroupName, String operationId, + String recoveryPlanName, String recoveryJobName, RecoveryActionRequest body) { + final String contentType = "application/json"; + return FluxUtil + .withContext( + context -> service.cancel(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, recoveryPlanName, recoveryJobName, contentType, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This action attempts to cancel the ongoing recovery orchestration job. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response cancelWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, String recoveryJobName, RecoveryActionRequest body) { + final String contentType = "application/json"; + return service.cancelSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), operationId, + recoveryPlanName, recoveryJobName, contentType, body, Context.NONE); + } + + /** + * This action attempts to cancel the ongoing recovery orchestration job. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action 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 ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response cancelWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, String recoveryJobName, RecoveryActionRequest body, Context context) { + final String contentType = "application/json"; + return service.cancelSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), operationId, + recoveryPlanName, recoveryJobName, contentType, body, context); + } + + /** + * This action attempts to cancel the ongoing recovery orchestration job. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArmResponseErrorResponse> beginCancelAsync( + String serviceGroupName, String operationId, String recoveryPlanName, String recoveryJobName, + RecoveryActionRequest body) { + Mono>> mono + = cancelWithResponseAsync(serviceGroupName, operationId, recoveryPlanName, recoveryJobName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ArmResponseErrorResponse.class, ArmResponseErrorResponse.class, + this.client.getContext()); + } + + /** + * This action attempts to cancel the ongoing recovery orchestration job. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArmResponseErrorResponse> beginCancel( + String serviceGroupName, String operationId, String recoveryPlanName, String recoveryJobName, + RecoveryActionRequest body) { + Response response + = cancelWithResponse(serviceGroupName, operationId, recoveryPlanName, recoveryJobName, body); + return this.client.getLroResult(response, + ArmResponseErrorResponse.class, ArmResponseErrorResponse.class, Context.NONE); + } + + /** + * This action attempts to cancel the ongoing recovery orchestration job. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action 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 ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArmResponseErrorResponse> beginCancel( + String serviceGroupName, String operationId, String recoveryPlanName, String recoveryJobName, + RecoveryActionRequest body, Context context) { + Response response + = cancelWithResponse(serviceGroupName, operationId, recoveryPlanName, recoveryJobName, body, context); + return this.client.getLroResult(response, + ArmResponseErrorResponse.class, ArmResponseErrorResponse.class, context); + } + + /** + * This action attempts to cancel the ongoing recovery orchestration job. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync(String serviceGroupName, String operationId, + String recoveryPlanName, String recoveryJobName, RecoveryActionRequest body) { + return beginCancelAsync(serviceGroupName, operationId, recoveryPlanName, recoveryJobName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action attempts to cancel the ongoing recovery orchestration job. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArmResponseErrorResponse cancel(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, RecoveryActionRequest body) { + return beginCancel(serviceGroupName, operationId, recoveryPlanName, recoveryJobName, body).getFinalResult(); + } + + /** + * This action attempts to cancel the ongoing recovery orchestration job. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action 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 ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArmResponseErrorResponse cancel(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, RecoveryActionRequest body, Context context) { + return beginCancel(serviceGroupName, operationId, recoveryPlanName, recoveryJobName, body, context) + .getFinalResult(); + } + + /** + * This action resumes the ongoing recovery orchestration job that was paused for required user intervention. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @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>> resumeWithResponseAsync(String serviceGroupName, String operationId, + String recoveryPlanName, String recoveryJobName, RecoveryActionRequest body) { + final String contentType = "application/json"; + return FluxUtil + .withContext( + context -> service.resume(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, recoveryPlanName, recoveryJobName, contentType, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This action resumes the ongoing recovery orchestration job that was paused for required user intervention. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response resumeWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, String recoveryJobName, RecoveryActionRequest body) { + final String contentType = "application/json"; + return service.resumeSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), operationId, + recoveryPlanName, recoveryJobName, contentType, body, Context.NONE); + } + + /** + * This action resumes the ongoing recovery orchestration job that was paused for required user intervention. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action 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 ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response resumeWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, String recoveryJobName, RecoveryActionRequest body, Context context) { + final String contentType = "application/json"; + return service.resumeSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), operationId, + recoveryPlanName, recoveryJobName, contentType, body, context); + } + + /** + * This action resumes the ongoing recovery orchestration job that was paused for required user intervention. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArmResponseErrorResponse> beginResumeAsync( + String serviceGroupName, String operationId, String recoveryPlanName, String recoveryJobName, + RecoveryActionRequest body) { + Mono>> mono + = resumeWithResponseAsync(serviceGroupName, operationId, recoveryPlanName, recoveryJobName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ArmResponseErrorResponse.class, ArmResponseErrorResponse.class, + this.client.getContext()); + } + + /** + * This action resumes the ongoing recovery orchestration job that was paused for required user intervention. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArmResponseErrorResponse> beginResume( + String serviceGroupName, String operationId, String recoveryPlanName, String recoveryJobName, + RecoveryActionRequest body) { + Response response + = resumeWithResponse(serviceGroupName, operationId, recoveryPlanName, recoveryJobName, body); + return this.client.getLroResult(response, + ArmResponseErrorResponse.class, ArmResponseErrorResponse.class, Context.NONE); + } + + /** + * This action resumes the ongoing recovery orchestration job that was paused for required user intervention. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action 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 ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArmResponseErrorResponse> beginResume( + String serviceGroupName, String operationId, String recoveryPlanName, String recoveryJobName, + RecoveryActionRequest body, Context context) { + Response response + = resumeWithResponse(serviceGroupName, operationId, recoveryPlanName, recoveryJobName, body, context); + return this.client.getLroResult(response, + ArmResponseErrorResponse.class, ArmResponseErrorResponse.class, context); + } + + /** + * This action resumes the ongoing recovery orchestration job that was paused for required user intervention. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumeAsync(String serviceGroupName, String operationId, + String recoveryPlanName, String recoveryJobName, RecoveryActionRequest body) { + return beginResumeAsync(serviceGroupName, operationId, recoveryPlanName, recoveryJobName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action resumes the ongoing recovery orchestration job that was paused for required user intervention. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArmResponseErrorResponse resume(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, RecoveryActionRequest body) { + return beginResume(serviceGroupName, operationId, recoveryPlanName, recoveryJobName, body).getFinalResult(); + } + + /** + * This action resumes the ongoing recovery orchestration job that was paused for required user intervention. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action 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 ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArmResponseErrorResponse resume(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, RecoveryActionRequest body, Context context) { + return beginResume(serviceGroupName, operationId, recoveryPlanName, recoveryJobName, body, context) + .getFinalResult(); + } + + /** + * This action retries the ongoing recovery orchestration job for resources that failed in previous attempts. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @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>> retryWithResponseAsync(String serviceGroupName, String operationId, + String recoveryPlanName, String recoveryJobName) { + return FluxUtil + .withContext(context -> service.retry(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, recoveryJobName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This action retries the ongoing recovery orchestration job for resources that failed in previous attempts. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response retryWithResponse(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName) { + return service.retrySync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), operationId, + recoveryPlanName, recoveryJobName, Context.NONE); + } + + /** + * This action retries the ongoing recovery orchestration job for resources that failed in previous attempts. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response retryWithResponse(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, Context context) { + return service.retrySync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), operationId, + recoveryPlanName, recoveryJobName, context); + } + + /** + * This action retries the ongoing recovery orchestration job for resources that failed in previous attempts. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArmResponseErrorResponse> + beginRetryAsync(String serviceGroupName, String operationId, String recoveryPlanName, String recoveryJobName) { + Mono>> mono + = retryWithResponseAsync(serviceGroupName, operationId, recoveryPlanName, recoveryJobName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ArmResponseErrorResponse.class, ArmResponseErrorResponse.class, + this.client.getContext()); + } + + /** + * This action retries the ongoing recovery orchestration job for resources that failed in previous attempts. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArmResponseErrorResponse> + beginRetry(String serviceGroupName, String operationId, String recoveryPlanName, String recoveryJobName) { + Response response + = retryWithResponse(serviceGroupName, operationId, recoveryPlanName, recoveryJobName); + return this.client.getLroResult(response, + ArmResponseErrorResponse.class, ArmResponseErrorResponse.class, Context.NONE); + } + + /** + * This action retries the ongoing recovery orchestration job for resources that failed in previous attempts. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArmResponseErrorResponse> beginRetry( + String serviceGroupName, String operationId, String recoveryPlanName, String recoveryJobName, Context context) { + Response response + = retryWithResponse(serviceGroupName, operationId, recoveryPlanName, recoveryJobName, context); + return this.client.getLroResult(response, + ArmResponseErrorResponse.class, ArmResponseErrorResponse.class, context); + } + + /** + * This action retries the ongoing recovery orchestration job for resources that failed in previous attempts. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono retryAsync(String serviceGroupName, String operationId, + String recoveryPlanName, String recoveryJobName) { + return beginRetryAsync(serviceGroupName, operationId, recoveryPlanName, recoveryJobName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action retries the ongoing recovery orchestration job for resources that failed in previous attempts. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArmResponseErrorResponse retry(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName) { + return beginRetry(serviceGroupName, operationId, recoveryPlanName, recoveryJobName).getFinalResult(); + } + + /** + * This action retries the ongoing recovery orchestration job for resources that failed in previous attempts. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArmResponseErrorResponse retry(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, Context context) { + return beginRetry(serviceGroupName, operationId, recoveryPlanName, recoveryJobName, context).getFinalResult(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJob list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJob list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJob list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobsImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobsImpl.java new file mode 100644 index 000000000000..22f7033f2526 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobsImpl.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.RecoveryJobsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryJobInner; +import com.azure.resourcemanager.resiliencemanagement.models.ArmResponseErrorResponse; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryActionRequest; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryJob; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryJobs; + +public final class RecoveryJobsImpl implements RecoveryJobs { + private static final ClientLogger LOGGER = new ClientLogger(RecoveryJobsImpl.class); + + private final RecoveryJobsClient innerClient; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + public RecoveryJobsImpl(RecoveryJobsClient innerClient, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String serviceGroupName, String recoveryPlanName, + String recoveryJobName, Context context) { + Response inner + = this.serviceClient().getWithResponse(serviceGroupName, recoveryPlanName, recoveryJobName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RecoveryJobImpl(inner.getValue(), this.manager())); + } + + public RecoveryJob get(String serviceGroupName, String recoveryPlanName, String recoveryJobName) { + RecoveryJobInner inner = this.serviceClient().get(serviceGroupName, recoveryPlanName, recoveryJobName); + if (inner != null) { + return new RecoveryJobImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String serviceGroupName, String recoveryPlanName) { + PagedIterable inner = this.serviceClient().list(serviceGroupName, recoveryPlanName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RecoveryJobImpl(inner1, this.manager())); + } + + public PagedIterable list(String serviceGroupName, String recoveryPlanName, Context context) { + PagedIterable inner = this.serviceClient().list(serviceGroupName, recoveryPlanName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RecoveryJobImpl(inner1, this.manager())); + } + + public ArmResponseErrorResponse cancel(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, RecoveryActionRequest body) { + return this.serviceClient().cancel(serviceGroupName, operationId, recoveryPlanName, recoveryJobName, body); + } + + public ArmResponseErrorResponse cancel(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, RecoveryActionRequest body, Context context) { + return this.serviceClient() + .cancel(serviceGroupName, operationId, recoveryPlanName, recoveryJobName, body, context); + } + + public ArmResponseErrorResponse resume(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, RecoveryActionRequest body) { + return this.serviceClient().resume(serviceGroupName, operationId, recoveryPlanName, recoveryJobName, body); + } + + public ArmResponseErrorResponse resume(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, RecoveryActionRequest body, Context context) { + return this.serviceClient() + .resume(serviceGroupName, operationId, recoveryPlanName, recoveryJobName, body, context); + } + + public ArmResponseErrorResponse retry(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName) { + return this.serviceClient().retry(serviceGroupName, operationId, recoveryPlanName, recoveryJobName); + } + + public ArmResponseErrorResponse retry(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, Context context) { + return this.serviceClient().retry(serviceGroupName, operationId, recoveryPlanName, recoveryJobName, context); + } + + private RecoveryJobsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlanActionBaseResponseImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlanActionBaseResponseImpl.java new file mode 100644 index 000000000000..84559dfd948d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlanActionBaseResponseImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryPlanActionBaseResponseInner; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanActionBaseResponse; + +public final class RecoveryPlanActionBaseResponseImpl implements RecoveryPlanActionBaseResponse { + private RecoveryPlanActionBaseResponseInner innerObject; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + RecoveryPlanActionBaseResponseImpl(RecoveryPlanActionBaseResponseInner innerObject, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String jobId() { + return this.innerModel().jobId(); + } + + public RecoveryPlanActionBaseResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlanActionsClientImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlanActionsClientImpl.java new file mode 100644 index 000000000000..895f059c0b01 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlanActionsClientImpl.java @@ -0,0 +1,3186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.management.polling.PollResult; +import com.azure.core.util.BinaryData; +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.resiliencemanagement.fluent.RecoveryPlanActionsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryPlanActionBaseResponseInner; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.UpdateRecoveryResourcesResponseInner; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.ValidateForRecoveryOperationBaseResponseInner; +import com.azure.resourcemanager.resiliencemanagement.models.ArmResponseErrorResponse; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.ReprotectRequest; +import com.azure.resourcemanager.resiliencemanagement.models.TestFailoverCleanupRequest; +import com.azure.resourcemanager.resiliencemanagement.models.UpdateRecoveryResourcesRequest; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForOperationRequest; +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 RecoveryPlanActionsClient. + */ +public final class RecoveryPlanActionsClientImpl implements RecoveryPlanActionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final RecoveryPlanActionsService service; + + /** + * The service client containing this operation class. + */ + private final ResilienceManagementManagementClientImpl client; + + /** + * Initializes an instance of RecoveryPlanActionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RecoveryPlanActionsClientImpl(ResilienceManagementManagementClientImpl client) { + this.service = RestProxy.create(RecoveryPlanActionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResilienceManagementManagementClientRecoveryPlanActions to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ResilienceManagementManagementClientRecoveryPlanActions") + public interface RecoveryPlanActionsService { + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/finalize") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> finalize(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/finalize") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response finalizeSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/updateResources") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateResources(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") UpdateRecoveryResourcesRequest body, Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/updateResources") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateResourcesSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") UpdateRecoveryResourcesRequest body, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/validateForOperation") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validateForOperation(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ValidateForOperationRequest body, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/validateForOperation") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response validateForOperationSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ValidateForOperationRequest body, Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/validateForFailover") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validateForFailover(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FailoverRequest body, Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/validateForFailover") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response validateForFailoverSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FailoverRequest body, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/validateForFailoverCommit") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validateForFailoverCommit(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/validateForFailoverCommit") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response validateForFailoverCommitSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Accept") String accept, Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/validateForTestFailover") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validateForTestFailover(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FailoverRequest body, Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/validateForTestFailover") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response validateForTestFailoverSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FailoverRequest body, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/validateForTestFailoverCleanup") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validateForTestFailoverCleanup(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/validateForTestFailoverCleanup") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response validateForTestFailoverCleanupSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/validateForReprotect") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validateForReprotect(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ReprotectRequest body, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/validateForReprotect") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response validateForReprotectSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ReprotectRequest body, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/checkReadiness") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> checkReadiness(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/checkReadiness") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response checkReadinessSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Accept") String accept, Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/failover") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> failover(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FailoverRequest body, Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/failover") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response failoverSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FailoverRequest body, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/failoverCommit") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> failoverCommit(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/failoverCommit") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response failoverCommitSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/reprotect") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reprotect(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ReprotectRequest body, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/reprotect") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response reprotectSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ReprotectRequest body, + Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/testFailover") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> testFailover(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FailoverRequest body, Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/testFailover") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response testFailoverSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FailoverRequest body, Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/testFailoverCleanup") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> testFailoverCleanup(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") TestFailoverCleanupRequest body, Context context); + + @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/testFailoverCleanup") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response testFailoverCleanupSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("operation-id") String operationId, @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") TestFailoverCleanupRequest body, Context context); + } + + /** + * This action finalizes the recovery orchestration plan, ensuring all necessary configurations are in place. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @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>> finalizeWithResponseAsync(String serviceGroupName, String operationId, + String recoveryPlanName) { + return FluxUtil + .withContext(context -> service.finalize(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This action finalizes the recovery orchestration plan, ensuring all necessary configurations are in place. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response finalizeWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName) { + return service.finalizeSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, recoveryPlanName, Context.NONE); + } + + /** + * This action finalizes the recovery orchestration plan, ensuring all necessary configurations are in place. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response finalizeWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, Context context) { + return service.finalizeSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, recoveryPlanName, context); + } + + /** + * This action finalizes the recovery orchestration plan, ensuring all necessary configurations are in place. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArmResponseErrorResponse> + beginFinalizeAsync(String serviceGroupName, String operationId, String recoveryPlanName) { + Mono>> mono + = finalizeWithResponseAsync(serviceGroupName, operationId, recoveryPlanName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ArmResponseErrorResponse.class, ArmResponseErrorResponse.class, + this.client.getContext()); + } + + /** + * This action finalizes the recovery orchestration plan, ensuring all necessary configurations are in place. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArmResponseErrorResponse> + beginFinalize(String serviceGroupName, String operationId, String recoveryPlanName) { + Response response = finalizeWithResponse(serviceGroupName, operationId, recoveryPlanName); + return this.client.getLroResult(response, + ArmResponseErrorResponse.class, ArmResponseErrorResponse.class, Context.NONE); + } + + /** + * This action finalizes the recovery orchestration plan, ensuring all necessary configurations are in place. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArmResponseErrorResponse> + beginFinalize(String serviceGroupName, String operationId, String recoveryPlanName, Context context) { + Response response = finalizeWithResponse(serviceGroupName, operationId, recoveryPlanName, context); + return this.client.getLroResult(response, + ArmResponseErrorResponse.class, ArmResponseErrorResponse.class, context); + } + + /** + * This action finalizes the recovery orchestration plan, ensuring all necessary configurations are in place. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono finalizeAsync(String serviceGroupName, String operationId, + String recoveryPlanName) { + return beginFinalizeAsync(serviceGroupName, operationId, recoveryPlanName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action finalizes the recovery orchestration plan, ensuring all necessary configurations are in place. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArmResponseErrorResponse finalize(String serviceGroupName, String operationId, String recoveryPlanName) { + return beginFinalize(serviceGroupName, operationId, recoveryPlanName).getFinalResult(); + } + + /** + * This action finalizes the recovery orchestration plan, ensuring all necessary configurations are in place. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArmResponseErrorResponse finalize(String serviceGroupName, String operationId, String recoveryPlanName, + Context context) { + return beginFinalize(serviceGroupName, operationId, recoveryPlanName, context).getFinalResult(); + } + + /** + * This action adds or updates the resources to be included in the recovery orchestration plan. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recoveryResources post action request to update in batch along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateResourcesWithResponseAsync(String serviceGroupName, + String operationId, String recoveryPlanName, UpdateRecoveryResourcesRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.updateResources(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This action adds or updates the resources to be included in the recovery orchestration plan. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recoveryResources post action request to update in batch along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateResourcesWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, UpdateRecoveryResourcesRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateResourcesSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, recoveryPlanName, contentType, accept, body, Context.NONE); + } + + /** + * This action adds or updates the resources to be included in the recovery orchestration plan. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recoveryResources post action request to update in batch along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateResourcesWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, UpdateRecoveryResourcesRequest body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateResourcesSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, recoveryPlanName, contentType, accept, body, context); + } + + /** + * This action adds or updates the resources to be included in the recovery orchestration plan. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link PollerFlux} for polling of recoveryResources post action request to update in batch. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, UpdateRecoveryResourcesResponseInner> + beginUpdateResourcesAsync(String serviceGroupName, String operationId, String recoveryPlanName, + UpdateRecoveryResourcesRequest body) { + Mono>> mono + = updateResourcesWithResponseAsync(serviceGroupName, operationId, recoveryPlanName, body); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), UpdateRecoveryResourcesResponseInner.class, + UpdateRecoveryResourcesResponseInner.class, this.client.getContext()); + } + + /** + * This action adds or updates the resources to be included in the recovery orchestration plan. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of recoveryResources post action request to update in batch. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, UpdateRecoveryResourcesResponseInner> + beginUpdateResources(String serviceGroupName, String operationId, String recoveryPlanName, + UpdateRecoveryResourcesRequest body) { + Response response + = updateResourcesWithResponse(serviceGroupName, operationId, recoveryPlanName, body); + return this.client.getLroResult( + response, UpdateRecoveryResourcesResponseInner.class, UpdateRecoveryResourcesResponseInner.class, + Context.NONE); + } + + /** + * This action adds or updates the resources to be included in the recovery orchestration plan. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of recoveryResources post action request to update in batch. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, UpdateRecoveryResourcesResponseInner> + beginUpdateResources(String serviceGroupName, String operationId, String recoveryPlanName, + UpdateRecoveryResourcesRequest body, Context context) { + Response response + = updateResourcesWithResponse(serviceGroupName, operationId, recoveryPlanName, body, context); + return this.client.getLroResult( + response, UpdateRecoveryResourcesResponseInner.class, UpdateRecoveryResourcesResponseInner.class, context); + } + + /** + * This action adds or updates the resources to be included in the recovery orchestration plan. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recoveryResources post action request to update in batch on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateResourcesAsync(String serviceGroupName, String operationId, + String recoveryPlanName, UpdateRecoveryResourcesRequest body) { + return beginUpdateResourcesAsync(serviceGroupName, operationId, recoveryPlanName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action adds or updates the resources to be included in the recovery orchestration plan. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recoveryResources post action request to update in batch. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateRecoveryResourcesResponseInner updateResources(String serviceGroupName, String operationId, + String recoveryPlanName, UpdateRecoveryResourcesRequest body) { + return beginUpdateResources(serviceGroupName, operationId, recoveryPlanName, body).getFinalResult(); + } + + /** + * This action adds or updates the resources to be included in the recovery orchestration plan. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recoveryResources post action request to update in batch. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateRecoveryResourcesResponseInner updateResources(String serviceGroupName, String operationId, + String recoveryPlanName, UpdateRecoveryResourcesRequest body, Context context) { + return beginUpdateResources(serviceGroupName, operationId, recoveryPlanName, body, context).getFinalResult(); + } + + /** + * This action checks if the recovery orchestration plan is eligible for operations like failover and reprotect, + * ensuring it meets the necessary criteria. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @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>> validateForOperationWithResponseAsync(String serviceGroupName, + String operationId, String recoveryPlanName, ValidateForOperationRequest body) { + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.validateForOperation(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, contentType, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This action checks if the recovery orchestration plan is eligible for operations like failover and reprotect, + * ensuring it meets the necessary criteria. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response validateForOperationWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, ValidateForOperationRequest body) { + final String contentType = "application/json"; + return service.validateForOperationSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, contentType, body, Context.NONE); + } + + /** + * This action checks if the recovery orchestration plan is eligible for operations like failover and reprotect, + * ensuring it meets the necessary criteria. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response validateForOperationWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, ValidateForOperationRequest body, Context context) { + final String contentType = "application/json"; + return service.validateForOperationSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, contentType, body, context); + } + + /** + * This action checks if the recovery orchestration plan is eligible for operations like failover and reprotect, + * ensuring it meets the necessary criteria. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArmResponseErrorResponse> beginValidateForOperationAsync( + String serviceGroupName, String operationId, String recoveryPlanName, ValidateForOperationRequest body) { + Mono>> mono + = validateForOperationWithResponseAsync(serviceGroupName, operationId, recoveryPlanName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ArmResponseErrorResponse.class, ArmResponseErrorResponse.class, + this.client.getContext()); + } + + /** + * This action checks if the recovery orchestration plan is eligible for operations like failover and reprotect, + * ensuring it meets the necessary criteria. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArmResponseErrorResponse> beginValidateForOperation( + String serviceGroupName, String operationId, String recoveryPlanName, ValidateForOperationRequest body) { + Response response + = validateForOperationWithResponse(serviceGroupName, operationId, recoveryPlanName, body); + return this.client.getLroResult(response, + ArmResponseErrorResponse.class, ArmResponseErrorResponse.class, Context.NONE); + } + + /** + * This action checks if the recovery orchestration plan is eligible for operations like failover and reprotect, + * ensuring it meets the necessary criteria. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArmResponseErrorResponse> beginValidateForOperation( + String serviceGroupName, String operationId, String recoveryPlanName, ValidateForOperationRequest body, + Context context) { + Response response + = validateForOperationWithResponse(serviceGroupName, operationId, recoveryPlanName, body, context); + return this.client.getLroResult(response, + ArmResponseErrorResponse.class, ArmResponseErrorResponse.class, context); + } + + /** + * This action checks if the recovery orchestration plan is eligible for operations like failover and reprotect, + * ensuring it meets the necessary criteria. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateForOperationAsync(String serviceGroupName, String operationId, + String recoveryPlanName, ValidateForOperationRequest body) { + return beginValidateForOperationAsync(serviceGroupName, operationId, recoveryPlanName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action checks if the recovery orchestration plan is eligible for operations like failover and reprotect, + * ensuring it meets the necessary criteria. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArmResponseErrorResponse validateForOperation(String serviceGroupName, String operationId, + String recoveryPlanName, ValidateForOperationRequest body) { + return beginValidateForOperation(serviceGroupName, operationId, recoveryPlanName, body).getFinalResult(); + } + + /** + * This action checks if the recovery orchestration plan is eligible for operations like failover and reprotect, + * ensuring it meets the necessary criteria. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 ManagementException thrown if the request is rejected by server on status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArmResponseErrorResponse validateForOperation(String serviceGroupName, String operationId, + String recoveryPlanName, ValidateForOperationRequest body, Context context) { + return beginValidateForOperation(serviceGroupName, operationId, recoveryPlanName, body, context) + .getFinalResult(); + } + + /** + * This action checks if the recovery orchestration plan is eligible for failover operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateForFailoverWithResponseAsync(String serviceGroupName, + String operationId, String recoveryPlanName, FailoverRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.validateForFailover(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This action checks if the recovery orchestration plan is eligible for failover operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response validateForFailoverWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.validateForFailoverSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, recoveryPlanName, contentType, accept, body, Context.NONE); + } + + /** + * This action checks if the recovery orchestration plan is eligible for failover operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response validateForFailoverWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.validateForFailoverSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, recoveryPlanName, contentType, accept, body, context); + } + + /** + * This action checks if the recovery orchestration plan is eligible for failover operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link PollerFlux} for polling of validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForFailoverAsync(String serviceGroupName, String operationId, String recoveryPlanName, + FailoverRequest body) { + Mono>> mono + = validateForFailoverWithResponseAsync(serviceGroupName, operationId, recoveryPlanName, body); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), ValidateForRecoveryOperationBaseResponseInner.class, + ValidateForRecoveryOperationBaseResponseInner.class, this.client.getContext()); + } + + /** + * This action checks if the recovery orchestration plan is eligible for failover operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForFailover(String serviceGroupName, String operationId, String recoveryPlanName, + FailoverRequest body) { + Response response + = validateForFailoverWithResponse(serviceGroupName, operationId, recoveryPlanName, body); + return this.client + .getLroResult( + response, ValidateForRecoveryOperationBaseResponseInner.class, + ValidateForRecoveryOperationBaseResponseInner.class, Context.NONE); + } + + /** + * This action checks if the recovery orchestration plan is eligible for failover operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForFailover(String serviceGroupName, String operationId, String recoveryPlanName, + FailoverRequest body, Context context) { + Response response + = validateForFailoverWithResponse(serviceGroupName, operationId, recoveryPlanName, body, context); + return this.client + .getLroResult( + response, ValidateForRecoveryOperationBaseResponseInner.class, + ValidateForRecoveryOperationBaseResponseInner.class, context); + } + + /** + * This action checks if the recovery orchestration plan is eligible for failover operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateForFailoverAsync(String serviceGroupName, + String operationId, String recoveryPlanName, FailoverRequest body) { + return beginValidateForFailoverAsync(serviceGroupName, operationId, recoveryPlanName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action checks if the recovery orchestration plan is eligible for failover operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateForRecoveryOperationBaseResponseInner validateForFailover(String serviceGroupName, + String operationId, String recoveryPlanName, FailoverRequest body) { + return beginValidateForFailover(serviceGroupName, operationId, recoveryPlanName, body).getFinalResult(); + } + + /** + * This action checks if the recovery orchestration plan is eligible for failover operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateForRecoveryOperationBaseResponseInner validateForFailover(String serviceGroupName, + String operationId, String recoveryPlanName, FailoverRequest body, Context context) { + return beginValidateForFailover(serviceGroupName, operationId, recoveryPlanName, body, context) + .getFinalResult(); + } + + /** + * This action checks if the recovery orchestration plan is eligible for failover commit operation, ensuring it + * meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateForFailoverCommitWithResponseAsync(String serviceGroupName, + String operationId, String recoveryPlanName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.validateForFailoverCommit(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This action checks if the recovery orchestration plan is eligible for failover commit operation, ensuring it + * meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response validateForFailoverCommitWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName) { + final String accept = "application/json"; + return service.validateForFailoverCommitSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, accept, Context.NONE); + } + + /** + * This action checks if the recovery orchestration plan is eligible for failover commit operation, ensuring it + * meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response validateForFailoverCommitWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, Context context) { + final String accept = "application/json"; + return service.validateForFailoverCommitSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, accept, context); + } + + /** + * This action checks if the recovery orchestration plan is eligible for failover commit operation, ensuring it + * meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForFailoverCommitAsync(String serviceGroupName, String operationId, String recoveryPlanName) { + Mono>> mono + = validateForFailoverCommitWithResponseAsync(serviceGroupName, operationId, recoveryPlanName); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), ValidateForRecoveryOperationBaseResponseInner.class, + ValidateForRecoveryOperationBaseResponseInner.class, this.client.getContext()); + } + + /** + * This action checks if the recovery orchestration plan is eligible for failover commit operation, ensuring it + * meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForFailoverCommit(String serviceGroupName, String operationId, String recoveryPlanName) { + Response response + = validateForFailoverCommitWithResponse(serviceGroupName, operationId, recoveryPlanName); + return this.client + .getLroResult( + response, ValidateForRecoveryOperationBaseResponseInner.class, + ValidateForRecoveryOperationBaseResponseInner.class, Context.NONE); + } + + /** + * This action checks if the recovery orchestration plan is eligible for failover commit operation, ensuring it + * meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForFailoverCommit(String serviceGroupName, String operationId, String recoveryPlanName, + Context context) { + Response response + = validateForFailoverCommitWithResponse(serviceGroupName, operationId, recoveryPlanName, context); + return this.client + .getLroResult( + response, ValidateForRecoveryOperationBaseResponseInner.class, + ValidateForRecoveryOperationBaseResponseInner.class, context); + } + + /** + * This action checks if the recovery orchestration plan is eligible for failover commit operation, ensuring it + * meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateForFailoverCommitAsync(String serviceGroupName, + String operationId, String recoveryPlanName) { + return beginValidateForFailoverCommitAsync(serviceGroupName, operationId, recoveryPlanName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action checks if the recovery orchestration plan is eligible for failover commit operation, ensuring it + * meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateForRecoveryOperationBaseResponseInner validateForFailoverCommit(String serviceGroupName, + String operationId, String recoveryPlanName) { + return beginValidateForFailoverCommit(serviceGroupName, operationId, recoveryPlanName).getFinalResult(); + } + + /** + * This action checks if the recovery orchestration plan is eligible for failover commit operation, ensuring it + * meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateForRecoveryOperationBaseResponseInner validateForFailoverCommit(String serviceGroupName, + String operationId, String recoveryPlanName, Context context) { + return beginValidateForFailoverCommit(serviceGroupName, operationId, recoveryPlanName, context) + .getFinalResult(); + } + + /** + * This action checks if the recovery orchestration plan is eligible for test failover operation, ensuring it meets + * the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateForTestFailoverWithResponseAsync(String serviceGroupName, + String operationId, String recoveryPlanName, FailoverRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.validateForTestFailover(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This action checks if the recovery orchestration plan is eligible for test failover operation, ensuring it meets + * the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response validateForTestFailoverWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.validateForTestFailoverSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, contentType, accept, body, Context.NONE); + } + + /** + * This action checks if the recovery orchestration plan is eligible for test failover operation, ensuring it meets + * the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response validateForTestFailoverWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.validateForTestFailoverSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, contentType, accept, body, context); + } + + /** + * This action checks if the recovery orchestration plan is eligible for test failover operation, ensuring it meets + * the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link PollerFlux} for polling of validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForTestFailoverAsync(String serviceGroupName, String operationId, String recoveryPlanName, + FailoverRequest body) { + Mono>> mono + = validateForTestFailoverWithResponseAsync(serviceGroupName, operationId, recoveryPlanName, body); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), ValidateForRecoveryOperationBaseResponseInner.class, + ValidateForRecoveryOperationBaseResponseInner.class, this.client.getContext()); + } + + /** + * This action checks if the recovery orchestration plan is eligible for test failover operation, ensuring it meets + * the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForTestFailover(String serviceGroupName, String operationId, String recoveryPlanName, + FailoverRequest body) { + Response response + = validateForTestFailoverWithResponse(serviceGroupName, operationId, recoveryPlanName, body); + return this.client + .getLroResult( + response, ValidateForRecoveryOperationBaseResponseInner.class, + ValidateForRecoveryOperationBaseResponseInner.class, Context.NONE); + } + + /** + * This action checks if the recovery orchestration plan is eligible for test failover operation, ensuring it meets + * the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForTestFailover(String serviceGroupName, String operationId, String recoveryPlanName, + FailoverRequest body, Context context) { + Response response + = validateForTestFailoverWithResponse(serviceGroupName, operationId, recoveryPlanName, body, context); + return this.client + .getLroResult( + response, ValidateForRecoveryOperationBaseResponseInner.class, + ValidateForRecoveryOperationBaseResponseInner.class, context); + } + + /** + * This action checks if the recovery orchestration plan is eligible for test failover operation, ensuring it meets + * the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateForTestFailoverAsync(String serviceGroupName, + String operationId, String recoveryPlanName, FailoverRequest body) { + return beginValidateForTestFailoverAsync(serviceGroupName, operationId, recoveryPlanName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action checks if the recovery orchestration plan is eligible for test failover operation, ensuring it meets + * the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateForRecoveryOperationBaseResponseInner validateForTestFailover(String serviceGroupName, + String operationId, String recoveryPlanName, FailoverRequest body) { + return beginValidateForTestFailover(serviceGroupName, operationId, recoveryPlanName, body).getFinalResult(); + } + + /** + * This action checks if the recovery orchestration plan is eligible for test failover operation, ensuring it meets + * the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateForRecoveryOperationBaseResponseInner validateForTestFailover(String serviceGroupName, + String operationId, String recoveryPlanName, FailoverRequest body, Context context) { + return beginValidateForTestFailover(serviceGroupName, operationId, recoveryPlanName, body, context) + .getFinalResult(); + } + + /** + * This action checks if the recovery orchestration plan is eligible for test failover cleanup operation, ensuring + * it meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateForTestFailoverCleanupWithResponseAsync(String serviceGroupName, + String operationId, String recoveryPlanName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.validateForTestFailoverCleanup(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This action checks if the recovery orchestration plan is eligible for test failover cleanup operation, ensuring + * it meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response validateForTestFailoverCleanupWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName) { + final String accept = "application/json"; + return service.validateForTestFailoverCleanupSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, accept, Context.NONE); + } + + /** + * This action checks if the recovery orchestration plan is eligible for test failover cleanup operation, ensuring + * it meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response validateForTestFailoverCleanupWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, Context context) { + final String accept = "application/json"; + return service.validateForTestFailoverCleanupSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, accept, context); + } + + /** + * This action checks if the recovery orchestration plan is eligible for test failover cleanup operation, ensuring + * it meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForTestFailoverCleanupAsync(String serviceGroupName, String operationId, String recoveryPlanName) { + Mono>> mono + = validateForTestFailoverCleanupWithResponseAsync(serviceGroupName, operationId, recoveryPlanName); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), ValidateForRecoveryOperationBaseResponseInner.class, + ValidateForRecoveryOperationBaseResponseInner.class, this.client.getContext()); + } + + /** + * This action checks if the recovery orchestration plan is eligible for test failover cleanup operation, ensuring + * it meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForTestFailoverCleanup(String serviceGroupName, String operationId, String recoveryPlanName) { + Response response + = validateForTestFailoverCleanupWithResponse(serviceGroupName, operationId, recoveryPlanName); + return this.client + .getLroResult( + response, ValidateForRecoveryOperationBaseResponseInner.class, + ValidateForRecoveryOperationBaseResponseInner.class, Context.NONE); + } + + /** + * This action checks if the recovery orchestration plan is eligible for test failover cleanup operation, ensuring + * it meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForTestFailoverCleanup(String serviceGroupName, String operationId, String recoveryPlanName, + Context context) { + Response response + = validateForTestFailoverCleanupWithResponse(serviceGroupName, operationId, recoveryPlanName, context); + return this.client + .getLroResult( + response, ValidateForRecoveryOperationBaseResponseInner.class, + ValidateForRecoveryOperationBaseResponseInner.class, context); + } + + /** + * This action checks if the recovery orchestration plan is eligible for test failover cleanup operation, ensuring + * it meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono + validateForTestFailoverCleanupAsync(String serviceGroupName, String operationId, String recoveryPlanName) { + return beginValidateForTestFailoverCleanupAsync(serviceGroupName, operationId, recoveryPlanName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action checks if the recovery orchestration plan is eligible for test failover cleanup operation, ensuring + * it meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateForRecoveryOperationBaseResponseInner validateForTestFailoverCleanup(String serviceGroupName, + String operationId, String recoveryPlanName) { + return beginValidateForTestFailoverCleanup(serviceGroupName, operationId, recoveryPlanName).getFinalResult(); + } + + /** + * This action checks if the recovery orchestration plan is eligible for test failover cleanup operation, ensuring + * it meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateForRecoveryOperationBaseResponseInner validateForTestFailoverCleanup(String serviceGroupName, + String operationId, String recoveryPlanName, Context context) { + return beginValidateForTestFailoverCleanup(serviceGroupName, operationId, recoveryPlanName, context) + .getFinalResult(); + } + + /** + * This action checks if the recovery orchestration plan is eligible for reprotect operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateForReprotectWithResponseAsync(String serviceGroupName, + String operationId, String recoveryPlanName, ReprotectRequest body) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.validateForReprotect(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This action checks if the recovery orchestration plan is eligible for reprotect operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response validateForReprotectWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, ReprotectRequest body) { + final String accept = "application/json"; + return service.validateForReprotectSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, accept, body, Context.NONE); + } + + /** + * This action checks if the recovery orchestration plan is eligible for reprotect operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response validateForReprotectWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, ReprotectRequest body, Context context) { + final String accept = "application/json"; + return service.validateForReprotectSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, accept, body, context); + } + + /** + * This action checks if the recovery orchestration plan is eligible for reprotect operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link PollerFlux} for polling of validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForReprotectAsync(String serviceGroupName, String operationId, String recoveryPlanName, + ReprotectRequest body) { + Mono>> mono + = validateForReprotectWithResponseAsync(serviceGroupName, operationId, recoveryPlanName, body); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), ValidateForRecoveryOperationBaseResponseInner.class, + ValidateForRecoveryOperationBaseResponseInner.class, this.client.getContext()); + } + + /** + * This action checks if the recovery orchestration plan is eligible for reprotect operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForReprotectAsync(String serviceGroupName, String operationId, String recoveryPlanName) { + final ReprotectRequest body = null; + Mono>> mono + = validateForReprotectWithResponseAsync(serviceGroupName, operationId, recoveryPlanName, body); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), ValidateForRecoveryOperationBaseResponseInner.class, + ValidateForRecoveryOperationBaseResponseInner.class, this.client.getContext()); + } + + /** + * This action checks if the recovery orchestration plan is eligible for reprotect operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForReprotect(String serviceGroupName, String operationId, String recoveryPlanName, + ReprotectRequest body) { + Response response + = validateForReprotectWithResponse(serviceGroupName, operationId, recoveryPlanName, body); + return this.client + .getLroResult( + response, ValidateForRecoveryOperationBaseResponseInner.class, + ValidateForRecoveryOperationBaseResponseInner.class, Context.NONE); + } + + /** + * This action checks if the recovery orchestration plan is eligible for reprotect operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForReprotect(String serviceGroupName, String operationId, String recoveryPlanName) { + final ReprotectRequest body = null; + Response response + = validateForReprotectWithResponse(serviceGroupName, operationId, recoveryPlanName, body); + return this.client + .getLroResult( + response, ValidateForRecoveryOperationBaseResponseInner.class, + ValidateForRecoveryOperationBaseResponseInner.class, Context.NONE); + } + + /** + * This action checks if the recovery orchestration plan is eligible for reprotect operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ValidateForRecoveryOperationBaseResponseInner> + beginValidateForReprotect(String serviceGroupName, String operationId, String recoveryPlanName, + ReprotectRequest body, Context context) { + Response response + = validateForReprotectWithResponse(serviceGroupName, operationId, recoveryPlanName, body, context); + return this.client + .getLroResult( + response, ValidateForRecoveryOperationBaseResponseInner.class, + ValidateForRecoveryOperationBaseResponseInner.class, context); + } + + /** + * This action checks if the recovery orchestration plan is eligible for reprotect operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateForReprotectAsync(String serviceGroupName, + String operationId, String recoveryPlanName, ReprotectRequest body) { + return beginValidateForReprotectAsync(serviceGroupName, operationId, recoveryPlanName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action checks if the recovery orchestration plan is eligible for reprotect operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateForReprotectAsync(String serviceGroupName, + String operationId, String recoveryPlanName) { + final ReprotectRequest body = null; + return beginValidateForReprotectAsync(serviceGroupName, operationId, recoveryPlanName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action checks if the recovery orchestration plan is eligible for reprotect operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateForRecoveryOperationBaseResponseInner validateForReprotect(String serviceGroupName, + String operationId, String recoveryPlanName) { + final ReprotectRequest body = null; + return beginValidateForReprotect(serviceGroupName, operationId, recoveryPlanName, body).getFinalResult(); + } + + /** + * This action checks if the recovery orchestration plan is eligible for reprotect operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateForRecoveryOperationBaseResponseInner validateForReprotect(String serviceGroupName, + String operationId, String recoveryPlanName, ReprotectRequest body, Context context) { + return beginValidateForReprotect(serviceGroupName, operationId, recoveryPlanName, body, context) + .getFinalResult(); + } + + /** + * This action performs the necessary readiness check on the recovery orchestration plan to ensure it is in the + * desired state and eligible for all recovery actions, including all protected resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recovery Orchestration Plan post action response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> checkReadinessWithResponseAsync(String serviceGroupName, + String operationId, String recoveryPlanName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.checkReadiness(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This action performs the necessary readiness check on the recovery orchestration plan to ensure it is in the + * desired state and eligible for all recovery actions, including all protected resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recovery Orchestration Plan post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response checkReadinessWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName) { + final String accept = "application/json"; + return service.checkReadinessSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, recoveryPlanName, accept, Context.NONE); + } + + /** + * This action performs the necessary readiness check on the recovery orchestration plan to ensure it is in the + * desired state and eligible for all recovery actions, including all protected resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recovery Orchestration Plan post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response checkReadinessWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, Context context) { + final String accept = "application/json"; + return service.checkReadinessSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, recoveryPlanName, accept, context); + } + + /** + * This action performs the necessary readiness check on the recovery orchestration plan to ensure it is in the + * desired state and eligible for all recovery actions, including all protected resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCheckReadinessAsync(String serviceGroupName, String operationId, + String recoveryPlanName) { + Mono>> mono + = checkReadinessWithResponseAsync(serviceGroupName, operationId, recoveryPlanName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * This action performs the necessary readiness check on the recovery orchestration plan to ensure it is in the + * desired state and eligible for all recovery actions, including all protected resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCheckReadiness(String serviceGroupName, String operationId, + String recoveryPlanName) { + Response response = checkReadinessWithResponse(serviceGroupName, operationId, recoveryPlanName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * This action performs the necessary readiness check on the recovery orchestration plan to ensure it is in the + * desired state and eligible for all recovery actions, including all protected resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCheckReadiness(String serviceGroupName, String operationId, + String recoveryPlanName, Context context) { + Response response + = checkReadinessWithResponse(serviceGroupName, operationId, recoveryPlanName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * This action performs the necessary readiness check on the recovery orchestration plan to ensure it is in the + * desired state and eligible for all recovery actions, including all protected resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recovery Orchestration Plan post action response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkReadinessAsync(String serviceGroupName, String operationId, String recoveryPlanName) { + return beginCheckReadinessAsync(serviceGroupName, operationId, recoveryPlanName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action performs the necessary readiness check on the recovery orchestration plan to ensure it is in the + * desired state and eligible for all recovery actions, including all protected resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 checkReadiness(String serviceGroupName, String operationId, String recoveryPlanName) { + beginCheckReadiness(serviceGroupName, operationId, recoveryPlanName).getFinalResult(); + } + + /** + * This action performs the necessary readiness check on the recovery orchestration plan to ensure it is in the + * desired state and eligible for all recovery actions, including all protected resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 checkReadiness(String serviceGroupName, String operationId, String recoveryPlanName, Context context) { + beginCheckReadiness(serviceGroupName, operationId, recoveryPlanName, context).getFinalResult(); + } + + /** + * This action triggers the failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failoverWithResponseAsync(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.failover(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This action triggers the failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response failoverWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.failoverSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, recoveryPlanName, contentType, accept, body, Context.NONE); + } + + /** + * This action triggers the failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response failoverWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.failoverSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, recoveryPlanName, contentType, accept, body, context); + } + + /** + * This action triggers the failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link PollerFlux} for polling of recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanActionBaseResponseInner> + beginFailoverAsync(String serviceGroupName, String operationId, String recoveryPlanName, FailoverRequest body) { + Mono>> mono + = failoverWithResponseAsync(serviceGroupName, operationId, recoveryPlanName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RecoveryPlanActionBaseResponseInner.class, + RecoveryPlanActionBaseResponseInner.class, this.client.getContext()); + } + + /** + * This action triggers the failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanActionBaseResponseInner> + beginFailover(String serviceGroupName, String operationId, String recoveryPlanName, FailoverRequest body) { + Response response = failoverWithResponse(serviceGroupName, operationId, recoveryPlanName, body); + return this.client.getLroResult( + response, RecoveryPlanActionBaseResponseInner.class, RecoveryPlanActionBaseResponseInner.class, + Context.NONE); + } + + /** + * This action triggers the failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanActionBaseResponseInner> + beginFailover(String serviceGroupName, String operationId, String recoveryPlanName, FailoverRequest body, + Context context) { + Response response + = failoverWithResponse(serviceGroupName, operationId, recoveryPlanName, body, context); + return this.client.getLroResult( + response, RecoveryPlanActionBaseResponseInner.class, RecoveryPlanActionBaseResponseInner.class, context); + } + + /** + * This action triggers the failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failoverAsync(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body) { + return beginFailoverAsync(serviceGroupName, operationId, recoveryPlanName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action triggers the failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanActionBaseResponseInner failover(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body) { + return beginFailover(serviceGroupName, operationId, recoveryPlanName, body).getFinalResult(); + } + + /** + * This action triggers the failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanActionBaseResponseInner failover(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body, Context context) { + return beginFailover(serviceGroupName, operationId, recoveryPlanName, body, context).getFinalResult(); + } + + /** + * This action triggers the failover commit operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recovery Orchestration Plan post action response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failoverCommitWithResponseAsync(String serviceGroupName, + String operationId, String recoveryPlanName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.failoverCommit(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This action triggers the failover commit operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recovery Orchestration Plan post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response failoverCommitWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName) { + final String accept = "application/json"; + return service.failoverCommitSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, recoveryPlanName, accept, Context.NONE); + } + + /** + * This action triggers the failover commit operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recovery Orchestration Plan post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response failoverCommitWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, Context context) { + final String accept = "application/json"; + return service.failoverCommitSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, recoveryPlanName, accept, context); + } + + /** + * This action triggers the failover commit operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanActionBaseResponseInner> + beginFailoverCommitAsync(String serviceGroupName, String operationId, String recoveryPlanName) { + Mono>> mono + = failoverCommitWithResponseAsync(serviceGroupName, operationId, recoveryPlanName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RecoveryPlanActionBaseResponseInner.class, + RecoveryPlanActionBaseResponseInner.class, this.client.getContext()); + } + + /** + * This action triggers the failover commit operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanActionBaseResponseInner> + beginFailoverCommit(String serviceGroupName, String operationId, String recoveryPlanName) { + Response response = failoverCommitWithResponse(serviceGroupName, operationId, recoveryPlanName); + return this.client.getLroResult( + response, RecoveryPlanActionBaseResponseInner.class, RecoveryPlanActionBaseResponseInner.class, + Context.NONE); + } + + /** + * This action triggers the failover commit operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanActionBaseResponseInner> + beginFailoverCommit(String serviceGroupName, String operationId, String recoveryPlanName, Context context) { + Response response + = failoverCommitWithResponse(serviceGroupName, operationId, recoveryPlanName, context); + return this.client.getLroResult( + response, RecoveryPlanActionBaseResponseInner.class, RecoveryPlanActionBaseResponseInner.class, context); + } + + /** + * This action triggers the failover commit operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recovery Orchestration Plan post action response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failoverCommitAsync(String serviceGroupName, String operationId, + String recoveryPlanName) { + return beginFailoverCommitAsync(serviceGroupName, operationId, recoveryPlanName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action triggers the failover commit operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanActionBaseResponseInner failoverCommit(String serviceGroupName, String operationId, + String recoveryPlanName) { + return beginFailoverCommit(serviceGroupName, operationId, recoveryPlanName).getFinalResult(); + } + + /** + * This action triggers the failover commit operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanActionBaseResponseInner failoverCommit(String serviceGroupName, String operationId, + String recoveryPlanName, Context context) { + return beginFailoverCommit(serviceGroupName, operationId, recoveryPlanName, context).getFinalResult(); + } + + /** + * This action triggers the reprotect operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reprotectWithResponseAsync(String serviceGroupName, String operationId, + String recoveryPlanName, ReprotectRequest body) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.reprotect(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This action triggers the reprotect operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response reprotectWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, ReprotectRequest body) { + final String accept = "application/json"; + return service.reprotectSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, recoveryPlanName, accept, body, Context.NONE); + } + + /** + * This action triggers the reprotect operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response reprotectWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, ReprotectRequest body, Context context) { + final String accept = "application/json"; + return service.reprotectSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, recoveryPlanName, accept, body, context); + } + + /** + * This action triggers the reprotect operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link PollerFlux} for polling of recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanActionBaseResponseInner> + beginReprotectAsync(String serviceGroupName, String operationId, String recoveryPlanName, + ReprotectRequest body) { + Mono>> mono + = reprotectWithResponseAsync(serviceGroupName, operationId, recoveryPlanName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RecoveryPlanActionBaseResponseInner.class, + RecoveryPlanActionBaseResponseInner.class, this.client.getContext()); + } + + /** + * This action triggers the reprotect operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanActionBaseResponseInner> + beginReprotectAsync(String serviceGroupName, String operationId, String recoveryPlanName) { + final ReprotectRequest body = null; + Mono>> mono + = reprotectWithResponseAsync(serviceGroupName, operationId, recoveryPlanName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RecoveryPlanActionBaseResponseInner.class, + RecoveryPlanActionBaseResponseInner.class, this.client.getContext()); + } + + /** + * This action triggers the reprotect operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanActionBaseResponseInner> + beginReprotect(String serviceGroupName, String operationId, String recoveryPlanName, ReprotectRequest body) { + Response response = reprotectWithResponse(serviceGroupName, operationId, recoveryPlanName, body); + return this.client.getLroResult( + response, RecoveryPlanActionBaseResponseInner.class, RecoveryPlanActionBaseResponseInner.class, + Context.NONE); + } + + /** + * This action triggers the reprotect operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanActionBaseResponseInner> + beginReprotect(String serviceGroupName, String operationId, String recoveryPlanName) { + final ReprotectRequest body = null; + Response response = reprotectWithResponse(serviceGroupName, operationId, recoveryPlanName, body); + return this.client.getLroResult( + response, RecoveryPlanActionBaseResponseInner.class, RecoveryPlanActionBaseResponseInner.class, + Context.NONE); + } + + /** + * This action triggers the reprotect operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanActionBaseResponseInner> + beginReprotect(String serviceGroupName, String operationId, String recoveryPlanName, ReprotectRequest body, + Context context) { + Response response + = reprotectWithResponse(serviceGroupName, operationId, recoveryPlanName, body, context); + return this.client.getLroResult( + response, RecoveryPlanActionBaseResponseInner.class, RecoveryPlanActionBaseResponseInner.class, context); + } + + /** + * This action triggers the reprotect operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reprotectAsync(String serviceGroupName, String operationId, + String recoveryPlanName, ReprotectRequest body) { + return beginReprotectAsync(serviceGroupName, operationId, recoveryPlanName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action triggers the reprotect operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recovery Orchestration Plan post action response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reprotectAsync(String serviceGroupName, String operationId, + String recoveryPlanName) { + final ReprotectRequest body = null; + return beginReprotectAsync(serviceGroupName, operationId, recoveryPlanName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action triggers the reprotect operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanActionBaseResponseInner reprotect(String serviceGroupName, String operationId, + String recoveryPlanName) { + final ReprotectRequest body = null; + return beginReprotect(serviceGroupName, operationId, recoveryPlanName, body).getFinalResult(); + } + + /** + * This action triggers the reprotect operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanActionBaseResponseInner reprotect(String serviceGroupName, String operationId, + String recoveryPlanName, ReprotectRequest body, Context context) { + return beginReprotect(serviceGroupName, operationId, recoveryPlanName, body, context).getFinalResult(); + } + + /** + * This action triggers the test failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> testFailoverWithResponseAsync(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.testFailover(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This action triggers the test failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response testFailoverWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.testFailoverSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, recoveryPlanName, contentType, accept, body, Context.NONE); + } + + /** + * This action triggers the test failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response testFailoverWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.testFailoverSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, recoveryPlanName, contentType, accept, body, context); + } + + /** + * This action triggers the test failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link PollerFlux} for polling of recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanActionBaseResponseInner> + beginTestFailoverAsync(String serviceGroupName, String operationId, String recoveryPlanName, + FailoverRequest body) { + Mono>> mono + = testFailoverWithResponseAsync(serviceGroupName, operationId, recoveryPlanName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RecoveryPlanActionBaseResponseInner.class, + RecoveryPlanActionBaseResponseInner.class, this.client.getContext()); + } + + /** + * This action triggers the test failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanActionBaseResponseInner> + beginTestFailover(String serviceGroupName, String operationId, String recoveryPlanName, FailoverRequest body) { + Response response = testFailoverWithResponse(serviceGroupName, operationId, recoveryPlanName, body); + return this.client.getLroResult( + response, RecoveryPlanActionBaseResponseInner.class, RecoveryPlanActionBaseResponseInner.class, + Context.NONE); + } + + /** + * This action triggers the test failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanActionBaseResponseInner> + beginTestFailover(String serviceGroupName, String operationId, String recoveryPlanName, FailoverRequest body, + Context context) { + Response response + = testFailoverWithResponse(serviceGroupName, operationId, recoveryPlanName, body, context); + return this.client.getLroResult( + response, RecoveryPlanActionBaseResponseInner.class, RecoveryPlanActionBaseResponseInner.class, context); + } + + /** + * This action triggers the test failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono testFailoverAsync(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body) { + return beginTestFailoverAsync(serviceGroupName, operationId, recoveryPlanName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action triggers the test failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanActionBaseResponseInner testFailover(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body) { + return beginTestFailover(serviceGroupName, operationId, recoveryPlanName, body).getFinalResult(); + } + + /** + * This action triggers the test failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanActionBaseResponseInner testFailover(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body, Context context) { + return beginTestFailover(serviceGroupName, operationId, recoveryPlanName, body, context).getFinalResult(); + } + + /** + * This action triggers the test failover cleanup operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> testFailoverCleanupWithResponseAsync(String serviceGroupName, + String operationId, String recoveryPlanName, TestFailoverCleanupRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.testFailoverCleanup(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), operationId, recoveryPlanName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This action triggers the test failover cleanup operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response testFailoverCleanupWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, TestFailoverCleanupRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.testFailoverCleanupSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, recoveryPlanName, contentType, accept, body, Context.NONE); + } + + /** + * This action triggers the test failover cleanup operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response testFailoverCleanupWithResponse(String serviceGroupName, String operationId, + String recoveryPlanName, TestFailoverCleanupRequest body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.testFailoverCleanupSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + operationId, recoveryPlanName, contentType, accept, body, context); + } + + /** + * This action triggers the test failover cleanup operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link PollerFlux} for polling of recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanActionBaseResponseInner> + beginTestFailoverCleanupAsync(String serviceGroupName, String operationId, String recoveryPlanName, + TestFailoverCleanupRequest body) { + Mono>> mono + = testFailoverCleanupWithResponseAsync(serviceGroupName, operationId, recoveryPlanName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RecoveryPlanActionBaseResponseInner.class, + RecoveryPlanActionBaseResponseInner.class, this.client.getContext()); + } + + /** + * This action triggers the test failover cleanup operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanActionBaseResponseInner> + beginTestFailoverCleanup(String serviceGroupName, String operationId, String recoveryPlanName, + TestFailoverCleanupRequest body) { + Response response + = testFailoverCleanupWithResponse(serviceGroupName, operationId, recoveryPlanName, body); + return this.client.getLroResult( + response, RecoveryPlanActionBaseResponseInner.class, RecoveryPlanActionBaseResponseInner.class, + Context.NONE); + } + + /** + * This action triggers the test failover cleanup operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 the {@link SyncPoller} for polling of recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanActionBaseResponseInner> + beginTestFailoverCleanup(String serviceGroupName, String operationId, String recoveryPlanName, + TestFailoverCleanupRequest body, Context context) { + Response response + = testFailoverCleanupWithResponse(serviceGroupName, operationId, recoveryPlanName, body, context); + return this.client.getLroResult( + response, RecoveryPlanActionBaseResponseInner.class, RecoveryPlanActionBaseResponseInner.class, context); + } + + /** + * This action triggers the test failover cleanup operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono testFailoverCleanupAsync(String serviceGroupName, + String operationId, String recoveryPlanName, TestFailoverCleanupRequest body) { + return beginTestFailoverCleanupAsync(serviceGroupName, operationId, recoveryPlanName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action triggers the test failover cleanup operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanActionBaseResponseInner testFailoverCleanup(String serviceGroupName, String operationId, + String recoveryPlanName, TestFailoverCleanupRequest body) { + return beginTestFailoverCleanup(serviceGroupName, operationId, recoveryPlanName, body).getFinalResult(); + } + + /** + * This action triggers the test failover cleanup operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanActionBaseResponseInner testFailoverCleanup(String serviceGroupName, String operationId, + String recoveryPlanName, TestFailoverCleanupRequest body, Context context) { + return beginTestFailoverCleanup(serviceGroupName, operationId, recoveryPlanName, body, context) + .getFinalResult(); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlanActionsImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlanActionsImpl.java new file mode 100644 index 000000000000..ff668695a72b --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlanActionsImpl.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryPlanActionBaseResponseInner; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.UpdateRecoveryResourcesResponseInner; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.ValidateForRecoveryOperationBaseResponseInner; +import com.azure.resourcemanager.resiliencemanagement.models.ArmResponseErrorResponse; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanActionBaseResponse; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanActions; +import com.azure.resourcemanager.resiliencemanagement.models.ReprotectRequest; +import com.azure.resourcemanager.resiliencemanagement.models.TestFailoverCleanupRequest; +import com.azure.resourcemanager.resiliencemanagement.models.UpdateRecoveryResourcesRequest; +import com.azure.resourcemanager.resiliencemanagement.models.UpdateRecoveryResourcesResponse; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForOperationRequest; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForRecoveryOperationBaseResponse; + +public final class RecoveryPlanActionsImpl implements RecoveryPlanActions { + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPlanActionsImpl.class); + + private final RecoveryPlanActionsClient innerClient; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + public RecoveryPlanActionsImpl(RecoveryPlanActionsClient innerClient, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ArmResponseErrorResponse finalize(String serviceGroupName, String operationId, String recoveryPlanName) { + return this.serviceClient().finalize(serviceGroupName, operationId, recoveryPlanName); + } + + public ArmResponseErrorResponse finalize(String serviceGroupName, String operationId, String recoveryPlanName, + Context context) { + return this.serviceClient().finalize(serviceGroupName, operationId, recoveryPlanName, context); + } + + public UpdateRecoveryResourcesResponse updateResources(String serviceGroupName, String operationId, + String recoveryPlanName, UpdateRecoveryResourcesRequest body) { + UpdateRecoveryResourcesResponseInner inner + = this.serviceClient().updateResources(serviceGroupName, operationId, recoveryPlanName, body); + if (inner != null) { + return new UpdateRecoveryResourcesResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public UpdateRecoveryResourcesResponse updateResources(String serviceGroupName, String operationId, + String recoveryPlanName, UpdateRecoveryResourcesRequest body, Context context) { + UpdateRecoveryResourcesResponseInner inner + = this.serviceClient().updateResources(serviceGroupName, operationId, recoveryPlanName, body, context); + if (inner != null) { + return new UpdateRecoveryResourcesResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ArmResponseErrorResponse validateForOperation(String serviceGroupName, String operationId, + String recoveryPlanName, ValidateForOperationRequest body) { + return this.serviceClient().validateForOperation(serviceGroupName, operationId, recoveryPlanName, body); + } + + public ArmResponseErrorResponse validateForOperation(String serviceGroupName, String operationId, + String recoveryPlanName, ValidateForOperationRequest body, Context context) { + return this.serviceClient() + .validateForOperation(serviceGroupName, operationId, recoveryPlanName, body, context); + } + + public ValidateForRecoveryOperationBaseResponse validateForFailover(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body) { + ValidateForRecoveryOperationBaseResponseInner inner + = this.serviceClient().validateForFailover(serviceGroupName, operationId, recoveryPlanName, body); + if (inner != null) { + return new ValidateForRecoveryOperationBaseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ValidateForRecoveryOperationBaseResponse validateForFailover(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body, Context context) { + ValidateForRecoveryOperationBaseResponseInner inner + = this.serviceClient().validateForFailover(serviceGroupName, operationId, recoveryPlanName, body, context); + if (inner != null) { + return new ValidateForRecoveryOperationBaseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ValidateForRecoveryOperationBaseResponse validateForFailoverCommit(String serviceGroupName, + String operationId, String recoveryPlanName) { + ValidateForRecoveryOperationBaseResponseInner inner + = this.serviceClient().validateForFailoverCommit(serviceGroupName, operationId, recoveryPlanName); + if (inner != null) { + return new ValidateForRecoveryOperationBaseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ValidateForRecoveryOperationBaseResponse validateForFailoverCommit(String serviceGroupName, + String operationId, String recoveryPlanName, Context context) { + ValidateForRecoveryOperationBaseResponseInner inner + = this.serviceClient().validateForFailoverCommit(serviceGroupName, operationId, recoveryPlanName, context); + if (inner != null) { + return new ValidateForRecoveryOperationBaseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ValidateForRecoveryOperationBaseResponse validateForTestFailover(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body) { + ValidateForRecoveryOperationBaseResponseInner inner + = this.serviceClient().validateForTestFailover(serviceGroupName, operationId, recoveryPlanName, body); + if (inner != null) { + return new ValidateForRecoveryOperationBaseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ValidateForRecoveryOperationBaseResponse validateForTestFailover(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body, Context context) { + ValidateForRecoveryOperationBaseResponseInner inner = this.serviceClient() + .validateForTestFailover(serviceGroupName, operationId, recoveryPlanName, body, context); + if (inner != null) { + return new ValidateForRecoveryOperationBaseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ValidateForRecoveryOperationBaseResponse validateForTestFailoverCleanup(String serviceGroupName, + String operationId, String recoveryPlanName) { + ValidateForRecoveryOperationBaseResponseInner inner + = this.serviceClient().validateForTestFailoverCleanup(serviceGroupName, operationId, recoveryPlanName); + if (inner != null) { + return new ValidateForRecoveryOperationBaseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ValidateForRecoveryOperationBaseResponse validateForTestFailoverCleanup(String serviceGroupName, + String operationId, String recoveryPlanName, Context context) { + ValidateForRecoveryOperationBaseResponseInner inner = this.serviceClient() + .validateForTestFailoverCleanup(serviceGroupName, operationId, recoveryPlanName, context); + if (inner != null) { + return new ValidateForRecoveryOperationBaseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ValidateForRecoveryOperationBaseResponse validateForReprotect(String serviceGroupName, String operationId, + String recoveryPlanName) { + ValidateForRecoveryOperationBaseResponseInner inner + = this.serviceClient().validateForReprotect(serviceGroupName, operationId, recoveryPlanName); + if (inner != null) { + return new ValidateForRecoveryOperationBaseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ValidateForRecoveryOperationBaseResponse validateForReprotect(String serviceGroupName, String operationId, + String recoveryPlanName, ReprotectRequest body, Context context) { + ValidateForRecoveryOperationBaseResponseInner inner + = this.serviceClient().validateForReprotect(serviceGroupName, operationId, recoveryPlanName, body, context); + if (inner != null) { + return new ValidateForRecoveryOperationBaseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public void checkReadiness(String serviceGroupName, String operationId, String recoveryPlanName) { + this.serviceClient().checkReadiness(serviceGroupName, operationId, recoveryPlanName); + } + + public void checkReadiness(String serviceGroupName, String operationId, String recoveryPlanName, Context context) { + this.serviceClient().checkReadiness(serviceGroupName, operationId, recoveryPlanName, context); + } + + public RecoveryPlanActionBaseResponse failover(String serviceGroupName, String operationId, String recoveryPlanName, + FailoverRequest body) { + RecoveryPlanActionBaseResponseInner inner + = this.serviceClient().failover(serviceGroupName, operationId, recoveryPlanName, body); + if (inner != null) { + return new RecoveryPlanActionBaseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlanActionBaseResponse failover(String serviceGroupName, String operationId, String recoveryPlanName, + FailoverRequest body, Context context) { + RecoveryPlanActionBaseResponseInner inner + = this.serviceClient().failover(serviceGroupName, operationId, recoveryPlanName, body, context); + if (inner != null) { + return new RecoveryPlanActionBaseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlanActionBaseResponse failoverCommit(String serviceGroupName, String operationId, + String recoveryPlanName) { + RecoveryPlanActionBaseResponseInner inner + = this.serviceClient().failoverCommit(serviceGroupName, operationId, recoveryPlanName); + if (inner != null) { + return new RecoveryPlanActionBaseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlanActionBaseResponse failoverCommit(String serviceGroupName, String operationId, + String recoveryPlanName, Context context) { + RecoveryPlanActionBaseResponseInner inner + = this.serviceClient().failoverCommit(serviceGroupName, operationId, recoveryPlanName, context); + if (inner != null) { + return new RecoveryPlanActionBaseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlanActionBaseResponse reprotect(String serviceGroupName, String operationId, + String recoveryPlanName) { + RecoveryPlanActionBaseResponseInner inner + = this.serviceClient().reprotect(serviceGroupName, operationId, recoveryPlanName); + if (inner != null) { + return new RecoveryPlanActionBaseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlanActionBaseResponse reprotect(String serviceGroupName, String operationId, + String recoveryPlanName, ReprotectRequest body, Context context) { + RecoveryPlanActionBaseResponseInner inner + = this.serviceClient().reprotect(serviceGroupName, operationId, recoveryPlanName, body, context); + if (inner != null) { + return new RecoveryPlanActionBaseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlanActionBaseResponse testFailover(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body) { + RecoveryPlanActionBaseResponseInner inner + = this.serviceClient().testFailover(serviceGroupName, operationId, recoveryPlanName, body); + if (inner != null) { + return new RecoveryPlanActionBaseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlanActionBaseResponse testFailover(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body, Context context) { + RecoveryPlanActionBaseResponseInner inner + = this.serviceClient().testFailover(serviceGroupName, operationId, recoveryPlanName, body, context); + if (inner != null) { + return new RecoveryPlanActionBaseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlanActionBaseResponse testFailoverCleanup(String serviceGroupName, String operationId, + String recoveryPlanName, TestFailoverCleanupRequest body) { + RecoveryPlanActionBaseResponseInner inner + = this.serviceClient().testFailoverCleanup(serviceGroupName, operationId, recoveryPlanName, body); + if (inner != null) { + return new RecoveryPlanActionBaseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlanActionBaseResponse testFailoverCleanup(String serviceGroupName, String operationId, + String recoveryPlanName, TestFailoverCleanupRequest body, Context context) { + RecoveryPlanActionBaseResponseInner inner + = this.serviceClient().testFailoverCleanup(serviceGroupName, operationId, recoveryPlanName, body, context); + if (inner != null) { + return new RecoveryPlanActionBaseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private RecoveryPlanActionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlanImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlanImpl.java new file mode 100644 index 000000000000..88bb9800059d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlanImpl.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryPlanInner; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlan; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanProperties; + +public final class RecoveryPlanImpl implements RecoveryPlan { + private RecoveryPlanInner innerObject; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + RecoveryPlanImpl(RecoveryPlanInner innerObject, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager 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 RecoveryPlanProperties properties() { + return this.innerModel().properties(); + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public RecoveryPlanInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlansClientImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlansClientImpl.java new file mode 100644 index 000000000000..a12d5488dcbf --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlansClientImpl.java @@ -0,0 +1,948 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.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.management.polling.PollResult; +import com.azure.core.util.BinaryData; +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.resiliencemanagement.fluent.RecoveryPlansClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryPlanInner; +import com.azure.resourcemanager.resiliencemanagement.implementation.models.RecoveryPlanListResult; +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 RecoveryPlansClient. + */ +public final class RecoveryPlansClientImpl implements RecoveryPlansClient { + /** + * The proxy service used to perform REST calls. + */ + private final RecoveryPlansService service; + + /** + * The service client containing this operation class. + */ + private final ResilienceManagementManagementClientImpl client; + + /** + * Initializes an instance of RecoveryPlansClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RecoveryPlansClientImpl(ResilienceManagementManagementClientImpl client) { + this.service + = RestProxy.create(RecoveryPlansService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResilienceManagementManagementClientRecoveryPlans to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ResilienceManagementManagementClientRecoveryPlans") + public interface RecoveryPlansService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("recoveryPlanName") String recoveryPlanName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("recoveryPlanName") String recoveryPlanName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("recoveryPlanName") String recoveryPlanName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RecoveryPlanInner resource, + Context context); + + @Put("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("recoveryPlanName") String recoveryPlanName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RecoveryPlanInner resource, + Context context); + + @Patch("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("recoveryPlanName") String recoveryPlanName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RecoveryPlanInner properties, + Context context); + + @Patch("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("recoveryPlanName") String recoveryPlanName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RecoveryPlanInner properties, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("recoveryPlanName") String recoveryPlanName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("recoveryPlanName") String recoveryPlanName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 RecoveryPlan along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String serviceGroupName, String recoveryPlanName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), recoveryPlanName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 RecoveryPlan on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String serviceGroupName, String recoveryPlanName) { + return getWithResponseAsync(serviceGroupName, recoveryPlanName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 RecoveryPlan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String serviceGroupName, String recoveryPlanName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + recoveryPlanName, accept, context); + } + + /** + * Get a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 RecoveryPlan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner get(String serviceGroupName, String recoveryPlanName) { + return getWithResponse(serviceGroupName, recoveryPlanName, Context.NONE).getValue(); + } + + /** + * Create a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String serviceGroupName, + String recoveryPlanName, RecoveryPlanInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), recoveryPlanName, contentType, accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String serviceGroupName, String recoveryPlanName, + RecoveryPlanInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + recoveryPlanName, contentType, accept, resource, Context.NONE); + } + + /** + * Create a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String serviceGroupName, String recoveryPlanName, + RecoveryPlanInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + recoveryPlanName, contentType, accept, resource, context); + } + + /** + * Create a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 represents a recovery orchestration plan resource in the Azure + * Resilience Management provider namespace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanInner> + beginCreateOrUpdateAsync(String serviceGroupName, String recoveryPlanName, RecoveryPlanInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(serviceGroupName, recoveryPlanName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RecoveryPlanInner.class, RecoveryPlanInner.class, this.client.getContext()); + } + + /** + * Create a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 represents a recovery orchestration plan resource in the Azure + * Resilience Management provider namespace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginCreateOrUpdate(String serviceGroupName, + String recoveryPlanName, RecoveryPlanInner resource) { + Response response = createOrUpdateWithResponse(serviceGroupName, recoveryPlanName, resource); + return this.client.getLroResult(response, RecoveryPlanInner.class, + RecoveryPlanInner.class, Context.NONE); + } + + /** + * Create a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 represents a recovery orchestration plan resource in the Azure + * Resilience Management provider namespace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginCreateOrUpdate(String serviceGroupName, + String recoveryPlanName, RecoveryPlanInner resource, Context context) { + Response response + = createOrUpdateWithResponse(serviceGroupName, recoveryPlanName, resource, context); + return this.client.getLroResult(response, RecoveryPlanInner.class, + RecoveryPlanInner.class, context); + } + + /** + * Create a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String serviceGroupName, String recoveryPlanName, + RecoveryPlanInner resource) { + return beginCreateOrUpdateAsync(serviceGroupName, recoveryPlanName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner createOrUpdate(String serviceGroupName, String recoveryPlanName, + RecoveryPlanInner resource) { + return beginCreateOrUpdate(serviceGroupName, recoveryPlanName, resource).getFinalResult(); + } + + /** + * Create a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner createOrUpdate(String serviceGroupName, String recoveryPlanName, + RecoveryPlanInner resource, Context context) { + return beginCreateOrUpdate(serviceGroupName, recoveryPlanName, resource, context).getFinalResult(); + } + + /** + * Update a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String serviceGroupName, String recoveryPlanName, + RecoveryPlanInner properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), recoveryPlanName, contentType, accept, properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String serviceGroupName, String recoveryPlanName, + RecoveryPlanInner properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + recoveryPlanName, contentType, accept, properties, Context.NONE); + } + + /** + * Update a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String serviceGroupName, String recoveryPlanName, + RecoveryPlanInner properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + recoveryPlanName, contentType, accept, properties, context); + } + + /** + * Update a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 represents a recovery orchestration plan resource in the Azure + * Resilience Management provider namespace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanInner> beginUpdateAsync(String serviceGroupName, + String recoveryPlanName, RecoveryPlanInner properties) { + Mono>> mono = updateWithResponseAsync(serviceGroupName, recoveryPlanName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RecoveryPlanInner.class, RecoveryPlanInner.class, this.client.getContext()); + } + + /** + * Update a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 represents a recovery orchestration plan resource in the Azure + * Resilience Management provider namespace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginUpdate(String serviceGroupName, + String recoveryPlanName, RecoveryPlanInner properties) { + Response response = updateWithResponse(serviceGroupName, recoveryPlanName, properties); + return this.client.getLroResult(response, RecoveryPlanInner.class, + RecoveryPlanInner.class, Context.NONE); + } + + /** + * Update a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 represents a recovery orchestration plan resource in the Azure + * Resilience Management provider namespace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginUpdate(String serviceGroupName, + String recoveryPlanName, RecoveryPlanInner properties, Context context) { + Response response = updateWithResponse(serviceGroupName, recoveryPlanName, properties, context); + return this.client.getLroResult(response, RecoveryPlanInner.class, + RecoveryPlanInner.class, context); + } + + /** + * Update a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String serviceGroupName, String recoveryPlanName, + RecoveryPlanInner properties) { + return beginUpdateAsync(serviceGroupName, recoveryPlanName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner update(String serviceGroupName, String recoveryPlanName, RecoveryPlanInner properties) { + return beginUpdate(serviceGroupName, recoveryPlanName, properties).getFinalResult(); + } + + /** + * Update a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner update(String serviceGroupName, String recoveryPlanName, RecoveryPlanInner properties, + Context context) { + return beginUpdate(serviceGroupName, recoveryPlanName, properties, context).getFinalResult(); + } + + /** + * Delete a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceGroupName, String recoveryPlanName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), recoveryPlanName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String serviceGroupName, String recoveryPlanName) { + return service.deleteSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + recoveryPlanName, Context.NONE); + } + + /** + * Delete a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String serviceGroupName, String recoveryPlanName, Context context) { + return service.deleteSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + recoveryPlanName, context); + } + + /** + * Delete a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String serviceGroupName, String recoveryPlanName) { + Mono>> mono = deleteWithResponseAsync(serviceGroupName, recoveryPlanName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String serviceGroupName, String recoveryPlanName) { + Response response = deleteWithResponse(serviceGroupName, recoveryPlanName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String serviceGroupName, String recoveryPlanName, + Context context) { + Response response = deleteWithResponse(serviceGroupName, recoveryPlanName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceGroupName, String recoveryPlanName) { + return beginDeleteAsync(serviceGroupName, recoveryPlanName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceGroupName, String recoveryPlanName) { + beginDelete(serviceGroupName, recoveryPlanName).getFinalResult(); + } + + /** + * Delete a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceGroupName, String recoveryPlanName, Context context) { + beginDelete(serviceGroupName, recoveryPlanName, context).getFinalResult(); + } + + /** + * List RecoveryPlan resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryPlan list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String serviceGroupName, String skipToken, + Integer top) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, 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 RecoveryPlan resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryPlan list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String serviceGroupName, String skipToken, Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(serviceGroupName, skipToken, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List RecoveryPlan resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryPlan list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String serviceGroupName) { + final String skipToken = null; + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(serviceGroupName, skipToken, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List RecoveryPlan resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryPlan list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String skipToken, Integer top) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List RecoveryPlan resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryPlan list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String skipToken, Integer top, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List RecoveryPlan resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryPlan list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName) { + final String skipToken = null; + final Integer top = null; + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, skipToken, top), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List RecoveryPlan resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryPlan list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName, String skipToken, Integer top, + Context context) { + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, skipToken, top, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryPlan list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryPlan list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryPlan list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlansImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlansImpl.java new file mode 100644 index 000000000000..062b4611d017 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlansImpl.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.RecoveryPlansClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryPlanInner; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlan; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlans; + +public final class RecoveryPlansImpl implements RecoveryPlans { + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPlansImpl.class); + + private final RecoveryPlansClient innerClient; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + public RecoveryPlansImpl(RecoveryPlansClient innerClient, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String serviceGroupName, String recoveryPlanName, Context context) { + Response inner + = this.serviceClient().getWithResponse(serviceGroupName, recoveryPlanName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RecoveryPlanImpl(inner.getValue(), this.manager())); + } + + public RecoveryPlan get(String serviceGroupName, String recoveryPlanName) { + RecoveryPlanInner inner = this.serviceClient().get(serviceGroupName, recoveryPlanName); + if (inner != null) { + return new RecoveryPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlan createOrUpdate(String serviceGroupName, String recoveryPlanName, RecoveryPlanInner resource) { + RecoveryPlanInner inner = this.serviceClient().createOrUpdate(serviceGroupName, recoveryPlanName, resource); + if (inner != null) { + return new RecoveryPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlan createOrUpdate(String serviceGroupName, String recoveryPlanName, RecoveryPlanInner resource, + Context context) { + RecoveryPlanInner inner + = this.serviceClient().createOrUpdate(serviceGroupName, recoveryPlanName, resource, context); + if (inner != null) { + return new RecoveryPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlan update(String serviceGroupName, String recoveryPlanName, RecoveryPlanInner properties) { + RecoveryPlanInner inner = this.serviceClient().update(serviceGroupName, recoveryPlanName, properties); + if (inner != null) { + return new RecoveryPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlan update(String serviceGroupName, String recoveryPlanName, RecoveryPlanInner properties, + Context context) { + RecoveryPlanInner inner = this.serviceClient().update(serviceGroupName, recoveryPlanName, properties, context); + if (inner != null) { + return new RecoveryPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String serviceGroupName, String recoveryPlanName) { + this.serviceClient().delete(serviceGroupName, recoveryPlanName); + } + + public void delete(String serviceGroupName, String recoveryPlanName, Context context) { + this.serviceClient().delete(serviceGroupName, recoveryPlanName, context); + } + + public PagedIterable list(String serviceGroupName) { + PagedIterable inner = this.serviceClient().list(serviceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RecoveryPlanImpl(inner1, this.manager())); + } + + public PagedIterable list(String serviceGroupName, String skipToken, Integer top, Context context) { + PagedIterable inner = this.serviceClient().list(serviceGroupName, skipToken, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RecoveryPlanImpl(inner1, this.manager())); + } + + private RecoveryPlansClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryResourceImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryResourceImpl.java new file mode 100644 index 000000000000..0f28bbfb3206 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryResourceImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryResourceInner; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryResource; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryResourceProperties; + +public final class RecoveryResourceImpl implements RecoveryResource { + private RecoveryResourceInner innerObject; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + RecoveryResourceImpl(RecoveryResourceInner innerObject, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager 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 RecoveryResourceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public RecoveryResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryResourceQualificationImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryResourceQualificationImpl.java new file mode 100644 index 000000000000..d4fa990588bc --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryResourceQualificationImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryResourceInner; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryResourceQualificationInner; +import com.azure.resourcemanager.resiliencemanagement.models.OperationQualificationDetails; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryResource; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryResourceQualification; + +public final class RecoveryResourceQualificationImpl implements RecoveryResourceQualification { + private RecoveryResourceQualificationInner innerObject; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + RecoveryResourceQualificationImpl(RecoveryResourceQualificationInner innerObject, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public RecoveryResource recoveryResource() { + RecoveryResourceInner inner = this.innerModel().recoveryResource(); + if (inner != null) { + return new RecoveryResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationQualificationDetails operationQualificationDetails() { + return this.innerModel().operationQualificationDetails(); + } + + public RecoveryResourceQualificationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryResourcesClientImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryResourcesClientImpl.java new file mode 100644 index 000000000000..fb402ff47bc6 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryResourcesClientImpl.java @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.RecoveryResourcesClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryResourceInner; +import com.azure.resourcemanager.resiliencemanagement.implementation.models.RecoveryResourceListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RecoveryResourcesClient. + */ +public final class RecoveryResourcesClientImpl implements RecoveryResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final RecoveryResourcesService service; + + /** + * The service client containing this operation class. + */ + private final ResilienceManagementManagementClientImpl client; + + /** + * Initializes an instance of RecoveryResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RecoveryResourcesClientImpl(ResilienceManagementManagementClientImpl client) { + this.service + = RestProxy.create(RecoveryResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResilienceManagementManagementClientRecoveryResources to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ResilienceManagementManagementClientRecoveryResources") + public interface RecoveryResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/recoveryResources/{recoveryResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("recoveryPlanName") String recoveryPlanName, + @PathParam("recoveryResourceName") String recoveryResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/recoveryResources/{recoveryResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("recoveryPlanName") String recoveryPlanName, + @PathParam("recoveryResourceName") String recoveryResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/recoveryResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("recoveryPlanName") String recoveryPlanName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/recoveryPlans/{recoveryPlanName}/recoveryResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("recoveryPlanName") String recoveryPlanName, @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a RecoveryResource. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryResourceName The unique name (Guid) of the recovery 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 a RecoveryResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String serviceGroupName, String recoveryPlanName, + String recoveryResourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), recoveryPlanName, recoveryResourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a RecoveryResource. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryResourceName The unique name (Guid) of the recovery 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 a RecoveryResource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String serviceGroupName, String recoveryPlanName, + String recoveryResourceName) { + return getWithResponseAsync(serviceGroupName, recoveryPlanName, recoveryResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a RecoveryResource. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryResourceName The unique name (Guid) of the recovery 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 a RecoveryResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String serviceGroupName, String recoveryPlanName, + String recoveryResourceName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + recoveryPlanName, recoveryResourceName, accept, context); + } + + /** + * Get a RecoveryResource. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryResourceName The unique name (Guid) of the recovery 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 a RecoveryResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryResourceInner get(String serviceGroupName, String recoveryPlanName, String recoveryResourceName) { + return getWithResponse(serviceGroupName, recoveryPlanName, recoveryResourceName, Context.NONE).getValue(); + } + + /** + * List RecoveryResource resources by RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String serviceGroupName, + String recoveryPlanName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), recoveryPlanName, 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 RecoveryResource resources by RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String serviceGroupName, String recoveryPlanName) { + return new PagedFlux<>(() -> listSinglePageAsync(serviceGroupName, recoveryPlanName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List RecoveryResource resources by RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String recoveryPlanName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), recoveryPlanName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List RecoveryResource resources by RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String recoveryPlanName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), recoveryPlanName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List RecoveryResource resources by RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName, String recoveryPlanName) { + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, recoveryPlanName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List RecoveryResource resources by RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName, String recoveryPlanName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, recoveryPlanName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryResourcesImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryResourcesImpl.java new file mode 100644 index 000000000000..aeb4490d96c1 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryResourcesImpl.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.RecoveryResourcesClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryResourceInner; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryResource; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryResources; + +public final class RecoveryResourcesImpl implements RecoveryResources { + private static final ClientLogger LOGGER = new ClientLogger(RecoveryResourcesImpl.class); + + private final RecoveryResourcesClient innerClient; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + public RecoveryResourcesImpl(RecoveryResourcesClient innerClient, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String serviceGroupName, String recoveryPlanName, + String recoveryResourceName, Context context) { + Response inner + = this.serviceClient().getWithResponse(serviceGroupName, recoveryPlanName, recoveryResourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RecoveryResourceImpl(inner.getValue(), this.manager())); + } + + public RecoveryResource get(String serviceGroupName, String recoveryPlanName, String recoveryResourceName) { + RecoveryResourceInner inner + = this.serviceClient().get(serviceGroupName, recoveryPlanName, recoveryResourceName); + if (inner != null) { + return new RecoveryResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String serviceGroupName, String recoveryPlanName) { + PagedIterable inner = this.serviceClient().list(serviceGroupName, recoveryPlanName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RecoveryResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String serviceGroupName, String recoveryPlanName, Context context) { + PagedIterable inner + = this.serviceClient().list(serviceGroupName, recoveryPlanName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RecoveryResourceImpl(inner1, this.manager())); + } + + private RecoveryResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/ResilienceManagementManagementClientBuilder.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/ResilienceManagementManagementClientBuilder.java new file mode 100644 index 000000000000..a019df15490c --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/ResilienceManagementManagementClientBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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 ResilienceManagementManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { ResilienceManagementManagementClientImpl.class }) +public final class ResilienceManagementManagementClientBuilder { + /* + * Service host + */ + private String endpoint; + + /** + * Sets Service host. + * + * @param endpoint the endpoint value. + * @return the ResilienceManagementManagementClientBuilder. + */ + public ResilienceManagementManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the ResilienceManagementManagementClientBuilder. + */ + public ResilienceManagementManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the ResilienceManagementManagementClientBuilder. + */ + public ResilienceManagementManagementClientBuilder 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 ResilienceManagementManagementClientBuilder. + */ + public ResilienceManagementManagementClientBuilder 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 ResilienceManagementManagementClientBuilder. + */ + public ResilienceManagementManagementClientBuilder 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 ResilienceManagementManagementClientBuilder. + */ + public ResilienceManagementManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ResilienceManagementManagementClientImpl with the provided parameters. + * + * @return an instance of ResilienceManagementManagementClientImpl. + */ + public ResilienceManagementManagementClientImpl 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(); + ResilienceManagementManagementClientImpl client = new ResilienceManagementManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); + return client; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/ResilienceManagementManagementClientImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/ResilienceManagementManagementClientImpl.java new file mode 100644 index 000000000000..0d772a03f659 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/ResilienceManagementManagementClientImpl.java @@ -0,0 +1,564 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +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.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; +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.polling.SyncPoller; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resiliencemanagement.fluent.DrillResourcesClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.DrillRunResourcesClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.DrillRunsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.EnrollmentsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.GoalAssignmentsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.GoalResourcesClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.GoalTemplatesClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.OperationStatusClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.OperationsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryJobResourcesClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryJobsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlansClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryResourcesClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.ResilienceManagementManagementClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.UnifiedResilienceItemsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.UsagePlansClient; +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 ResilienceManagementManagementClientImpl type. + */ +@ServiceClient(builder = ResilienceManagementManagementClientBuilder.class) +public final class ResilienceManagementManagementClientImpl implements ResilienceManagementManagementClient { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Version parameter. + */ + private final String apiVersion; + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * The OperationStatusClient object to access its operations. + */ + private final OperationStatusClient operationStatus; + + /** + * Gets the OperationStatusClient object to access its operations. + * + * @return the OperationStatusClient object. + */ + public OperationStatusClient getOperationStatus() { + return this.operationStatus; + } + + /** + * The GoalAssignmentsClient object to access its operations. + */ + private final GoalAssignmentsClient goalAssignments; + + /** + * Gets the GoalAssignmentsClient object to access its operations. + * + * @return the GoalAssignmentsClient object. + */ + public GoalAssignmentsClient getGoalAssignments() { + return this.goalAssignments; + } + + /** + * The GoalTemplatesClient object to access its operations. + */ + private final GoalTemplatesClient goalTemplates; + + /** + * Gets the GoalTemplatesClient object to access its operations. + * + * @return the GoalTemplatesClient object. + */ + public GoalTemplatesClient getGoalTemplates() { + return this.goalTemplates; + } + + /** + * The GoalResourcesClient object to access its operations. + */ + private final GoalResourcesClient goalResources; + + /** + * Gets the GoalResourcesClient object to access its operations. + * + * @return the GoalResourcesClient object. + */ + public GoalResourcesClient getGoalResources() { + return this.goalResources; + } + + /** + * The RecoveryPlansClient object to access its operations. + */ + private final RecoveryPlansClient recoveryPlans; + + /** + * Gets the RecoveryPlansClient object to access its operations. + * + * @return the RecoveryPlansClient object. + */ + public RecoveryPlansClient getRecoveryPlans() { + return this.recoveryPlans; + } + + /** + * The RecoveryPlanActionsClient object to access its operations. + */ + private final RecoveryPlanActionsClient recoveryPlanActions; + + /** + * Gets the RecoveryPlanActionsClient object to access its operations. + * + * @return the RecoveryPlanActionsClient object. + */ + public RecoveryPlanActionsClient getRecoveryPlanActions() { + return this.recoveryPlanActions; + } + + /** + * The RecoveryResourcesClient object to access its operations. + */ + private final RecoveryResourcesClient recoveryResources; + + /** + * Gets the RecoveryResourcesClient object to access its operations. + * + * @return the RecoveryResourcesClient object. + */ + public RecoveryResourcesClient getRecoveryResources() { + return this.recoveryResources; + } + + /** + * The RecoveryJobsClient object to access its operations. + */ + private final RecoveryJobsClient recoveryJobs; + + /** + * Gets the RecoveryJobsClient object to access its operations. + * + * @return the RecoveryJobsClient object. + */ + public RecoveryJobsClient getRecoveryJobs() { + return this.recoveryJobs; + } + + /** + * The RecoveryJobResourcesClient object to access its operations. + */ + private final RecoveryJobResourcesClient recoveryJobResources; + + /** + * Gets the RecoveryJobResourcesClient object to access its operations. + * + * @return the RecoveryJobResourcesClient object. + */ + public RecoveryJobResourcesClient getRecoveryJobResources() { + return this.recoveryJobResources; + } + + /** + * The DrillsClient object to access its operations. + */ + private final DrillsClient drills; + + /** + * Gets the DrillsClient object to access its operations. + * + * @return the DrillsClient object. + */ + public DrillsClient getDrills() { + return this.drills; + } + + /** + * The DrillResourcesClient object to access its operations. + */ + private final DrillResourcesClient drillResources; + + /** + * Gets the DrillResourcesClient object to access its operations. + * + * @return the DrillResourcesClient object. + */ + public DrillResourcesClient getDrillResources() { + return this.drillResources; + } + + /** + * The DrillRunsClient object to access its operations. + */ + private final DrillRunsClient drillRuns; + + /** + * Gets the DrillRunsClient object to access its operations. + * + * @return the DrillRunsClient object. + */ + public DrillRunsClient getDrillRuns() { + return this.drillRuns; + } + + /** + * The DrillRunResourcesClient object to access its operations. + */ + private final DrillRunResourcesClient drillRunResources; + + /** + * Gets the DrillRunResourcesClient object to access its operations. + * + * @return the DrillRunResourcesClient object. + */ + public DrillRunResourcesClient getDrillRunResources() { + return this.drillRunResources; + } + + /** + * The UnifiedResilienceItemsClient object to access its operations. + */ + private final UnifiedResilienceItemsClient unifiedResilienceItems; + + /** + * Gets the UnifiedResilienceItemsClient object to access its operations. + * + * @return the UnifiedResilienceItemsClient object. + */ + public UnifiedResilienceItemsClient getUnifiedResilienceItems() { + return this.unifiedResilienceItems; + } + + /** + * The UsagePlansClient object to access its operations. + */ + private final UsagePlansClient usagePlans; + + /** + * Gets the UsagePlansClient object to access its operations. + * + * @return the UsagePlansClient object. + */ + public UsagePlansClient getUsagePlans() { + return this.usagePlans; + } + + /** + * The EnrollmentsClient object to access its operations. + */ + private final EnrollmentsClient enrollments; + + /** + * Gets the EnrollmentsClient object to access its operations. + * + * @return the EnrollmentsClient object. + */ + public EnrollmentsClient getEnrollments() { + return this.enrollments; + } + + /** + * Initializes an instance of ResilienceManagementManagementClient 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 endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + */ + ResilienceManagementManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; + this.subscriptionId = subscriptionId; + this.apiVersion = "2026-04-01-preview"; + this.operations = new OperationsClientImpl(this); + this.operationStatus = new OperationStatusClientImpl(this); + this.goalAssignments = new GoalAssignmentsClientImpl(this); + this.goalTemplates = new GoalTemplatesClientImpl(this); + this.goalResources = new GoalResourcesClientImpl(this); + this.recoveryPlans = new RecoveryPlansClientImpl(this); + this.recoveryPlanActions = new RecoveryPlanActionsClientImpl(this); + this.recoveryResources = new RecoveryResourcesClientImpl(this); + this.recoveryJobs = new RecoveryJobsClientImpl(this); + this.recoveryJobResources = new RecoveryJobResourcesClientImpl(this); + this.drills = new DrillsClientImpl(this); + this.drillResources = new DrillResourcesClientImpl(this); + this.drillRuns = new DrillRunsClientImpl(this); + this.drillRunResources = new DrillRunResourcesClientImpl(this); + this.unifiedResilienceItems = new UnifiedResilienceItemsClientImpl(this); + this.usagePlans = new UsagePlansClientImpl(this); + this.enrollments = new EnrollmentsClientImpl(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 long running operation result. + * + * @param activationResponse the response of activation operation. + * @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 SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.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(HttpHeaderName.fromString(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(ResilienceManagementManagementClientImpl.class); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/ResourceManagerUtils.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..b74452fd3066 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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 ResourceManagerUtils { + private ResourceManagerUtils() { + } + + 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.isEmpty() && 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<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(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/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UnifiedResilienceItemImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UnifiedResilienceItemImpl.java new file mode 100644 index 000000000000..56ec50400d55 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UnifiedResilienceItemImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.UnifiedResilienceItemInner; +import com.azure.resourcemanager.resiliencemanagement.models.UnifiedResilienceItem; +import com.azure.resourcemanager.resiliencemanagement.models.UnifiedResilienceItemProperties; + +public final class UnifiedResilienceItemImpl implements UnifiedResilienceItem { + private UnifiedResilienceItemInner innerObject; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + UnifiedResilienceItemImpl(UnifiedResilienceItemInner innerObject, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager 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 UnifiedResilienceItemProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public UnifiedResilienceItemInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UnifiedResilienceItemsClientImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UnifiedResilienceItemsClientImpl.java new file mode 100644 index 000000000000..8fae3c5696c1 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UnifiedResilienceItemsClientImpl.java @@ -0,0 +1,380 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.UnifiedResilienceItemsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.UnifiedResilienceItemInner; +import com.azure.resourcemanager.resiliencemanagement.implementation.models.UnifiedResilienceItemListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in UnifiedResilienceItemsClient. + */ +public final class UnifiedResilienceItemsClientImpl implements UnifiedResilienceItemsClient { + /** + * The proxy service used to perform REST calls. + */ + private final UnifiedResilienceItemsService service; + + /** + * The service client containing this operation class. + */ + private final ResilienceManagementManagementClientImpl client; + + /** + * Initializes an instance of UnifiedResilienceItemsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UnifiedResilienceItemsClientImpl(ResilienceManagementManagementClientImpl client) { + this.service = RestProxy.create(UnifiedResilienceItemsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResilienceManagementManagementClientUnifiedResilienceItems to be used + * by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ResilienceManagementManagementClientUnifiedResilienceItems") + public interface UnifiedResilienceItemsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/unifiedResilienceItems/{unifiedResilienceItemName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("unifiedResilienceItemName") String unifiedResilienceItemName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/unifiedResilienceItems/{unifiedResilienceItemName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("unifiedResilienceItemName") String unifiedResilienceItemName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/unifiedResilienceItems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/providers/Microsoft.AzureResilienceManagement/unifiedResilienceItems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @PathParam("serviceGroupName") String serviceGroupName, @QueryParam("api-version") String apiVersion, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a UnifiedResilienceItem. + * + * @param serviceGroupName The name of the service group. + * @param unifiedResilienceItemName The name of the unified resilience item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 UnifiedResilienceItem along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String serviceGroupName, + String unifiedResilienceItemName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), unifiedResilienceItemName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a UnifiedResilienceItem. + * + * @param serviceGroupName The name of the service group. + * @param unifiedResilienceItemName The name of the unified resilience item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 UnifiedResilienceItem on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String serviceGroupName, String unifiedResilienceItemName) { + return getWithResponseAsync(serviceGroupName, unifiedResilienceItemName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a UnifiedResilienceItem. + * + * @param serviceGroupName The name of the service group. + * @param unifiedResilienceItemName The name of the unified resilience item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 UnifiedResilienceItem along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String serviceGroupName, + String unifiedResilienceItemName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), serviceGroupName, this.client.getApiVersion(), + unifiedResilienceItemName, accept, context); + } + + /** + * Get a UnifiedResilienceItem. + * + * @param serviceGroupName The name of the service group. + * @param unifiedResilienceItemName The name of the unified resilience item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 UnifiedResilienceItem. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UnifiedResilienceItemInner get(String serviceGroupName, String unifiedResilienceItemName) { + return getWithResponse(serviceGroupName, unifiedResilienceItemName, Context.NONE).getValue(); + } + + /** + * List UnifiedResilienceItem resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UnifiedResilienceItem list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String serviceGroupName, + String skipToken, Integer top) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, 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 UnifiedResilienceItem resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UnifiedResilienceItem list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String serviceGroupName, String skipToken, Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(serviceGroupName, skipToken, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List UnifiedResilienceItem resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UnifiedResilienceItem list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String serviceGroupName) { + final String skipToken = null; + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(serviceGroupName, skipToken, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List UnifiedResilienceItem resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UnifiedResilienceItem list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String skipToken, + Integer top) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List UnifiedResilienceItem resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UnifiedResilienceItem list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceGroupName, String skipToken, + Integer top, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), serviceGroupName, + this.client.getApiVersion(), skipToken, top, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List UnifiedResilienceItem resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UnifiedResilienceItem list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName) { + final String skipToken = null; + final Integer top = null; + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, skipToken, top), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List UnifiedResilienceItem resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UnifiedResilienceItem list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceGroupName, String skipToken, Integer top, + Context context) { + return new PagedIterable<>(() -> listSinglePage(serviceGroupName, skipToken, top, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UnifiedResilienceItem list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UnifiedResilienceItem list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UnifiedResilienceItem list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UnifiedResilienceItemsImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UnifiedResilienceItemsImpl.java new file mode 100644 index 000000000000..3242028d27a8 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UnifiedResilienceItemsImpl.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.UnifiedResilienceItemsClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.UnifiedResilienceItemInner; +import com.azure.resourcemanager.resiliencemanagement.models.UnifiedResilienceItem; +import com.azure.resourcemanager.resiliencemanagement.models.UnifiedResilienceItems; + +public final class UnifiedResilienceItemsImpl implements UnifiedResilienceItems { + private static final ClientLogger LOGGER = new ClientLogger(UnifiedResilienceItemsImpl.class); + + private final UnifiedResilienceItemsClient innerClient; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + public UnifiedResilienceItemsImpl(UnifiedResilienceItemsClient innerClient, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String serviceGroupName, String unifiedResilienceItemName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(serviceGroupName, unifiedResilienceItemName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new UnifiedResilienceItemImpl(inner.getValue(), this.manager())); + } + + public UnifiedResilienceItem get(String serviceGroupName, String unifiedResilienceItemName) { + UnifiedResilienceItemInner inner = this.serviceClient().get(serviceGroupName, unifiedResilienceItemName); + if (inner != null) { + return new UnifiedResilienceItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String serviceGroupName) { + PagedIterable inner = this.serviceClient().list(serviceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UnifiedResilienceItemImpl(inner1, this.manager())); + } + + public PagedIterable list(String serviceGroupName, String skipToken, Integer top, + Context context) { + PagedIterable inner + = this.serviceClient().list(serviceGroupName, skipToken, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UnifiedResilienceItemImpl(inner1, this.manager())); + } + + private UnifiedResilienceItemsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UpdateRecoveryResourcesResponseImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UpdateRecoveryResourcesResponseImpl.java new file mode 100644 index 000000000000..3063898ae396 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UpdateRecoveryResourcesResponseImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryResourceInner; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.UpdateRecoveryResourcesResponseInner; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryResource; +import com.azure.resourcemanager.resiliencemanagement.models.UpdateRecoveryResourcesResponse; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class UpdateRecoveryResourcesResponseImpl implements UpdateRecoveryResourcesResponse { + private UpdateRecoveryResourcesResponseInner innerObject; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + UpdateRecoveryResourcesResponseImpl(UpdateRecoveryResourcesResponseInner innerObject, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List failedResources() { + List inner = this.innerModel().failedResources(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new RecoveryResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public UpdateRecoveryResourcesResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UsagePlanImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UsagePlanImpl.java new file mode 100644 index 000000000000..714eb7ee70f6 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UsagePlanImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.UsagePlanInner; +import com.azure.resourcemanager.resiliencemanagement.models.UsagePlan; +import com.azure.resourcemanager.resiliencemanagement.models.UsagePlanProperties; +import com.azure.resourcemanager.resiliencemanagement.models.UsagePlanTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class UsagePlanImpl implements UsagePlan, UsagePlan.Definition, UsagePlan.Update { + private UsagePlanInner innerObject; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public UsagePlanProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public UsagePlanInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String usagePlanName; + + private UsagePlanTagsUpdate updateProperties; + + public UsagePlanImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public UsagePlan create() { + this.innerObject = serviceManager.serviceClient() + .getUsagePlans() + .createOrUpdate(resourceGroupName, usagePlanName, this.innerModel(), Context.NONE); + return this; + } + + public UsagePlan create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getUsagePlans() + .createOrUpdate(resourceGroupName, usagePlanName, this.innerModel(), context); + return this; + } + + UsagePlanImpl(String name, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerObject = new UsagePlanInner(); + this.serviceManager = serviceManager; + this.usagePlanName = name; + } + + public UsagePlanImpl update() { + this.updateProperties = new UsagePlanTagsUpdate(); + return this; + } + + public UsagePlan apply() { + this.innerObject = serviceManager.serviceClient() + .getUsagePlans() + .update(resourceGroupName, usagePlanName, updateProperties, Context.NONE); + return this; + } + + public UsagePlan apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getUsagePlans() + .update(resourceGroupName, usagePlanName, updateProperties, context); + return this; + } + + UsagePlanImpl(UsagePlanInner innerObject, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.usagePlanName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "usagePlans"); + } + + public UsagePlan refresh() { + this.innerObject = serviceManager.serviceClient() + .getUsagePlans() + .getByResourceGroupWithResponse(resourceGroupName, usagePlanName, Context.NONE) + .getValue(); + return this; + } + + public UsagePlan refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getUsagePlans() + .getByResourceGroupWithResponse(resourceGroupName, usagePlanName, context) + .getValue(); + return this; + } + + public UsagePlanImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public UsagePlanImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public UsagePlanImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public UsagePlanImpl withProperties(UsagePlanProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel() == null || this.innerModel().id() == null; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UsagePlansClientImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UsagePlansClientImpl.java new file mode 100644 index 000000000000..1870965206f4 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UsagePlansClientImpl.java @@ -0,0 +1,1097 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.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.management.polling.PollResult; +import com.azure.core.util.BinaryData; +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.resiliencemanagement.fluent.UsagePlansClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.UsagePlanInner; +import com.azure.resourcemanager.resiliencemanagement.implementation.models.UsagePlanListResult; +import com.azure.resourcemanager.resiliencemanagement.models.UsagePlanTagsUpdate; +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 UsagePlansClient. + */ +public final class UsagePlansClientImpl implements UsagePlansClient { + /** + * The proxy service used to perform REST calls. + */ + private final UsagePlansService service; + + /** + * The service client containing this operation class. + */ + private final ResilienceManagementManagementClientImpl client; + + /** + * Initializes an instance of UsagePlansClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UsagePlansClientImpl(ResilienceManagementManagementClientImpl client) { + this.service + = RestProxy.create(UsagePlansService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResilienceManagementManagementClientUsagePlans to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ResilienceManagementManagementClientUsagePlans") + public interface UsagePlansService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureResilienceManagement/usagePlans/{usagePlanName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("usagePlanName") String usagePlanName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureResilienceManagement/usagePlans/{usagePlanName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("usagePlanName") String usagePlanName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureResilienceManagement/usagePlans/{usagePlanName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("usagePlanName") String usagePlanName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") UsagePlanInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureResilienceManagement/usagePlans/{usagePlanName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("usagePlanName") String usagePlanName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") UsagePlanInner resource, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureResilienceManagement/usagePlans/{usagePlanName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("usagePlanName") String usagePlanName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") UsagePlanTagsUpdate properties, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureResilienceManagement/usagePlans/{usagePlanName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("usagePlanName") String usagePlanName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") UsagePlanTagsUpdate properties, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureResilienceManagement/usagePlans/{usagePlanName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("usagePlanName") String usagePlanName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureResilienceManagement/usagePlans/{usagePlanName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("usagePlanName") String usagePlanName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureResilienceManagement/usagePlans") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureResilienceManagement/usagePlans") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureResilienceManagement/usagePlans") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureResilienceManagement/usagePlans") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 UsagePlan along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String usagePlanName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 UsagePlan on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String usagePlanName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, usagePlanName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 UsagePlan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String usagePlanName, + Context context) { + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, accept, context); + } + + /** + * Get a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 UsagePlan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UsagePlanInner getByResourceGroup(String resourceGroupName, String usagePlanName) { + return getByResourceGroupWithResponse(resourceGroupName, usagePlanName, Context.NONE).getValue(); + } + + /** + * Create a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 usage plan resource for Resiliency feature billing along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String usagePlanName, UsagePlanInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, contentType, accept, resource, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 usage plan resource for Resiliency feature billing along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String usagePlanName, + UsagePlanInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, contentType, accept, resource, + Context.NONE); + } + + /** + * Create a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 usage plan resource for Resiliency feature billing along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String usagePlanName, + UsagePlanInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, contentType, accept, resource, context); + } + + /** + * Create a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a usage plan resource for Resiliency feature billing. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, UsagePlanInner> beginCreateOrUpdateAsync(String resourceGroupName, + String usagePlanName, UsagePlanInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, usagePlanName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + UsagePlanInner.class, UsagePlanInner.class, this.client.getContext()); + } + + /** + * Create a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a usage plan resource for Resiliency feature billing. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, UsagePlanInner> beginCreateOrUpdate(String resourceGroupName, + String usagePlanName, UsagePlanInner resource) { + Response response = createOrUpdateWithResponse(resourceGroupName, usagePlanName, resource); + return this.client.getLroResult(response, UsagePlanInner.class, + UsagePlanInner.class, Context.NONE); + } + + /** + * Create a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a usage plan resource for Resiliency feature billing. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, UsagePlanInner> beginCreateOrUpdate(String resourceGroupName, + String usagePlanName, UsagePlanInner resource, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, usagePlanName, resource, context); + return this.client.getLroResult(response, UsagePlanInner.class, + UsagePlanInner.class, context); + } + + /** + * Create a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 usage plan resource for Resiliency feature billing on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String usagePlanName, + UsagePlanInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, usagePlanName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 usage plan resource for Resiliency feature billing. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UsagePlanInner createOrUpdate(String resourceGroupName, String usagePlanName, UsagePlanInner resource) { + return beginCreateOrUpdate(resourceGroupName, usagePlanName, resource).getFinalResult(); + } + + /** + * Create a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 usage plan resource for Resiliency feature billing. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UsagePlanInner createOrUpdate(String resourceGroupName, String usagePlanName, UsagePlanInner resource, + Context context) { + return beginCreateOrUpdate(resourceGroupName, usagePlanName, resource, context).getFinalResult(); + } + + /** + * Update a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 usage plan resource for Resiliency feature billing along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String usagePlanName, + UsagePlanTagsUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, contentType, accept, properties, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 usage plan resource for Resiliency feature billing along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String usagePlanName, + UsagePlanTagsUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, contentType, accept, properties, + Context.NONE); + } + + /** + * Update a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 usage plan resource for Resiliency feature billing along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String usagePlanName, + UsagePlanTagsUpdate properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, contentType, accept, properties, + context); + } + + /** + * Update a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a usage plan resource for Resiliency feature billing. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, UsagePlanInner> beginUpdateAsync(String resourceGroupName, + String usagePlanName, UsagePlanTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, usagePlanName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + UsagePlanInner.class, UsagePlanInner.class, this.client.getContext()); + } + + /** + * Update a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a usage plan resource for Resiliency feature billing. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, UsagePlanInner> beginUpdate(String resourceGroupName, + String usagePlanName, UsagePlanTagsUpdate properties) { + Response response = updateWithResponse(resourceGroupName, usagePlanName, properties); + return this.client.getLroResult(response, UsagePlanInner.class, + UsagePlanInner.class, Context.NONE); + } + + /** + * Update a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a usage plan resource for Resiliency feature billing. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, UsagePlanInner> beginUpdate(String resourceGroupName, + String usagePlanName, UsagePlanTagsUpdate properties, Context context) { + Response response = updateWithResponse(resourceGroupName, usagePlanName, properties, context); + return this.client.getLroResult(response, UsagePlanInner.class, + UsagePlanInner.class, context); + } + + /** + * Update a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 usage plan resource for Resiliency feature billing on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String usagePlanName, + UsagePlanTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, usagePlanName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 usage plan resource for Resiliency feature billing. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UsagePlanInner update(String resourceGroupName, String usagePlanName, UsagePlanTagsUpdate properties) { + return beginUpdate(resourceGroupName, usagePlanName, properties).getFinalResult(); + } + + /** + * Update a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 usage plan resource for Resiliency feature billing. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UsagePlanInner update(String resourceGroupName, String usagePlanName, UsagePlanTagsUpdate properties, + Context context) { + return beginUpdate(resourceGroupName, usagePlanName, properties, context).getFinalResult(); + } + + /** + * Delete a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceGroupName, String usagePlanName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String usagePlanName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, Context.NONE); + } + + /** + * Delete a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String usagePlanName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, usagePlanName, context); + } + + /** + * Delete a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String usagePlanName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, usagePlanName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String usagePlanName) { + Response response = deleteWithResponse(resourceGroupName, usagePlanName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String usagePlanName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, usagePlanName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceGroupName, String usagePlanName) { + return beginDeleteAsync(resourceGroupName, usagePlanName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceGroupName, String usagePlanName) { + beginDelete(resourceGroupName, usagePlanName).getFinalResult(); + } + + /** + * Delete a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceGroupName, String usagePlanName, Context context) { + beginDelete(resourceGroupName, usagePlanName, context).getFinalResult(); + } + + /** + * List UsagePlan resources by 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 the response of a UsagePlan list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, 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 UsagePlan resources by 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 the response of a UsagePlan list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List UsagePlan resources by 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 the response of a UsagePlan list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List UsagePlan resources by 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 the response of a UsagePlan list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List UsagePlan resources by 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 the response of a UsagePlan list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * List UsagePlan resources by 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 the response of a UsagePlan list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * List UsagePlan resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UsagePlan list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + 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())); + } + + /** + * List UsagePlan resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UsagePlan list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List UsagePlan resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UsagePlan list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List UsagePlan resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UsagePlan list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List UsagePlan resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UsagePlan list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * List UsagePlan resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UsagePlan list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UsagePlan list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UsagePlan list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UsagePlan list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UsagePlan list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UsagePlan list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UsagePlan list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UsagePlansImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UsagePlansImpl.java new file mode 100644 index 000000000000..480cd3521975 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UsagePlansImpl.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.UsagePlansClient; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.UsagePlanInner; +import com.azure.resourcemanager.resiliencemanagement.models.UsagePlan; +import com.azure.resourcemanager.resiliencemanagement.models.UsagePlans; + +public final class UsagePlansImpl implements UsagePlans { + private static final ClientLogger LOGGER = new ClientLogger(UsagePlansImpl.class); + + private final UsagePlansClient innerClient; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + public UsagePlansImpl(UsagePlansClient innerClient, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String usagePlanName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, usagePlanName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new UsagePlanImpl(inner.getValue(), this.manager())); + } + + public UsagePlan getByResourceGroup(String resourceGroupName, String usagePlanName) { + UsagePlanInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, usagePlanName); + if (inner != null) { + return new UsagePlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String usagePlanName) { + this.serviceClient().delete(resourceGroupName, usagePlanName); + } + + public void delete(String resourceGroupName, String usagePlanName, Context context) { + this.serviceClient().delete(resourceGroupName, usagePlanName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsagePlanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsagePlanImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsagePlanImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsagePlanImpl(inner1, this.manager())); + } + + public UsagePlan getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String usagePlanName = ResourceManagerUtils.getValueFromIdByName(id, "usagePlans"); + if (usagePlanName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'usagePlans'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, usagePlanName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String usagePlanName = ResourceManagerUtils.getValueFromIdByName(id, "usagePlans"); + if (usagePlanName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'usagePlans'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, usagePlanName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String usagePlanName = ResourceManagerUtils.getValueFromIdByName(id, "usagePlans"); + if (usagePlanName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'usagePlans'.", id))); + } + this.delete(resourceGroupName, usagePlanName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String usagePlanName = ResourceManagerUtils.getValueFromIdByName(id, "usagePlans"); + if (usagePlanName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'usagePlans'.", id))); + } + this.delete(resourceGroupName, usagePlanName, context); + } + + private UsagePlansClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } + + public UsagePlanImpl define(String name) { + return new UsagePlanImpl(name, this.manager()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/ValidateForRecoveryOperationBaseResponseImpl.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/ValidateForRecoveryOperationBaseResponseImpl.java new file mode 100644 index 000000000000..c4f4fcad2db6 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/ValidateForRecoveryOperationBaseResponseImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation; + +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryResourceQualificationInner; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.ValidateForRecoveryOperationBaseResponseInner; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryResourceQualification; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForRecoveryOperationBaseResponse; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ValidateForRecoveryOperationBaseResponseImpl implements ValidateForRecoveryOperationBaseResponse { + private ValidateForRecoveryOperationBaseResponseInner innerObject; + + private final com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager; + + ValidateForRecoveryOperationBaseResponseImpl(ValidateForRecoveryOperationBaseResponseInner innerObject, + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List recoveryResourceQualifications() { + List inner = this.innerModel().recoveryResourceQualifications(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new RecoveryResourceQualificationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ValidateForRecoveryOperationBaseResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/DrillListResult.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/DrillListResult.java new file mode 100644 index 000000000000..aa34f2a50b5c --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/DrillListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Drill list operation. + */ +@Immutable +public final class DrillListResult implements JsonSerializable { + /* + * The Drill items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of DrillListResult class. + */ + private DrillListResult() { + } + + /** + * Get the value property: The Drill items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DrillListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DrillListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DrillListResult. + */ + public static DrillListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DrillListResult deserializedDrillListResult = new DrillListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> DrillInner.fromJson(reader1)); + deserializedDrillListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDrillListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDrillListResult; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/DrillResourceListResult.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/DrillResourceListResult.java new file mode 100644 index 000000000000..7dd7515e989e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/DrillResourceListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a DrillResource list operation. + */ +@Immutable +public final class DrillResourceListResult implements JsonSerializable { + /* + * The DrillResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of DrillResourceListResult class. + */ + private DrillResourceListResult() { + } + + /** + * Get the value property: The DrillResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DrillResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DrillResourceListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DrillResourceListResult. + */ + public static DrillResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DrillResourceListResult deserializedDrillResourceListResult = new DrillResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> DrillResourceInner.fromJson(reader1)); + deserializedDrillResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDrillResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDrillResourceListResult; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/DrillRunListResult.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/DrillRunListResult.java new file mode 100644 index 000000000000..18196dc85ba4 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/DrillRunListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillRunInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a DrillRun list operation. + */ +@Immutable +public final class DrillRunListResult implements JsonSerializable { + /* + * The DrillRun items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of DrillRunListResult class. + */ + private DrillRunListResult() { + } + + /** + * Get the value property: The DrillRun items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DrillRunListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DrillRunListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DrillRunListResult. + */ + public static DrillRunListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DrillRunListResult deserializedDrillRunListResult = new DrillRunListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> DrillRunInner.fromJson(reader1)); + deserializedDrillRunListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDrillRunListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDrillRunListResult; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/DrillRunResourceListResult.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/DrillRunResourceListResult.java new file mode 100644 index 000000000000..e6fb675dedb0 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/DrillRunResourceListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillRunResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a DrillRunResource list operation. + */ +@Immutable +public final class DrillRunResourceListResult implements JsonSerializable { + /* + * The DrillRunResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of DrillRunResourceListResult class. + */ + private DrillRunResourceListResult() { + } + + /** + * Get the value property: The DrillRunResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DrillRunResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DrillRunResourceListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DrillRunResourceListResult. + */ + public static DrillRunResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DrillRunResourceListResult deserializedDrillRunResourceListResult = new DrillRunResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DrillRunResourceInner.fromJson(reader1)); + deserializedDrillRunResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDrillRunResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDrillRunResourceListResult; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/EnrollmentListResult.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/EnrollmentListResult.java new file mode 100644 index 000000000000..953c8fe240f8 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/EnrollmentListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.EnrollmentInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Enrollment list operation. + */ +@Immutable +public final class EnrollmentListResult implements JsonSerializable { + /* + * The Enrollment items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EnrollmentListResult class. + */ + private EnrollmentListResult() { + } + + /** + * Get the value property: The Enrollment items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnrollmentListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnrollmentListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EnrollmentListResult. + */ + public static EnrollmentListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnrollmentListResult deserializedEnrollmentListResult = new EnrollmentListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> EnrollmentInner.fromJson(reader1)); + deserializedEnrollmentListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEnrollmentListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEnrollmentListResult; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/GoalAssignmentListResult.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/GoalAssignmentListResult.java new file mode 100644 index 000000000000..6903b6a9a517 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/GoalAssignmentListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalAssignmentInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a GoalAssignment list operation. + */ +@Immutable +public final class GoalAssignmentListResult implements JsonSerializable { + /* + * The GoalAssignment items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of GoalAssignmentListResult class. + */ + private GoalAssignmentListResult() { + } + + /** + * Get the value property: The GoalAssignment items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GoalAssignmentListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GoalAssignmentListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GoalAssignmentListResult. + */ + public static GoalAssignmentListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GoalAssignmentListResult deserializedGoalAssignmentListResult = new GoalAssignmentListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> GoalAssignmentInner.fromJson(reader1)); + deserializedGoalAssignmentListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedGoalAssignmentListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGoalAssignmentListResult; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/GoalResourceListResult.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/GoalResourceListResult.java new file mode 100644 index 000000000000..3e5a0433dd5d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/GoalResourceListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a GoalResource list operation. + */ +@Immutable +public final class GoalResourceListResult implements JsonSerializable { + /* + * The GoalResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of GoalResourceListResult class. + */ + private GoalResourceListResult() { + } + + /** + * Get the value property: The GoalResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GoalResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GoalResourceListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GoalResourceListResult. + */ + public static GoalResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GoalResourceListResult deserializedGoalResourceListResult = new GoalResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> GoalResourceInner.fromJson(reader1)); + deserializedGoalResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedGoalResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGoalResourceListResult; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/GoalTemplateListResult.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/GoalTemplateListResult.java new file mode 100644 index 000000000000..62b63f7bb6c4 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/GoalTemplateListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalTemplateInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a GoalTemplate list operation. + */ +@Immutable +public final class GoalTemplateListResult implements JsonSerializable { + /* + * The GoalTemplate items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of GoalTemplateListResult class. + */ + private GoalTemplateListResult() { + } + + /** + * Get the value property: The GoalTemplate items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GoalTemplateListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GoalTemplateListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GoalTemplateListResult. + */ + public static GoalTemplateListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GoalTemplateListResult deserializedGoalTemplateListResult = new GoalTemplateListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> GoalTemplateInner.fromJson(reader1)); + deserializedGoalTemplateListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedGoalTemplateListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGoalTemplateListResult; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/OperationListResult.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/OperationListResult.java new file mode 100644 index 000000000000..7c3130837885 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/OperationListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * The Operation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + private OperationListResult() { + } + + /** + * Get the value property: The Operation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/RecoveryJobListResult.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/RecoveryJobListResult.java new file mode 100644 index 000000000000..cce3eaf1ecb3 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/RecoveryJobListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryJobInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a RecoveryJob list operation. + */ +@Immutable +public final class RecoveryJobListResult implements JsonSerializable { + /* + * The RecoveryJob items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of RecoveryJobListResult class. + */ + private RecoveryJobListResult() { + } + + /** + * Get the value property: The RecoveryJob items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryJobListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryJobListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecoveryJobListResult. + */ + public static RecoveryJobListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryJobListResult deserializedRecoveryJobListResult = new RecoveryJobListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RecoveryJobInner.fromJson(reader1)); + deserializedRecoveryJobListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRecoveryJobListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryJobListResult; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/RecoveryJobResourceListResult.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/RecoveryJobResourceListResult.java new file mode 100644 index 000000000000..465459482676 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/RecoveryJobResourceListResult.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryJobResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a RecoveryJobResource list operation. + */ +@Immutable +public final class RecoveryJobResourceListResult implements JsonSerializable { + /* + * The RecoveryJobResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of RecoveryJobResourceListResult class. + */ + private RecoveryJobResourceListResult() { + } + + /** + * Get the value property: The RecoveryJobResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryJobResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryJobResourceListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecoveryJobResourceListResult. + */ + public static RecoveryJobResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryJobResourceListResult deserializedRecoveryJobResourceListResult + = new RecoveryJobResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> RecoveryJobResourceInner.fromJson(reader1)); + deserializedRecoveryJobResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRecoveryJobResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryJobResourceListResult; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/RecoveryPlanListResult.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/RecoveryPlanListResult.java new file mode 100644 index 000000000000..3818d73c61ca --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/RecoveryPlanListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryPlanInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a RecoveryPlan list operation. + */ +@Immutable +public final class RecoveryPlanListResult implements JsonSerializable { + /* + * The RecoveryPlan items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of RecoveryPlanListResult class. + */ + private RecoveryPlanListResult() { + } + + /** + * Get the value property: The RecoveryPlan items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryPlanListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryPlanListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecoveryPlanListResult. + */ + public static RecoveryPlanListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryPlanListResult deserializedRecoveryPlanListResult = new RecoveryPlanListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RecoveryPlanInner.fromJson(reader1)); + deserializedRecoveryPlanListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRecoveryPlanListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryPlanListResult; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/RecoveryResourceListResult.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/RecoveryResourceListResult.java new file mode 100644 index 000000000000..5d92373ddcb5 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/RecoveryResourceListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a RecoveryResource list operation. + */ +@Immutable +public final class RecoveryResourceListResult implements JsonSerializable { + /* + * The RecoveryResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of RecoveryResourceListResult class. + */ + private RecoveryResourceListResult() { + } + + /** + * Get the value property: The RecoveryResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryResourceListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecoveryResourceListResult. + */ + public static RecoveryResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryResourceListResult deserializedRecoveryResourceListResult = new RecoveryResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> RecoveryResourceInner.fromJson(reader1)); + deserializedRecoveryResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRecoveryResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryResourceListResult; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/UnifiedResilienceItemListResult.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/UnifiedResilienceItemListResult.java new file mode 100644 index 000000000000..fa4d49a33651 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/UnifiedResilienceItemListResult.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.UnifiedResilienceItemInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a UnifiedResilienceItem list operation. + */ +@Immutable +public final class UnifiedResilienceItemListResult implements JsonSerializable { + /* + * The UnifiedResilienceItem items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of UnifiedResilienceItemListResult class. + */ + private UnifiedResilienceItemListResult() { + } + + /** + * Get the value property: The UnifiedResilienceItem items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UnifiedResilienceItemListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UnifiedResilienceItemListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UnifiedResilienceItemListResult. + */ + public static UnifiedResilienceItemListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UnifiedResilienceItemListResult deserializedUnifiedResilienceItemListResult + = new UnifiedResilienceItemListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> UnifiedResilienceItemInner.fromJson(reader1)); + deserializedUnifiedResilienceItemListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedUnifiedResilienceItemListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUnifiedResilienceItemListResult; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/UsagePlanListResult.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/UsagePlanListResult.java new file mode 100644 index 000000000000..d871ce61bef8 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/UsagePlanListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.UsagePlanInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a UsagePlan list operation. + */ +@Immutable +public final class UsagePlanListResult implements JsonSerializable { + /* + * The UsagePlan items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of UsagePlanListResult class. + */ + private UsagePlanListResult() { + } + + /** + * Get the value property: The UsagePlan items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsagePlanListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsagePlanListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UsagePlanListResult. + */ + public static UsagePlanListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsagePlanListResult deserializedUsagePlanListResult = new UsagePlanListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> UsagePlanInner.fromJson(reader1)); + deserializedUsagePlanListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedUsagePlanListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUsagePlanListResult; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/package-info.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/package-info.java new file mode 100644 index 000000000000..9f46c6bcc767 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the implementations for ResilienceManagement. + */ +package com.azure.resourcemanager.resiliencemanagement.implementation; diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ActionTask.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ActionTask.java new file mode 100644 index 000000000000..1052ca5e783a --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ActionTask.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * An action task type indicates the type of action task. + */ +public final class ActionTask extends ExpandableStringEnum { + /** + * No action task. + */ + public static final ActionTask NONE = fromString("None"); + + /** + * Pre-action task. + */ + public static final ActionTask PRE_ACTION_TASK = fromString("PreActionTask"); + + /** + * Post-action task. + */ + public static final ActionTask POST_ACTION_TASK = fromString("PostActionTask"); + + /** + * Creates a new instance of ActionTask value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionTask() { + } + + /** + * Creates or finds a ActionTask from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionTask. + */ + public static ActionTask fromString(String name) { + return fromString(name, ActionTask.class); + } + + /** + * Gets known ActionTask values. + * + * @return known ActionTask values. + */ + public static Collection values() { + return values(ActionTask.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ActionType.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ActionType.java new file mode 100644 index 000000000000..3b235bb91cb8 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ActionType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Actions are for internal-only APIs. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AddOrUpdateResourcesRequest.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AddOrUpdateResourcesRequest.java new file mode 100644 index 000000000000..a4bfc2b2f8f3 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AddOrUpdateResourcesRequest.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Request body of the AddOrUpdateResources API. + */ +@Fluent +public final class AddOrUpdateResourcesRequest implements JsonSerializable { + /* + * Duration of faults. + */ + private int faultDurationInMin; + + /* + * Add, Update, Delete resource lists + */ + private ResourceLists resourceLists; + + /* + * Whether to allow inclusion and update despite attention reasons. + */ + private ForceInclusionAndUpdate forceInclusionAndUpdate; + + /** + * Creates an instance of AddOrUpdateResourcesRequest class. + */ + public AddOrUpdateResourcesRequest() { + } + + /** + * Get the faultDurationInMin property: Duration of faults. + * + * @return the faultDurationInMin value. + */ + public int faultDurationInMin() { + return this.faultDurationInMin; + } + + /** + * Set the faultDurationInMin property: Duration of faults. + * + * @param faultDurationInMin the faultDurationInMin value to set. + * @return the AddOrUpdateResourcesRequest object itself. + */ + public AddOrUpdateResourcesRequest withFaultDurationInMin(int faultDurationInMin) { + this.faultDurationInMin = faultDurationInMin; + return this; + } + + /** + * Get the resourceLists property: Add, Update, Delete resource lists. + * + * @return the resourceLists value. + */ + public ResourceLists resourceLists() { + return this.resourceLists; + } + + /** + * Set the resourceLists property: Add, Update, Delete resource lists. + * + * @param resourceLists the resourceLists value to set. + * @return the AddOrUpdateResourcesRequest object itself. + */ + public AddOrUpdateResourcesRequest withResourceLists(ResourceLists resourceLists) { + this.resourceLists = resourceLists; + return this; + } + + /** + * Get the forceInclusionAndUpdate property: Whether to allow inclusion and update despite attention reasons. + * + * @return the forceInclusionAndUpdate value. + */ + public ForceInclusionAndUpdate forceInclusionAndUpdate() { + return this.forceInclusionAndUpdate; + } + + /** + * Set the forceInclusionAndUpdate property: Whether to allow inclusion and update despite attention reasons. + * + * @param forceInclusionAndUpdate the forceInclusionAndUpdate value to set. + * @return the AddOrUpdateResourcesRequest object itself. + */ + public AddOrUpdateResourcesRequest withForceInclusionAndUpdate(ForceInclusionAndUpdate forceInclusionAndUpdate) { + this.forceInclusionAndUpdate = forceInclusionAndUpdate; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("faultDurationInMin", this.faultDurationInMin); + jsonWriter.writeJsonField("resourceLists", this.resourceLists); + jsonWriter.writeStringField("forceInclusionAndUpdate", + this.forceInclusionAndUpdate == null ? null : this.forceInclusionAndUpdate.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AddOrUpdateResourcesRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AddOrUpdateResourcesRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AddOrUpdateResourcesRequest. + */ + public static AddOrUpdateResourcesRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AddOrUpdateResourcesRequest deserializedAddOrUpdateResourcesRequest = new AddOrUpdateResourcesRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("faultDurationInMin".equals(fieldName)) { + deserializedAddOrUpdateResourcesRequest.faultDurationInMin = reader.getInt(); + } else if ("resourceLists".equals(fieldName)) { + deserializedAddOrUpdateResourcesRequest.resourceLists = ResourceLists.fromJson(reader); + } else if ("forceInclusionAndUpdate".equals(fieldName)) { + deserializedAddOrUpdateResourcesRequest.forceInclusionAndUpdate + = ForceInclusionAndUpdate.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAddOrUpdateResourcesRequest; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ArmResponseErrorResponse.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ArmResponseErrorResponse.java new file mode 100644 index 000000000000..297d80e26836 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ArmResponseErrorResponse.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Azure operation completed successfully. + */ +@Immutable +public final class ArmResponseErrorResponse implements JsonSerializable { + /* + * The body type of the operation request or response. + */ + private ManagementError body; + + /** + * Creates an instance of ArmResponseErrorResponse class. + */ + private ArmResponseErrorResponse() { + } + + /** + * Get the body property: The body type of the operation request or response. + * + * @return the body value. + */ + public ManagementError body() { + return this.body; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("body", this.body); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ArmResponseErrorResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ArmResponseErrorResponse if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ArmResponseErrorResponse. + */ + public static ArmResponseErrorResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ArmResponseErrorResponse deserializedArmResponseErrorResponse = new ArmResponseErrorResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("body".equals(fieldName)) { + deserializedArmResponseErrorResponse.body = ManagementError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedArmResponseErrorResponse; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AssetPropertiesOfDrill.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AssetPropertiesOfDrill.java new file mode 100644 index 000000000000..03bb3549c641 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AssetPropertiesOfDrill.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Drill asset properties. + */ +@Fluent +public final class AssetPropertiesOfDrill implements JsonSerializable { + /* + * Subscription where Drill's internal resources will be created. + */ + private String subscription; + + /* + * Region where Drill's internal resources will be created. + */ + private String region; + + /* + * Resource group where Drill's internal resources will be created. If not specified, defaults to + * 'AzureResilienceManagementDrills'. This value is immutable after drill creation. + */ + private String resourceGroup; + + /** + * Creates an instance of AssetPropertiesOfDrill class. + */ + public AssetPropertiesOfDrill() { + } + + /** + * Get the subscription property: Subscription where Drill's internal resources will be created. + * + * @return the subscription value. + */ + public String subscription() { + return this.subscription; + } + + /** + * Set the subscription property: Subscription where Drill's internal resources will be created. + * + * @param subscription the subscription value to set. + * @return the AssetPropertiesOfDrill object itself. + */ + public AssetPropertiesOfDrill withSubscription(String subscription) { + this.subscription = subscription; + return this; + } + + /** + * Get the region property: Region where Drill's internal resources will be created. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Set the region property: Region where Drill's internal resources will be created. + * + * @param region the region value to set. + * @return the AssetPropertiesOfDrill object itself. + */ + public AssetPropertiesOfDrill withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the resourceGroup property: Resource group where Drill's internal resources will be created. If not + * specified, defaults to 'AzureResilienceManagementDrills'. This value is immutable after drill creation. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resourceGroup property: Resource group where Drill's internal resources will be created. If not + * specified, defaults to 'AzureResilienceManagementDrills'. This value is immutable after drill creation. + * + * @param resourceGroup the resourceGroup value to set. + * @return the AssetPropertiesOfDrill object itself. + */ + public AssetPropertiesOfDrill withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subscription", this.subscription); + jsonWriter.writeStringField("region", this.region); + jsonWriter.writeStringField("resourceGroup", this.resourceGroup); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssetPropertiesOfDrill from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssetPropertiesOfDrill if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AssetPropertiesOfDrill. + */ + public static AssetPropertiesOfDrill fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssetPropertiesOfDrill deserializedAssetPropertiesOfDrill = new AssetPropertiesOfDrill(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subscription".equals(fieldName)) { + deserializedAssetPropertiesOfDrill.subscription = reader.getString(); + } else if ("region".equals(fieldName)) { + deserializedAssetPropertiesOfDrill.region = reader.getString(); + } else if ("resourceGroup".equals(fieldName)) { + deserializedAssetPropertiesOfDrill.resourceGroup = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAssetPropertiesOfDrill; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AssociatedIdentity.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AssociatedIdentity.java new file mode 100644 index 000000000000..77b807814210 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AssociatedIdentity.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of associated identity linked with the various resources. + */ +@Fluent +public final class AssociatedIdentity implements JsonSerializable { + /* + * Identity type linked with the resource + */ + private ManagedServiceIdentityType type; + + /* + * User assigned identity id linked with the resource + */ + private String userAssignedIdentity; + + /** + * Creates an instance of AssociatedIdentity class. + */ + public AssociatedIdentity() { + } + + /** + * Get the type property: Identity type linked with the resource. + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Identity type linked with the resource. + * + * @param type the type value to set. + * @return the AssociatedIdentity object itself. + */ + public AssociatedIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentity property: User assigned identity id linked with the resource. + * + * @return the userAssignedIdentity value. + */ + public String userAssignedIdentity() { + return this.userAssignedIdentity; + } + + /** + * Set the userAssignedIdentity property: User assigned identity id linked with the resource. + * + * @param userAssignedIdentity the userAssignedIdentity value to set. + * @return the AssociatedIdentity object itself. + */ + public AssociatedIdentity withUserAssignedIdentity(String userAssignedIdentity) { + this.userAssignedIdentity = userAssignedIdentity; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("userAssignedIdentity", this.userAssignedIdentity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssociatedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssociatedIdentity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AssociatedIdentity. + */ + public static AssociatedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssociatedIdentity deserializedAssociatedIdentity = new AssociatedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedAssociatedIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("userAssignedIdentity".equals(fieldName)) { + deserializedAssociatedIdentity.userAssignedIdentity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAssociatedIdentity; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AttentionReason.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AttentionReason.java new file mode 100644 index 000000000000..79111e99a9eb --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AttentionReason.java @@ -0,0 +1,463 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Reason why the Drill is in NeedsAttention state, and not ready to run. + */ +@Immutable +public final class AttentionReason implements JsonSerializable { + /* + * Drill object does not have the necessary RBAC to run the chaos resource. + */ + private RBACState drillRbacOnChaosResource; + + /* + * Permissions needed by the Drill MSI to run the chaos resource. + */ + private List rbacNeededForDrillOnChaosResource; + + /* + * Drill object does not have the necessary RBAC to run the Recovery Plan. + */ + private RBACState drillRbacOnRecoveryPlan; + + /* + * Permissions needed by the Drill MSI to run the Recovery Plan. + */ + private List rbacNeededForDrillOnRecoveryPlan; + + /* + * Associated RO ready or not. + */ + private RecoveryPlanState roReadiness; + + /* + * RBAC required by Chaos Resource MSI not setup on the target resources. + */ + private RBACState rbacOnTargetResources; + + /* + * RBAC required by AutomationAccount for runbook MSI not setup on the target resources. + */ + private RBACState runbookFaultRbacOnTargets; + + /* + * Chaos resource for faulting exists or not. + */ + private ExtensionObjectState chaosResource; + + /* + * Reason for Chaos Resource Creation failure + */ + private List chaosResourceCreationFailureReasons; + + /* + * Resources associated in Recovery Plan and Drill are out of sync. + */ + private RelativeResourceCompositionState recoveryPlanAndDrillResourcesState; + + /* + * Resources in Service Group and Drill are out of sync. + */ + private RelativeResourceCompositionState serviceGroupAndDrillResourcesState; + + /* + * User MSI associated with Drill object is deleted. + */ + private ExtensionObjectState drillUserMsi; + + /* + * User MSI associated with chaos resource object is deleted. + */ + private ExtensionObjectState chaosResourceUserMsi; + + /* + * Included resource in Drill. + */ + private ExtensionObjectState includedResourceInDrill; + + /* + * Drill MSI does not have the necessary RBAC to read the Drill Monitoring resources. + */ + private RBACState drillRbacOnMonitoringResources; + + /* + * Errors related to Drill Monitoring resources. + */ + private List drillMonitoringErrors; + + /* + * Monitoring Resources created for Drill + */ + private ExtensionObjectState drillMonitoringResources; + + /* + * Monitoring RBAC required by Drill MSI not setup on the target resources. + */ + private RBACState monitoringRbacOnDrillResources; + + /* + * Permissions needed by the Drill MSI to Upload service group health data for monitoring. + */ + private List rbacNeededForDrillOnDrillMonitoringResources; + + /* + * Permissions needed by the Drill MSI to read health metrics data for resources in service group. + */ + private List rbacNeededForDrillOnDrillResources; + + /* + * List of required required Azure resource providers that are not registered in the subscription specified for + * chaos resource. + */ + private List missingRequiredResourceProviders; + + /** + * Creates an instance of AttentionReason class. + */ + private AttentionReason() { + } + + /** + * Get the drillRbacOnChaosResource property: Drill object does not have the necessary RBAC to run the chaos + * resource. + * + * @return the drillRbacOnChaosResource value. + */ + public RBACState drillRbacOnChaosResource() { + return this.drillRbacOnChaosResource; + } + + /** + * Get the rbacNeededForDrillOnChaosResource property: Permissions needed by the Drill MSI to run the chaos + * resource. + * + * @return the rbacNeededForDrillOnChaosResource value. + */ + public List rbacNeededForDrillOnChaosResource() { + return this.rbacNeededForDrillOnChaosResource; + } + + /** + * Get the drillRbacOnRecoveryPlan property: Drill object does not have the necessary RBAC to run the Recovery Plan. + * + * @return the drillRbacOnRecoveryPlan value. + */ + public RBACState drillRbacOnRecoveryPlan() { + return this.drillRbacOnRecoveryPlan; + } + + /** + * Get the rbacNeededForDrillOnRecoveryPlan property: Permissions needed by the Drill MSI to run the Recovery Plan. + * + * @return the rbacNeededForDrillOnRecoveryPlan value. + */ + public List rbacNeededForDrillOnRecoveryPlan() { + return this.rbacNeededForDrillOnRecoveryPlan; + } + + /** + * Get the roReadiness property: Associated RO ready or not. + * + * @return the roReadiness value. + */ + public RecoveryPlanState roReadiness() { + return this.roReadiness; + } + + /** + * Get the rbacOnTargetResources property: RBAC required by Chaos Resource MSI not setup on the target resources. + * + * @return the rbacOnTargetResources value. + */ + public RBACState rbacOnTargetResources() { + return this.rbacOnTargetResources; + } + + /** + * Get the runbookFaultRbacOnTargets property: RBAC required by AutomationAccount for runbook MSI not setup on the + * target resources. + * + * @return the runbookFaultRbacOnTargets value. + */ + public RBACState runbookFaultRbacOnTargets() { + return this.runbookFaultRbacOnTargets; + } + + /** + * Get the chaosResource property: Chaos resource for faulting exists or not. + * + * @return the chaosResource value. + */ + public ExtensionObjectState chaosResource() { + return this.chaosResource; + } + + /** + * Get the chaosResourceCreationFailureReasons property: Reason for Chaos Resource Creation failure. + * + * @return the chaosResourceCreationFailureReasons value. + */ + public List chaosResourceCreationFailureReasons() { + return this.chaosResourceCreationFailureReasons; + } + + /** + * Get the recoveryPlanAndDrillResourcesState property: Resources associated in Recovery Plan and Drill are out of + * sync. + * + * @return the recoveryPlanAndDrillResourcesState value. + */ + public RelativeResourceCompositionState recoveryPlanAndDrillResourcesState() { + return this.recoveryPlanAndDrillResourcesState; + } + + /** + * Get the serviceGroupAndDrillResourcesState property: Resources in Service Group and Drill are out of sync. + * + * @return the serviceGroupAndDrillResourcesState value. + */ + public RelativeResourceCompositionState serviceGroupAndDrillResourcesState() { + return this.serviceGroupAndDrillResourcesState; + } + + /** + * Get the drillUserMsi property: User MSI associated with Drill object is deleted. + * + * @return the drillUserMsi value. + */ + public ExtensionObjectState drillUserMsi() { + return this.drillUserMsi; + } + + /** + * Get the chaosResourceUserMsi property: User MSI associated with chaos resource object is deleted. + * + * @return the chaosResourceUserMsi value. + */ + public ExtensionObjectState chaosResourceUserMsi() { + return this.chaosResourceUserMsi; + } + + /** + * Get the includedResourceInDrill property: Included resource in Drill. + * + * @return the includedResourceInDrill value. + */ + public ExtensionObjectState includedResourceInDrill() { + return this.includedResourceInDrill; + } + + /** + * Get the drillRbacOnMonitoringResources property: Drill MSI does not have the necessary RBAC to read the Drill + * Monitoring resources. + * + * @return the drillRbacOnMonitoringResources value. + */ + public RBACState drillRbacOnMonitoringResources() { + return this.drillRbacOnMonitoringResources; + } + + /** + * Get the drillMonitoringErrors property: Errors related to Drill Monitoring resources. + * + * @return the drillMonitoringErrors value. + */ + public List drillMonitoringErrors() { + return this.drillMonitoringErrors; + } + + /** + * Get the drillMonitoringResources property: Monitoring Resources created for Drill. + * + * @return the drillMonitoringResources value. + */ + public ExtensionObjectState drillMonitoringResources() { + return this.drillMonitoringResources; + } + + /** + * Get the monitoringRbacOnDrillResources property: Monitoring RBAC required by Drill MSI not setup on the target + * resources. + * + * @return the monitoringRbacOnDrillResources value. + */ + public RBACState monitoringRbacOnDrillResources() { + return this.monitoringRbacOnDrillResources; + } + + /** + * Get the rbacNeededForDrillOnDrillMonitoringResources property: Permissions needed by the Drill MSI to Upload + * service group health data for monitoring. + * + * @return the rbacNeededForDrillOnDrillMonitoringResources value. + */ + public List rbacNeededForDrillOnDrillMonitoringResources() { + return this.rbacNeededForDrillOnDrillMonitoringResources; + } + + /** + * Get the rbacNeededForDrillOnDrillResources property: Permissions needed by the Drill MSI to read health metrics + * data for resources in service group. + * + * @return the rbacNeededForDrillOnDrillResources value. + */ + public List rbacNeededForDrillOnDrillResources() { + return this.rbacNeededForDrillOnDrillResources; + } + + /** + * Get the missingRequiredResourceProviders property: List of required required Azure resource providers that are + * not registered in the subscription specified for chaos resource. + * + * @return the missingRequiredResourceProviders value. + */ + public List missingRequiredResourceProviders() { + return this.missingRequiredResourceProviders; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("drillRbacOnChaosResource", + this.drillRbacOnChaosResource == null ? null : this.drillRbacOnChaosResource.toString()); + jsonWriter.writeArrayField("rbacNeededForDrillOnChaosResource", this.rbacNeededForDrillOnChaosResource, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("drillRbacOnRecoveryPlan", + this.drillRbacOnRecoveryPlan == null ? null : this.drillRbacOnRecoveryPlan.toString()); + jsonWriter.writeArrayField("rbacNeededForDrillOnRecoveryPlan", this.rbacNeededForDrillOnRecoveryPlan, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("roReadiness", this.roReadiness == null ? null : this.roReadiness.toString()); + jsonWriter.writeStringField("rbacOnTargetResources", + this.rbacOnTargetResources == null ? null : this.rbacOnTargetResources.toString()); + jsonWriter.writeStringField("runbookFaultRbacOnTargets", + this.runbookFaultRbacOnTargets == null ? null : this.runbookFaultRbacOnTargets.toString()); + jsonWriter.writeStringField("chaosResource", this.chaosResource == null ? null : this.chaosResource.toString()); + jsonWriter.writeArrayField("chaosResourceCreationFailureReasons", this.chaosResourceCreationFailureReasons, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("recoveryPlanAndDrillResourcesState", + this.recoveryPlanAndDrillResourcesState == null + ? null + : this.recoveryPlanAndDrillResourcesState.toString()); + jsonWriter.writeStringField("serviceGroupAndDrillResourcesState", + this.serviceGroupAndDrillResourcesState == null + ? null + : this.serviceGroupAndDrillResourcesState.toString()); + jsonWriter.writeStringField("drillUserMsi", this.drillUserMsi == null ? null : this.drillUserMsi.toString()); + jsonWriter.writeStringField("chaosResourceUserMsi", + this.chaosResourceUserMsi == null ? null : this.chaosResourceUserMsi.toString()); + jsonWriter.writeStringField("includedResourceInDrill", + this.includedResourceInDrill == null ? null : this.includedResourceInDrill.toString()); + jsonWriter.writeStringField("drillRbacOnMonitoringResources", + this.drillRbacOnMonitoringResources == null ? null : this.drillRbacOnMonitoringResources.toString()); + jsonWriter.writeArrayField("drillMonitoringErrors", this.drillMonitoringErrors, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("monitoringRbacOnDrillResources", + this.monitoringRbacOnDrillResources == null ? null : this.monitoringRbacOnDrillResources.toString()); + jsonWriter.writeArrayField("rbacNeededForDrillOnDrillMonitoringResources", + this.rbacNeededForDrillOnDrillMonitoringResources, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("rbacNeededForDrillOnDrillResources", this.rbacNeededForDrillOnDrillResources, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("missingRequiredResourceProviders", this.missingRequiredResourceProviders, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AttentionReason from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AttentionReason if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AttentionReason. + */ + public static AttentionReason fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AttentionReason deserializedAttentionReason = new AttentionReason(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("drillRbacOnChaosResource".equals(fieldName)) { + deserializedAttentionReason.drillRbacOnChaosResource = RBACState.fromString(reader.getString()); + } else if ("rbacNeededForDrillOnChaosResource".equals(fieldName)) { + List rbacNeededForDrillOnChaosResource = reader.readArray(reader1 -> reader1.getString()); + deserializedAttentionReason.rbacNeededForDrillOnChaosResource = rbacNeededForDrillOnChaosResource; + } else if ("drillRbacOnRecoveryPlan".equals(fieldName)) { + deserializedAttentionReason.drillRbacOnRecoveryPlan = RBACState.fromString(reader.getString()); + } else if ("rbacNeededForDrillOnRecoveryPlan".equals(fieldName)) { + List rbacNeededForDrillOnRecoveryPlan = reader.readArray(reader1 -> reader1.getString()); + deserializedAttentionReason.rbacNeededForDrillOnRecoveryPlan = rbacNeededForDrillOnRecoveryPlan; + } else if ("roReadiness".equals(fieldName)) { + deserializedAttentionReason.roReadiness = RecoveryPlanState.fromString(reader.getString()); + } else if ("rbacOnTargetResources".equals(fieldName)) { + deserializedAttentionReason.rbacOnTargetResources = RBACState.fromString(reader.getString()); + } else if ("runbookFaultRbacOnTargets".equals(fieldName)) { + deserializedAttentionReason.runbookFaultRbacOnTargets = RBACState.fromString(reader.getString()); + } else if ("chaosResource".equals(fieldName)) { + deserializedAttentionReason.chaosResource = ExtensionObjectState.fromString(reader.getString()); + } else if ("chaosResourceCreationFailureReasons".equals(fieldName)) { + List chaosResourceCreationFailureReasons = reader.readArray(reader1 -> reader1.getString()); + deserializedAttentionReason.chaosResourceCreationFailureReasons + = chaosResourceCreationFailureReasons; + } else if ("recoveryPlanAndDrillResourcesState".equals(fieldName)) { + deserializedAttentionReason.recoveryPlanAndDrillResourcesState + = RelativeResourceCompositionState.fromString(reader.getString()); + } else if ("serviceGroupAndDrillResourcesState".equals(fieldName)) { + deserializedAttentionReason.serviceGroupAndDrillResourcesState + = RelativeResourceCompositionState.fromString(reader.getString()); + } else if ("drillUserMsi".equals(fieldName)) { + deserializedAttentionReason.drillUserMsi = ExtensionObjectState.fromString(reader.getString()); + } else if ("chaosResourceUserMsi".equals(fieldName)) { + deserializedAttentionReason.chaosResourceUserMsi + = ExtensionObjectState.fromString(reader.getString()); + } else if ("includedResourceInDrill".equals(fieldName)) { + deserializedAttentionReason.includedResourceInDrill + = ExtensionObjectState.fromString(reader.getString()); + } else if ("drillRbacOnMonitoringResources".equals(fieldName)) { + deserializedAttentionReason.drillRbacOnMonitoringResources + = RBACState.fromString(reader.getString()); + } else if ("drillMonitoringErrors".equals(fieldName)) { + List drillMonitoringErrors + = reader.readArray(reader1 -> ErrorDetails.fromJson(reader1)); + deserializedAttentionReason.drillMonitoringErrors = drillMonitoringErrors; + } else if ("drillMonitoringResources".equals(fieldName)) { + deserializedAttentionReason.drillMonitoringResources + = ExtensionObjectState.fromString(reader.getString()); + } else if ("monitoringRbacOnDrillResources".equals(fieldName)) { + deserializedAttentionReason.monitoringRbacOnDrillResources + = RBACState.fromString(reader.getString()); + } else if ("rbacNeededForDrillOnDrillMonitoringResources".equals(fieldName)) { + List rbacNeededForDrillOnDrillMonitoringResources + = reader.readArray(reader1 -> reader1.getString()); + deserializedAttentionReason.rbacNeededForDrillOnDrillMonitoringResources + = rbacNeededForDrillOnDrillMonitoringResources; + } else if ("rbacNeededForDrillOnDrillResources".equals(fieldName)) { + List rbacNeededForDrillOnDrillResources = reader.readArray(reader1 -> reader1.getString()); + deserializedAttentionReason.rbacNeededForDrillOnDrillResources = rbacNeededForDrillOnDrillResources; + } else if ("missingRequiredResourceProviders".equals(fieldName)) { + List missingRequiredResourceProviders = reader.readArray(reader1 -> reader1.getString()); + deserializedAttentionReason.missingRequiredResourceProviders = missingRequiredResourceProviders; + } else { + reader.skipChildren(); + } + } + + return deserializedAttentionReason; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AttestationState.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AttestationState.java new file mode 100644 index 000000000000..75cc509d28fc --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AttestationState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum for the attestation status of the resource in the goal. + */ +public final class AttestationState extends ExpandableStringEnum { + /** + * Resource is not manually attested. + */ + public static final AttestationState NOT_ATTESTED = fromString("NotAttested"); + + /** + * Resource is manually attested. + */ + public static final AttestationState MANUALLY_ATTESTED = fromString("ManuallyAttested"); + + /** + * Creates a new instance of AttestationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AttestationState() { + } + + /** + * Creates or finds a AttestationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AttestationState. + */ + public static AttestationState fromString(String name) { + return fromString(name, AttestationState.class); + } + + /** + * Gets known AttestationState values. + * + * @return known AttestationState values. + */ + public static Collection values() { + return values(AttestationState.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AutoFailover.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AutoFailover.java new file mode 100644 index 000000000000..c91e80026e85 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AutoFailover.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum for AutoFailover. + */ +public final class AutoFailover extends ExpandableStringEnum { + /** + * Enable AutoFailover. + */ + public static final AutoFailover ENABLE = fromString("Enable"); + + /** + * Disable AutoFailover. + */ + public static final AutoFailover DISABLE = fromString("Disable"); + + /** + * Creates a new instance of AutoFailover value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutoFailover() { + } + + /** + * Creates or finds a AutoFailover from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoFailover. + */ + public static AutoFailover fromString(String name) { + return fromString(name, AutoFailover.class); + } + + /** + * Gets known AutoFailover values. + * + * @return known AutoFailover values. + */ + public static Collection values() { + return values(AutoFailover.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ChaosResourcePropertiesOfDrill.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ChaosResourcePropertiesOfDrill.java new file mode 100644 index 000000000000..c58d1ad98f11 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ChaosResourcePropertiesOfDrill.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Chaos Resource properties. + */ +@Fluent +public final class ChaosResourcePropertiesOfDrill implements JsonSerializable { + /* + * Identity to use for Chaos Resource operations. + */ + private AssociatedIdentity identity; + + /* + * Identity to be used by the Chaos Resource for invoking faults on resources. + */ + private AssociatedIdentity chaosResourceIdentityForFaults; + + /* + * Chaos Resource created for this Drill + */ + private String chaosResourceId; + + /* + * Duration of faults. + */ + private Integer faultDurationInMin; + + /** + * Creates an instance of ChaosResourcePropertiesOfDrill class. + */ + public ChaosResourcePropertiesOfDrill() { + } + + /** + * Get the identity property: Identity to use for Chaos Resource operations. + * + * @return the identity value. + */ + public AssociatedIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Identity to use for Chaos Resource operations. + * + * @param identity the identity value to set. + * @return the ChaosResourcePropertiesOfDrill object itself. + */ + public ChaosResourcePropertiesOfDrill withIdentity(AssociatedIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the chaosResourceIdentityForFaults property: Identity to be used by the Chaos Resource for invoking faults on + * resources. + * + * @return the chaosResourceIdentityForFaults value. + */ + public AssociatedIdentity chaosResourceIdentityForFaults() { + return this.chaosResourceIdentityForFaults; + } + + /** + * Set the chaosResourceIdentityForFaults property: Identity to be used by the Chaos Resource for invoking faults on + * resources. + * + * @param chaosResourceIdentityForFaults the chaosResourceIdentityForFaults value to set. + * @return the ChaosResourcePropertiesOfDrill object itself. + */ + public ChaosResourcePropertiesOfDrill + withChaosResourceIdentityForFaults(AssociatedIdentity chaosResourceIdentityForFaults) { + this.chaosResourceIdentityForFaults = chaosResourceIdentityForFaults; + return this; + } + + /** + * Get the chaosResourceId property: Chaos Resource created for this Drill. + * + * @return the chaosResourceId value. + */ + public String chaosResourceId() { + return this.chaosResourceId; + } + + /** + * Get the faultDurationInMin property: Duration of faults. + * + * @return the faultDurationInMin value. + */ + public Integer faultDurationInMin() { + return this.faultDurationInMin; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("chaosResourceIdentityForFaults", this.chaosResourceIdentityForFaults); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChaosResourcePropertiesOfDrill from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChaosResourcePropertiesOfDrill if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ChaosResourcePropertiesOfDrill. + */ + public static ChaosResourcePropertiesOfDrill fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChaosResourcePropertiesOfDrill deserializedChaosResourcePropertiesOfDrill + = new ChaosResourcePropertiesOfDrill(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedChaosResourcePropertiesOfDrill.identity = AssociatedIdentity.fromJson(reader); + } else if ("chaosResourceIdentityForFaults".equals(fieldName)) { + deserializedChaosResourcePropertiesOfDrill.chaosResourceIdentityForFaults + = AssociatedIdentity.fromJson(reader); + } else if ("chaosResourceId".equals(fieldName)) { + deserializedChaosResourcePropertiesOfDrill.chaosResourceId = reader.getString(); + } else if ("faultDurationInMin".equals(fieldName)) { + deserializedChaosResourcePropertiesOfDrill.faultDurationInMin + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedChaosResourcePropertiesOfDrill; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/CommentType.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/CommentType.java new file mode 100644 index 000000000000..151377a4ea36 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/CommentType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of user comment. + */ +public final class CommentType extends ExpandableStringEnum { + /** + * A general description comment. + */ + public static final CommentType DESCRIPTION = fromString("Description"); + + /** + * A comment indicating the reason for resuming a job. + */ + public static final CommentType RESUME_REASON = fromString("ResumeReason"); + + /** + * Creates a new instance of CommentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CommentType() { + } + + /** + * Creates or finds a CommentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CommentType. + */ + public static CommentType fromString(String name) { + return fromString(name, CommentType.class); + } + + /** + * Gets known CommentType values. + * + * @return known CommentType values. + */ + public static Collection values() { + return values(CommentType.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ConfirmationStatus.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ConfirmationStatus.java new file mode 100644 index 000000000000..f6494c0acaf4 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ConfirmationStatus.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum for the confirmation status of a high availability solution. + */ +public final class ConfirmationStatus extends ExpandableStringEnum { + /** + * The high availability solution has been approved by the user. + */ + public static final ConfirmationStatus APPROVED_BY_USER = fromString("ApprovedByUser"); + + /** + * The high availability solution is pending approval from the user. + */ + public static final ConfirmationStatus APPROVAL_PENDING = fromString("ApprovalPending"); + + /** + * The high availability solution does not require user approval. + */ + public static final ConfirmationStatus APPROVAL_NOT_NEEDED = fromString("ApprovalNotNeeded"); + + /** + * The high availability solution has been rejected by the user. + */ + public static final ConfirmationStatus REJECTED_BY_USER = fromString("RejectedByUser"); + + /** + * Creates a new instance of ConfirmationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConfirmationStatus() { + } + + /** + * Creates or finds a ConfirmationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfirmationStatus. + */ + public static ConfirmationStatus fromString(String name) { + return fromString(name, ConfirmationStatus.class); + } + + /** + * Gets known ConfirmationStatus values. + * + * @return known ConfirmationStatus values. + */ + public static Collection values() { + return values(ConfirmationStatus.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/CustomFaultDetails.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/CustomFaultDetails.java new file mode 100644 index 000000000000..20ae79237cba --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/CustomFaultDetails.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Custom fault details. + */ +@Fluent +public final class CustomFaultDetails implements JsonSerializable { + /* + * fault name + */ + private String faultName; + + /* + * ID of ARM resource used for automation (e.g. Automation runbook URL). + */ + private String scriptResourceId; + + /** + * Creates an instance of CustomFaultDetails class. + */ + public CustomFaultDetails() { + } + + /** + * Get the faultName property: fault name. + * + * @return the faultName value. + */ + public String faultName() { + return this.faultName; + } + + /** + * Set the faultName property: fault name. + * + * @param faultName the faultName value to set. + * @return the CustomFaultDetails object itself. + */ + public CustomFaultDetails withFaultName(String faultName) { + this.faultName = faultName; + return this; + } + + /** + * Get the scriptResourceId property: ID of ARM resource used for automation (e.g. Automation runbook URL). + * + * @return the scriptResourceId value. + */ + public String scriptResourceId() { + return this.scriptResourceId; + } + + /** + * Set the scriptResourceId property: ID of ARM resource used for automation (e.g. Automation runbook URL). + * + * @param scriptResourceId the scriptResourceId value to set. + * @return the CustomFaultDetails object itself. + */ + public CustomFaultDetails withScriptResourceId(String scriptResourceId) { + this.scriptResourceId = scriptResourceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("faultName", this.faultName); + jsonWriter.writeStringField("scriptResourceId", this.scriptResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomFaultDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomFaultDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomFaultDetails. + */ + public static CustomFaultDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomFaultDetails deserializedCustomFaultDetails = new CustomFaultDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("faultName".equals(fieldName)) { + deserializedCustomFaultDetails.faultName = reader.getString(); + } else if ("scriptResourceId".equals(fieldName)) { + deserializedCustomFaultDetails.scriptResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomFaultDetails; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DiskReprotectInputDetails.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DiskReprotectInputDetails.java new file mode 100644 index 000000000000..a7025e3d5516 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DiskReprotectInputDetails.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Disk Reprotect Input Details. + */ +@Fluent +public final class DiskReprotectInputDetails implements JsonSerializable { + /* + * Disk Resource Id to Reprotect + */ + private String diskResourceId; + + /* + * The staging StorageAccount Resource Id. + */ + private String stagingStorageAccountResourceId; + + /** + * Creates an instance of DiskReprotectInputDetails class. + */ + public DiskReprotectInputDetails() { + } + + /** + * Get the diskResourceId property: Disk Resource Id to Reprotect. + * + * @return the diskResourceId value. + */ + public String diskResourceId() { + return this.diskResourceId; + } + + /** + * Set the diskResourceId property: Disk Resource Id to Reprotect. + * + * @param diskResourceId the diskResourceId value to set. + * @return the DiskReprotectInputDetails object itself. + */ + public DiskReprotectInputDetails withDiskResourceId(String diskResourceId) { + this.diskResourceId = diskResourceId; + return this; + } + + /** + * Get the stagingStorageAccountResourceId property: The staging StorageAccount Resource Id. + * + * @return the stagingStorageAccountResourceId value. + */ + public String stagingStorageAccountResourceId() { + return this.stagingStorageAccountResourceId; + } + + /** + * Set the stagingStorageAccountResourceId property: The staging StorageAccount Resource Id. + * + * @param stagingStorageAccountResourceId the stagingStorageAccountResourceId value to set. + * @return the DiskReprotectInputDetails object itself. + */ + public DiskReprotectInputDetails withStagingStorageAccountResourceId(String stagingStorageAccountResourceId) { + this.stagingStorageAccountResourceId = stagingStorageAccountResourceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("diskResourceId", this.diskResourceId); + jsonWriter.writeStringField("stagingStorageAccountResourceId", this.stagingStorageAccountResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiskReprotectInputDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiskReprotectInputDetails if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiskReprotectInputDetails. + */ + public static DiskReprotectInputDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiskReprotectInputDetails deserializedDiskReprotectInputDetails = new DiskReprotectInputDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("diskResourceId".equals(fieldName)) { + deserializedDiskReprotectInputDetails.diskResourceId = reader.getString(); + } else if ("stagingStorageAccountResourceId".equals(fieldName)) { + deserializedDiskReprotectInputDetails.stagingStorageAccountResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDiskReprotectInputDetails; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Drill.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Drill.java new file mode 100644 index 000000000000..044ae83876de --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Drill.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillInner; + +/** + * An immutable client-side representation of Drill. + */ +public interface Drill { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + DrillProperties properties(); + + /** + * Gets the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillInner object. + * + * @return the inner object. + */ + DrillInner innerModel(); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillAttestation.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillAttestation.java new file mode 100644 index 000000000000..a9942f5f8646 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillAttestation.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Drill Attestation status on terminating. + */ +public final class DrillAttestation extends ExpandableStringEnum { + /** + * Drill Attestation success. + */ + public static final DrillAttestation ATTESTED_SUCCESS = fromString("Success"); + + /** + * Drill Attestation failure. + */ + public static final DrillAttestation ATTESTED_FAILED = fromString("Failed"); + + /** + * Creates a new instance of DrillAttestation value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DrillAttestation() { + } + + /** + * Creates or finds a DrillAttestation from its string representation. + * + * @param name a name to look for. + * @return the corresponding DrillAttestation. + */ + public static DrillAttestation fromString(String name) { + return fromString(name, DrillAttestation.class); + } + + /** + * Gets known DrillAttestation values. + * + * @return known DrillAttestation values. + */ + public static Collection values() { + return values(DrillAttestation.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillEndRequest.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillEndRequest.java new file mode 100644 index 000000000000..9eff59fc7483 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillEndRequest.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Request body of the End Action of Drill. + */ +@Fluent +public final class DrillEndRequest implements JsonSerializable { + /* + * Attestation Status + */ + private DrillAttestation attestation; + + /* + * Notes + */ + private String attestationNotes; + + /** + * Creates an instance of DrillEndRequest class. + */ + public DrillEndRequest() { + } + + /** + * Get the attestation property: Attestation Status. + * + * @return the attestation value. + */ + public DrillAttestation attestation() { + return this.attestation; + } + + /** + * Set the attestation property: Attestation Status. + * + * @param attestation the attestation value to set. + * @return the DrillEndRequest object itself. + */ + public DrillEndRequest withAttestation(DrillAttestation attestation) { + this.attestation = attestation; + return this; + } + + /** + * Get the attestationNotes property: Notes. + * + * @return the attestationNotes value. + */ + public String attestationNotes() { + return this.attestationNotes; + } + + /** + * Set the attestationNotes property: Notes. + * + * @param attestationNotes the attestationNotes value to set. + * @return the DrillEndRequest object itself. + */ + public DrillEndRequest withAttestationNotes(String attestationNotes) { + this.attestationNotes = attestationNotes; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("attestation", this.attestation == null ? null : this.attestation.toString()); + jsonWriter.writeStringField("attestationNotes", this.attestationNotes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DrillEndRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DrillEndRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DrillEndRequest. + */ + public static DrillEndRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DrillEndRequest deserializedDrillEndRequest = new DrillEndRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attestation".equals(fieldName)) { + deserializedDrillEndRequest.attestation = DrillAttestation.fromString(reader.getString()); + } else if ("attestationNotes".equals(fieldName)) { + deserializedDrillEndRequest.attestationNotes = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDrillEndRequest; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillMode.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillMode.java new file mode 100644 index 000000000000..8b21152ecd0f --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillMode.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Start mode of Drill. + */ +public final class DrillMode extends ExpandableStringEnum { + /** + * Failover mode. + */ + public static final DrillMode FAILOVER = fromString("Failover"); + + /** + * Creates a new instance of DrillMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DrillMode() { + } + + /** + * Creates or finds a DrillMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding DrillMode. + */ + public static DrillMode fromString(String name) { + return fromString(name, DrillMode.class); + } + + /** + * Gets known DrillMode values. + * + * @return known DrillMode values. + */ + public static Collection values() { + return values(DrillMode.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillProperties.java new file mode 100644 index 000000000000..2262273a5673 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillProperties.java @@ -0,0 +1,546 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Properties of the Resiliency Drill. + */ +@Fluent +public class DrillProperties implements JsonSerializable { + /* + * The discriminator for the Drill object hierarchy. + */ + private DrillType drillType = DrillType.fromString("DrillProperties"); + + /* + * Status of the last operation. + */ + private ProvisioningState provisioningState; + + /* + * Parent SG resource. + */ + private String serviceGroupId; + + /* + * ROPlan properties. + */ + private RecoveryPlanPropertiesOfDrill recoveryPlanProperties; + + /* + * Properties for internal resources that are created for the Drill. + */ + private AssetPropertiesOfDrill drillAssetProperties; + + /* + * Chaos Resource properties. + */ + private ChaosResourcePropertiesOfDrill chaosResourceProperties; + + /* + * Execution state of the Drill. Whether it is currently running or not. + */ + private ExecutionState executionState; + + /* + * Readiness state of the Drill. + */ + private ExecutionReadinessState executionReadinessState; + + /* + * RBAC setup mode. + */ + private RBACSetupMode rbacSetupMode; + + /* + * Attention reason if the ReadinessState is 'NeedsAttention'. + */ + private AttentionReason attentionReason; + + /* + * Internal System Metadata, to be used by internal components only. + */ + private SystemMetadata systemMetadata; + + /* + * Last run properties. + */ + private LastRunProperties lastRunProperties; + + /* + * Last sync time. + */ + private OffsetDateTime lastSyncTime; + + /* + * Last resync and readiness check time. + */ + private OffsetDateTime lastResyncReadinessCheckTime; + + /* + * Managed RG v2 properties. + */ + private ManagedOnBehalfOfConfiguration managedOnBehalfOfConfiguration; + + /* + * Monitoring properties of the Drill. + */ + private MonitoringPropertiesOfDrill monitoringProperties; + + /* + * Error details associated with the resource. + */ + private ManagementError errorDetails; + + /** + * Creates an instance of DrillProperties class. + */ + public DrillProperties() { + } + + /** + * Get the drillType property: The discriminator for the Drill object hierarchy. + * + * @return the drillType value. + */ + public DrillType drillType() { + return this.drillType; + } + + /** + * Get the provisioningState property: Status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Status of the last operation. + * + * @param provisioningState the provisioningState value to set. + * @return the DrillProperties object itself. + */ + DrillProperties withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the serviceGroupId property: Parent SG resource. + * + * @return the serviceGroupId value. + */ + public String serviceGroupId() { + return this.serviceGroupId; + } + + /** + * Set the serviceGroupId property: Parent SG resource. + * + * @param serviceGroupId the serviceGroupId value to set. + * @return the DrillProperties object itself. + */ + DrillProperties withServiceGroupId(String serviceGroupId) { + this.serviceGroupId = serviceGroupId; + return this; + } + + /** + * Get the recoveryPlanProperties property: ROPlan properties. + * + * @return the recoveryPlanProperties value. + */ + public RecoveryPlanPropertiesOfDrill recoveryPlanProperties() { + return this.recoveryPlanProperties; + } + + /** + * Set the recoveryPlanProperties property: ROPlan properties. + * + * @param recoveryPlanProperties the recoveryPlanProperties value to set. + * @return the DrillProperties object itself. + */ + public DrillProperties withRecoveryPlanProperties(RecoveryPlanPropertiesOfDrill recoveryPlanProperties) { + this.recoveryPlanProperties = recoveryPlanProperties; + return this; + } + + /** + * Get the drillAssetProperties property: Properties for internal resources that are created for the Drill. + * + * @return the drillAssetProperties value. + */ + public AssetPropertiesOfDrill drillAssetProperties() { + return this.drillAssetProperties; + } + + /** + * Set the drillAssetProperties property: Properties for internal resources that are created for the Drill. + * + * @param drillAssetProperties the drillAssetProperties value to set. + * @return the DrillProperties object itself. + */ + public DrillProperties withDrillAssetProperties(AssetPropertiesOfDrill drillAssetProperties) { + this.drillAssetProperties = drillAssetProperties; + return this; + } + + /** + * Get the chaosResourceProperties property: Chaos Resource properties. + * + * @return the chaosResourceProperties value. + */ + public ChaosResourcePropertiesOfDrill chaosResourceProperties() { + return this.chaosResourceProperties; + } + + /** + * Set the chaosResourceProperties property: Chaos Resource properties. + * + * @param chaosResourceProperties the chaosResourceProperties value to set. + * @return the DrillProperties object itself. + */ + public DrillProperties withChaosResourceProperties(ChaosResourcePropertiesOfDrill chaosResourceProperties) { + this.chaosResourceProperties = chaosResourceProperties; + return this; + } + + /** + * Get the executionState property: Execution state of the Drill. Whether it is currently running or not. + * + * @return the executionState value. + */ + public ExecutionState executionState() { + return this.executionState; + } + + /** + * Set the executionState property: Execution state of the Drill. Whether it is currently running or not. + * + * @param executionState the executionState value to set. + * @return the DrillProperties object itself. + */ + DrillProperties withExecutionState(ExecutionState executionState) { + this.executionState = executionState; + return this; + } + + /** + * Get the executionReadinessState property: Readiness state of the Drill. + * + * @return the executionReadinessState value. + */ + public ExecutionReadinessState executionReadinessState() { + return this.executionReadinessState; + } + + /** + * Set the executionReadinessState property: Readiness state of the Drill. + * + * @param executionReadinessState the executionReadinessState value to set. + * @return the DrillProperties object itself. + */ + DrillProperties withExecutionReadinessState(ExecutionReadinessState executionReadinessState) { + this.executionReadinessState = executionReadinessState; + return this; + } + + /** + * Get the rbacSetupMode property: RBAC setup mode. + * + * @return the rbacSetupMode value. + */ + public RBACSetupMode rbacSetupMode() { + return this.rbacSetupMode; + } + + /** + * Set the rbacSetupMode property: RBAC setup mode. + * + * @param rbacSetupMode the rbacSetupMode value to set. + * @return the DrillProperties object itself. + */ + public DrillProperties withRbacSetupMode(RBACSetupMode rbacSetupMode) { + this.rbacSetupMode = rbacSetupMode; + return this; + } + + /** + * Get the attentionReason property: Attention reason if the ReadinessState is 'NeedsAttention'. + * + * @return the attentionReason value. + */ + public AttentionReason attentionReason() { + return this.attentionReason; + } + + /** + * Set the attentionReason property: Attention reason if the ReadinessState is 'NeedsAttention'. + * + * @param attentionReason the attentionReason value to set. + * @return the DrillProperties object itself. + */ + DrillProperties withAttentionReason(AttentionReason attentionReason) { + this.attentionReason = attentionReason; + return this; + } + + /** + * Get the systemMetadata property: Internal System Metadata, to be used by internal components only. + * + * @return the systemMetadata value. + */ + public SystemMetadata systemMetadata() { + return this.systemMetadata; + } + + /** + * Set the systemMetadata property: Internal System Metadata, to be used by internal components only. + * + * @param systemMetadata the systemMetadata value to set. + * @return the DrillProperties object itself. + */ + DrillProperties withSystemMetadata(SystemMetadata systemMetadata) { + this.systemMetadata = systemMetadata; + return this; + } + + /** + * Get the lastRunProperties property: Last run properties. + * + * @return the lastRunProperties value. + */ + public LastRunProperties lastRunProperties() { + return this.lastRunProperties; + } + + /** + * Set the lastRunProperties property: Last run properties. + * + * @param lastRunProperties the lastRunProperties value to set. + * @return the DrillProperties object itself. + */ + DrillProperties withLastRunProperties(LastRunProperties lastRunProperties) { + this.lastRunProperties = lastRunProperties; + return this; + } + + /** + * Get the lastSyncTime property: Last sync time. + * + * @return the lastSyncTime value. + */ + public OffsetDateTime lastSyncTime() { + return this.lastSyncTime; + } + + /** + * Set the lastSyncTime property: Last sync time. + * + * @param lastSyncTime the lastSyncTime value to set. + * @return the DrillProperties object itself. + */ + DrillProperties withLastSyncTime(OffsetDateTime lastSyncTime) { + this.lastSyncTime = lastSyncTime; + return this; + } + + /** + * Get the lastResyncReadinessCheckTime property: Last resync and readiness check time. + * + * @return the lastResyncReadinessCheckTime value. + */ + public OffsetDateTime lastResyncReadinessCheckTime() { + return this.lastResyncReadinessCheckTime; + } + + /** + * Set the lastResyncReadinessCheckTime property: Last resync and readiness check time. + * + * @param lastResyncReadinessCheckTime the lastResyncReadinessCheckTime value to set. + * @return the DrillProperties object itself. + */ + DrillProperties withLastResyncReadinessCheckTime(OffsetDateTime lastResyncReadinessCheckTime) { + this.lastResyncReadinessCheckTime = lastResyncReadinessCheckTime; + return this; + } + + /** + * Get the managedOnBehalfOfConfiguration property: Managed RG v2 properties. + * + * @return the managedOnBehalfOfConfiguration value. + */ + public ManagedOnBehalfOfConfiguration managedOnBehalfOfConfiguration() { + return this.managedOnBehalfOfConfiguration; + } + + /** + * Set the managedOnBehalfOfConfiguration property: Managed RG v2 properties. + * + * @param managedOnBehalfOfConfiguration the managedOnBehalfOfConfiguration value to set. + * @return the DrillProperties object itself. + */ + DrillProperties withManagedOnBehalfOfConfiguration(ManagedOnBehalfOfConfiguration managedOnBehalfOfConfiguration) { + this.managedOnBehalfOfConfiguration = managedOnBehalfOfConfiguration; + return this; + } + + /** + * Get the monitoringProperties property: Monitoring properties of the Drill. + * + * @return the monitoringProperties value. + */ + public MonitoringPropertiesOfDrill monitoringProperties() { + return this.monitoringProperties; + } + + /** + * Set the monitoringProperties property: Monitoring properties of the Drill. + * + * @param monitoringProperties the monitoringProperties value to set. + * @return the DrillProperties object itself. + */ + public DrillProperties withMonitoringProperties(MonitoringPropertiesOfDrill monitoringProperties) { + this.monitoringProperties = monitoringProperties; + return this; + } + + /** + * Get the errorDetails property: Error details associated with the resource. + * + * @return the errorDetails value. + */ + public ManagementError errorDetails() { + return this.errorDetails; + } + + /** + * Set the errorDetails property: Error details associated with the resource. + * + * @param errorDetails the errorDetails value to set. + * @return the DrillProperties object itself. + */ + DrillProperties withErrorDetails(ManagementError errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("drillType", this.drillType == null ? null : this.drillType.toString()); + jsonWriter.writeJsonField("recoveryPlanProperties", this.recoveryPlanProperties); + jsonWriter.writeJsonField("drillAssetProperties", this.drillAssetProperties); + jsonWriter.writeJsonField("chaosResourceProperties", this.chaosResourceProperties); + jsonWriter.writeStringField("rbacSetupMode", this.rbacSetupMode == null ? null : this.rbacSetupMode.toString()); + jsonWriter.writeJsonField("monitoringProperties", this.monitoringProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DrillProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DrillProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DrillProperties. + */ + public static DrillProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("drillType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Zonal".equals(discriminatorValue)) { + return ZonalDrillProperties.fromJson(readerToUse.reset()); + } else if ("Regional".equals(discriminatorValue)) { + return RegionalDrillProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DrillProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DrillProperties deserializedDrillProperties = new DrillProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("drillType".equals(fieldName)) { + deserializedDrillProperties.drillType = DrillType.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedDrillProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("serviceGroupId".equals(fieldName)) { + deserializedDrillProperties.serviceGroupId = reader.getString(); + } else if ("recoveryPlanProperties".equals(fieldName)) { + deserializedDrillProperties.recoveryPlanProperties = RecoveryPlanPropertiesOfDrill.fromJson(reader); + } else if ("drillAssetProperties".equals(fieldName)) { + deserializedDrillProperties.drillAssetProperties = AssetPropertiesOfDrill.fromJson(reader); + } else if ("chaosResourceProperties".equals(fieldName)) { + deserializedDrillProperties.chaosResourceProperties + = ChaosResourcePropertiesOfDrill.fromJson(reader); + } else if ("executionState".equals(fieldName)) { + deserializedDrillProperties.executionState = ExecutionState.fromString(reader.getString()); + } else if ("executionReadinessState".equals(fieldName)) { + deserializedDrillProperties.executionReadinessState + = ExecutionReadinessState.fromString(reader.getString()); + } else if ("rbacSetupMode".equals(fieldName)) { + deserializedDrillProperties.rbacSetupMode = RBACSetupMode.fromString(reader.getString()); + } else if ("attentionReason".equals(fieldName)) { + deserializedDrillProperties.attentionReason = AttentionReason.fromJson(reader); + } else if ("systemMetadata".equals(fieldName)) { + deserializedDrillProperties.systemMetadata = SystemMetadata.fromJson(reader); + } else if ("lastRunProperties".equals(fieldName)) { + deserializedDrillProperties.lastRunProperties = LastRunProperties.fromJson(reader); + } else if ("lastSyncTime".equals(fieldName)) { + deserializedDrillProperties.lastSyncTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastResyncReadinessCheckTime".equals(fieldName)) { + deserializedDrillProperties.lastResyncReadinessCheckTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("managedOnBehalfOfConfiguration".equals(fieldName)) { + deserializedDrillProperties.managedOnBehalfOfConfiguration + = ManagedOnBehalfOfConfiguration.fromJson(reader); + } else if ("monitoringProperties".equals(fieldName)) { + deserializedDrillProperties.monitoringProperties = MonitoringPropertiesOfDrill.fromJson(reader); + } else if ("errorDetails".equals(fieldName)) { + deserializedDrillProperties.errorDetails = ManagementError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDrillProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResource.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResource.java new file mode 100644 index 000000000000..27ef9cf5854d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResource.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillResourceInner; + +/** + * An immutable client-side representation of DrillResource. + */ +public interface DrillResource { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + DrillResourceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillResourceInner object. + * + * @return the inner object. + */ + DrillResourceInner innerModel(); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceAttentionReason.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceAttentionReason.java new file mode 100644 index 000000000000..11b8195bb379 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceAttentionReason.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Reason why the Drill resource is in NeedsAttention state. + */ +@Immutable +public final class DrillResourceAttentionReason implements JsonSerializable { + /* + * Chaos Resource MSI does not have the desired RBAC on the resource. + */ + private RBACState faultRbacOnTargetResource; + + /* + * RBAC required by AutomationAccount for runbook MSI not setup on the target resources. + */ + private RBACState runbookFaultRbacOnTargets; + + /* + * RBAC required by Drill MSI on the target resource for monitoring. + */ + private RBACState monitoringRbacOnTargets; + + /* + * Drill Resource State (wrt SG and RO). + */ + private List resourceState; + + /** + * Creates an instance of DrillResourceAttentionReason class. + */ + private DrillResourceAttentionReason() { + } + + /** + * Get the faultRbacOnTargetResource property: Chaos Resource MSI does not have the desired RBAC on the resource. + * + * @return the faultRbacOnTargetResource value. + */ + public RBACState faultRbacOnTargetResource() { + return this.faultRbacOnTargetResource; + } + + /** + * Get the runbookFaultRbacOnTargets property: RBAC required by AutomationAccount for runbook MSI not setup on the + * target resources. + * + * @return the runbookFaultRbacOnTargets value. + */ + public RBACState runbookFaultRbacOnTargets() { + return this.runbookFaultRbacOnTargets; + } + + /** + * Get the monitoringRbacOnTargets property: RBAC required by Drill MSI on the target resource for monitoring. + * + * @return the monitoringRbacOnTargets value. + */ + public RBACState monitoringRbacOnTargets() { + return this.monitoringRbacOnTargets; + } + + /** + * Get the resourceState property: Drill Resource State (wrt SG and RO). + * + * @return the resourceState value. + */ + public List resourceState() { + return this.resourceState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("faultRbacOnTargetResource", + this.faultRbacOnTargetResource == null ? null : this.faultRbacOnTargetResource.toString()); + jsonWriter.writeStringField("runbookFaultRbacOnTargets", + this.runbookFaultRbacOnTargets == null ? null : this.runbookFaultRbacOnTargets.toString()); + jsonWriter.writeStringField("monitoringRbacOnTargets", + this.monitoringRbacOnTargets == null ? null : this.monitoringRbacOnTargets.toString()); + jsonWriter.writeArrayField("resourceState", this.resourceState, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DrillResourceAttentionReason from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DrillResourceAttentionReason if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DrillResourceAttentionReason. + */ + public static DrillResourceAttentionReason fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DrillResourceAttentionReason deserializedDrillResourceAttentionReason = new DrillResourceAttentionReason(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("faultRbacOnTargetResource".equals(fieldName)) { + deserializedDrillResourceAttentionReason.faultRbacOnTargetResource + = RBACState.fromString(reader.getString()); + } else if ("runbookFaultRbacOnTargets".equals(fieldName)) { + deserializedDrillResourceAttentionReason.runbookFaultRbacOnTargets + = RBACState.fromString(reader.getString()); + } else if ("monitoringRbacOnTargets".equals(fieldName)) { + deserializedDrillResourceAttentionReason.monitoringRbacOnTargets + = RBACState.fromString(reader.getString()); + } else if ("resourceState".equals(fieldName)) { + List resourceState + = reader.readArray(reader1 -> DrillResourceState.fromString(reader1.getString())); + deserializedDrillResourceAttentionReason.resourceState = resourceState; + } else { + reader.skipChildren(); + } + } + + return deserializedDrillResourceAttentionReason; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceFaultState.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceFaultState.java new file mode 100644 index 000000000000..c8407dcf487f --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceFaultState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Drill Resource Fault State. + */ +public final class DrillResourceFaultState extends ExpandableStringEnum { + /** + * Native fault available. + */ + public static final DrillResourceFaultState SYSTEM_NATIVE = fromString("SystemNative"); + + /** + * Custom script based fault associated with resource. + */ + public static final DrillResourceFaultState CUSTOM_SCRIPT = fromString("CustomScript"); + + /** + * No fault configured for this resource. + */ + public static final DrillResourceFaultState NOT_DEFINED = fromString("NotDefined"); + + /** + * Creates a new instance of DrillResourceFaultState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DrillResourceFaultState() { + } + + /** + * Creates or finds a DrillResourceFaultState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DrillResourceFaultState. + */ + public static DrillResourceFaultState fromString(String name) { + return fromString(name, DrillResourceFaultState.class); + } + + /** + * Gets known DrillResourceFaultState values. + * + * @return known DrillResourceFaultState values. + */ + public static Collection values() { + return values(DrillResourceFaultState.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceInclusionState.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceInclusionState.java new file mode 100644 index 000000000000..114b5b80f512 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceInclusionState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Drill Resource Inclusion State. + */ +public final class DrillResourceInclusionState extends ExpandableStringEnum { + /** + * Resource excluded from Drill. + */ + public static final DrillResourceInclusionState EXCLUDED = fromString("Excluded"); + + /** + * Resource included in Drill. + */ + public static final DrillResourceInclusionState INCLUDED = fromString("Included"); + + /** + * Creates a new instance of DrillResourceInclusionState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DrillResourceInclusionState() { + } + + /** + * Creates or finds a DrillResourceInclusionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DrillResourceInclusionState. + */ + public static DrillResourceInclusionState fromString(String name) { + return fromString(name, DrillResourceInclusionState.class); + } + + /** + * Gets known DrillResourceInclusionState values. + * + * @return known DrillResourceInclusionState values. + */ + public static Collection values() { + return values(DrillResourceInclusionState.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceProperties.java new file mode 100644 index 000000000000..ad99fc8c5ed8 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceProperties.java @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the Resiliency Drill Resource. + */ +@Immutable +public final class DrillResourceProperties implements JsonSerializable { + /* + * ARM Id of the underlying resource. + */ + private String resourceId; + + /* + * Type of the Drill resource. + */ + private String resourceType; + + /* + * Active location and zones of the Azure resource. + */ + private List activeLocations; + + /* + * List of recovery locations and zones of the Azure resource. + */ + private List recoveryLocations; + + /* + * Active Resource location and physical zones of Azure Resource. + */ + private List activePhysicalZones; + + /* + * Recovery Resource location and physical zones of HA Azure Resource. + */ + private List recoveryPhysicalZones; + + /* + * Inclusion State of the Drill resource in Drill + */ + private DrillResourceInclusionState inclusionState; + + /* + * Inclusion State of the Drill resource in Recovery Plan + */ + private ResourceInclusionState recoveryPlanInclusionState; + + /* + * Exclusion reason of the Drill resource in Recovery Plan + */ + private RecoveryPlanExclusionReason recoveryPlanExclusionReason; + + /* + * Protection Solution Type of the Drill resource + */ + private ResourceProtectionSolutionType resourceProtectionSolutionType; + + /* + * Readiness State of the Drill resource + */ + private DrillResourceReadinessState readinessState; + + /* + * Fault State of the Drill resource + */ + private DrillResourceFaultState faultState; + + /* + * Fault Properties + */ + private FaultProperties faultProperties; + + /* + * ForceInclusion status for this resource. Has the customer forceIncluded it? + */ + private ForceInclusionAndUpdate forceInclusionState; + + /* + * HA status of the Drill resource + */ + private HAStatus haStatus; + + /* + * Attention reason if the Status is 'NeedsAttention'. + */ + private DrillResourceAttentionReason attentionReason; + + /* + * Recommendation Type Id for the recommendation. + */ + private String advisorRecommendationTypeId; + + /* + * Associated Advisor Recommendation link, if HA is not enabled on this resource. + */ + private String advisorHaRecommendationId; + + /* + * Last RBAC assignment error, if any. + */ + private ErrorDetails rbacAssignmentError; + + /* + * Monitoring RBAC assignment error, if any. + */ + private ErrorDetails monitoringRbacAssignmentError; + + /* + * Provisioning state + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of DrillResourceProperties class. + */ + private DrillResourceProperties() { + } + + /** + * Get the resourceId property: ARM Id of the underlying resource. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the resourceType property: Type of the Drill resource. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the activeLocations property: Active location and zones of the Azure resource. + * + * @return the activeLocations value. + */ + public List activeLocations() { + return this.activeLocations; + } + + /** + * Get the recoveryLocations property: List of recovery locations and zones of the Azure resource. + * + * @return the recoveryLocations value. + */ + public List recoveryLocations() { + return this.recoveryLocations; + } + + /** + * Get the activePhysicalZones property: Active Resource location and physical zones of Azure Resource. + * + * @return the activePhysicalZones value. + */ + public List activePhysicalZones() { + return this.activePhysicalZones; + } + + /** + * Get the recoveryPhysicalZones property: Recovery Resource location and physical zones of HA Azure Resource. + * + * @return the recoveryPhysicalZones value. + */ + public List recoveryPhysicalZones() { + return this.recoveryPhysicalZones; + } + + /** + * Get the inclusionState property: Inclusion State of the Drill resource in Drill. + * + * @return the inclusionState value. + */ + public DrillResourceInclusionState inclusionState() { + return this.inclusionState; + } + + /** + * Get the recoveryPlanInclusionState property: Inclusion State of the Drill resource in Recovery Plan. + * + * @return the recoveryPlanInclusionState value. + */ + public ResourceInclusionState recoveryPlanInclusionState() { + return this.recoveryPlanInclusionState; + } + + /** + * Get the recoveryPlanExclusionReason property: Exclusion reason of the Drill resource in Recovery Plan. + * + * @return the recoveryPlanExclusionReason value. + */ + public RecoveryPlanExclusionReason recoveryPlanExclusionReason() { + return this.recoveryPlanExclusionReason; + } + + /** + * Get the resourceProtectionSolutionType property: Protection Solution Type of the Drill resource. + * + * @return the resourceProtectionSolutionType value. + */ + public ResourceProtectionSolutionType resourceProtectionSolutionType() { + return this.resourceProtectionSolutionType; + } + + /** + * Get the readinessState property: Readiness State of the Drill resource. + * + * @return the readinessState value. + */ + public DrillResourceReadinessState readinessState() { + return this.readinessState; + } + + /** + * Get the faultState property: Fault State of the Drill resource. + * + * @return the faultState value. + */ + public DrillResourceFaultState faultState() { + return this.faultState; + } + + /** + * Get the faultProperties property: Fault Properties. + * + * @return the faultProperties value. + */ + public FaultProperties faultProperties() { + return this.faultProperties; + } + + /** + * Get the forceInclusionState property: ForceInclusion status for this resource. Has the customer forceIncluded + * it?. + * + * @return the forceInclusionState value. + */ + public ForceInclusionAndUpdate forceInclusionState() { + return this.forceInclusionState; + } + + /** + * Get the haStatus property: HA status of the Drill resource. + * + * @return the haStatus value. + */ + public HAStatus haStatus() { + return this.haStatus; + } + + /** + * Get the attentionReason property: Attention reason if the Status is 'NeedsAttention'. + * + * @return the attentionReason value. + */ + public DrillResourceAttentionReason attentionReason() { + return this.attentionReason; + } + + /** + * Get the advisorRecommendationTypeId property: Recommendation Type Id for the recommendation. + * + * @return the advisorRecommendationTypeId value. + */ + public String advisorRecommendationTypeId() { + return this.advisorRecommendationTypeId; + } + + /** + * Get the advisorHaRecommendationId property: Associated Advisor Recommendation link, if HA is not enabled on this + * resource. + * + * @return the advisorHaRecommendationId value. + */ + public String advisorHaRecommendationId() { + return this.advisorHaRecommendationId; + } + + /** + * Get the rbacAssignmentError property: Last RBAC assignment error, if any. + * + * @return the rbacAssignmentError value. + */ + public ErrorDetails rbacAssignmentError() { + return this.rbacAssignmentError; + } + + /** + * Get the monitoringRbacAssignmentError property: Monitoring RBAC assignment error, if any. + * + * @return the monitoringRbacAssignmentError value. + */ + public ErrorDetails monitoringRbacAssignmentError() { + return this.monitoringRbacAssignmentError; + } + + /** + * Get the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("resourceType", this.resourceType); + jsonWriter.writeStringField("inclusionState", + this.inclusionState == null ? null : this.inclusionState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DrillResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DrillResourceProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DrillResourceProperties. + */ + public static DrillResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DrillResourceProperties deserializedDrillResourceProperties = new DrillResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedDrillResourceProperties.resourceId = reader.getString(); + } else if ("resourceType".equals(fieldName)) { + deserializedDrillResourceProperties.resourceType = reader.getString(); + } else if ("activeLocations".equals(fieldName)) { + List activeLocations = reader.readArray(reader1 -> reader1.getString()); + deserializedDrillResourceProperties.activeLocations = activeLocations; + } else if ("recoveryLocations".equals(fieldName)) { + List recoveryLocations = reader.readArray(reader1 -> reader1.getString()); + deserializedDrillResourceProperties.recoveryLocations = recoveryLocations; + } else if ("activePhysicalZones".equals(fieldName)) { + List activePhysicalZones = reader.readArray(reader1 -> reader1.getString()); + deserializedDrillResourceProperties.activePhysicalZones = activePhysicalZones; + } else if ("recoveryPhysicalZones".equals(fieldName)) { + List recoveryPhysicalZones = reader.readArray(reader1 -> reader1.getString()); + deserializedDrillResourceProperties.recoveryPhysicalZones = recoveryPhysicalZones; + } else if ("inclusionState".equals(fieldName)) { + deserializedDrillResourceProperties.inclusionState + = DrillResourceInclusionState.fromString(reader.getString()); + } else if ("recoveryPlanInclusionState".equals(fieldName)) { + deserializedDrillResourceProperties.recoveryPlanInclusionState + = ResourceInclusionState.fromString(reader.getString()); + } else if ("recoveryPlanExclusionReason".equals(fieldName)) { + deserializedDrillResourceProperties.recoveryPlanExclusionReason + = RecoveryPlanExclusionReason.fromString(reader.getString()); + } else if ("resourceProtectionSolutionType".equals(fieldName)) { + deserializedDrillResourceProperties.resourceProtectionSolutionType + = ResourceProtectionSolutionType.fromString(reader.getString()); + } else if ("readinessState".equals(fieldName)) { + deserializedDrillResourceProperties.readinessState + = DrillResourceReadinessState.fromString(reader.getString()); + } else if ("faultState".equals(fieldName)) { + deserializedDrillResourceProperties.faultState + = DrillResourceFaultState.fromString(reader.getString()); + } else if ("faultProperties".equals(fieldName)) { + deserializedDrillResourceProperties.faultProperties = FaultProperties.fromJson(reader); + } else if ("forceInclusionState".equals(fieldName)) { + deserializedDrillResourceProperties.forceInclusionState + = ForceInclusionAndUpdate.fromString(reader.getString()); + } else if ("haStatus".equals(fieldName)) { + deserializedDrillResourceProperties.haStatus = HAStatus.fromString(reader.getString()); + } else if ("attentionReason".equals(fieldName)) { + deserializedDrillResourceProperties.attentionReason = DrillResourceAttentionReason.fromJson(reader); + } else if ("advisorRecommendationTypeId".equals(fieldName)) { + deserializedDrillResourceProperties.advisorRecommendationTypeId = reader.getString(); + } else if ("advisorHaRecommendationId".equals(fieldName)) { + deserializedDrillResourceProperties.advisorHaRecommendationId = reader.getString(); + } else if ("rbacAssignmentError".equals(fieldName)) { + deserializedDrillResourceProperties.rbacAssignmentError = ErrorDetails.fromJson(reader); + } else if ("monitoringRbacAssignmentError".equals(fieldName)) { + deserializedDrillResourceProperties.monitoringRbacAssignmentError = ErrorDetails.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedDrillResourceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDrillResourceProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceReadinessState.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceReadinessState.java new file mode 100644 index 000000000000..ee271535c3bf --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceReadinessState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Drill Resource Readiness State. + */ +public final class DrillResourceReadinessState extends ExpandableStringEnum { + /** + * Resource ready. + */ + public static final DrillResourceReadinessState READY = fromString("Ready"); + + /** + * Resource needs attention. + */ + public static final DrillResourceReadinessState NEEDS_ATTENTION = fromString("NeedsAttention"); + + /** + * Creates a new instance of DrillResourceReadinessState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DrillResourceReadinessState() { + } + + /** + * Creates or finds a DrillResourceReadinessState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DrillResourceReadinessState. + */ + public static DrillResourceReadinessState fromString(String name) { + return fromString(name, DrillResourceReadinessState.class); + } + + /** + * Gets known DrillResourceReadinessState values. + * + * @return known DrillResourceReadinessState values. + */ + public static Collection values() { + return values(DrillResourceReadinessState.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceState.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceState.java new file mode 100644 index 000000000000..099589aa1ef7 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceState.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Drill Resource State (wrt SG and RO). + */ +public final class DrillResourceState extends ExpandableStringEnum { + /** + * Resource is in SG but not part of the Drill. + */ + public static final DrillResourceState IN_SERVICE_GROUP_NOT_IN_DRILL = fromString("InServiceGroupNotInDrill"); + + /** + * Resource is in Drill but not part of the SG. + */ + public static final DrillResourceState IN_DRILL_NOT_IN_SERVICE_GROUP = fromString("InDrillNotInServiceGroup"); + + /** + * Resource is in RecoveryPlan but not part of the Drill. + */ + public static final DrillResourceState IN_RECOVERY_PLAN_NOT_IN_DRILL = fromString("InRecoveryPlanNotInDrill"); + + /** + * Resource is in Drill but not part of the RecoveryPlan. + */ + public static final DrillResourceState IN_DRILL_NOT_IN_RECOVERY_PLAN = fromString("InDrillNotInRecoveryPlan"); + + /** + * Resource is not in a state where it can be faulted. + */ + public static final DrillResourceState RESOURCE_STATE_INCOMPATIBLE_WITH_FAULT + = fromString("ResourceStateIncompatibleWithFault"); + + /** + * Creates a new instance of DrillResourceState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DrillResourceState() { + } + + /** + * Creates or finds a DrillResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DrillResourceState. + */ + public static DrillResourceState fromString(String name) { + return fromString(name, DrillResourceState.class); + } + + /** + * Gets known DrillResourceState values. + * + * @return known DrillResourceState values. + */ + public static Collection values() { + return values(DrillResourceState.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResources.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResources.java new file mode 100644 index 000000000000..5ab164013240 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResources.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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 DrillResources. + */ +public interface DrillResources { + /** + * Get a DrillResource. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillResourceName The name of the DrillResource (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 DrillResource along with {@link Response}. + */ + Response getWithResponse(String serviceGroupName, String drillName, String drillResourceName, + Context context); + + /** + * Get a DrillResource. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillResourceName The name of the DrillResource (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 DrillResource. + */ + DrillResource get(String serviceGroupName, String drillName, String drillResourceName); + + /** + * List DrillResource resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName, String drillName); + + /** + * List DrillResource resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName, String drillName, String skipToken, Integer top, + Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRun.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRun.java new file mode 100644 index 000000000000..b5a7d4206b9d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRun.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillRunInner; + +/** + * An immutable client-side representation of DrillRun. + */ +public interface DrillRun { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + DrillRunProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillRunInner object. + * + * @return the inner object. + */ + DrillRunInner innerModel(); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunAddNotesRequest.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunAddNotesRequest.java new file mode 100644 index 000000000000..7d15785b484c --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunAddNotesRequest.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Request body for AddNotes API. + */ +@Fluent +public final class DrillRunAddNotesRequest implements JsonSerializable { + /* + * The notes string. + */ + private String notes; + + /* + * System generated current Timestamp. + */ + private OffsetDateTime timestamp; + + /* + * System generated Object Id of the notes author. + */ + private String author; + + /** + * Creates an instance of DrillRunAddNotesRequest class. + */ + public DrillRunAddNotesRequest() { + } + + /** + * Get the notes property: The notes string. + * + * @return the notes value. + */ + public String notes() { + return this.notes; + } + + /** + * Set the notes property: The notes string. + * + * @param notes the notes value to set. + * @return the DrillRunAddNotesRequest object itself. + */ + public DrillRunAddNotesRequest withNotes(String notes) { + this.notes = notes; + return this; + } + + /** + * Get the timestamp property: System generated current Timestamp. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Get the author property: System generated Object Id of the notes author. + * + * @return the author value. + */ + public String author() { + return this.author; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("notes", this.notes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DrillRunAddNotesRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DrillRunAddNotesRequest if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DrillRunAddNotesRequest. + */ + public static DrillRunAddNotesRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DrillRunAddNotesRequest deserializedDrillRunAddNotesRequest = new DrillRunAddNotesRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("notes".equals(fieldName)) { + deserializedDrillRunAddNotesRequest.notes = reader.getString(); + } else if ("timestamp".equals(fieldName)) { + deserializedDrillRunAddNotesRequest.timestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("author".equals(fieldName)) { + deserializedDrillRunAddNotesRequest.author = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDrillRunAddNotesRequest; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunFailoverRequest.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunFailoverRequest.java new file mode 100644 index 000000000000..ded6f94162fe --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunFailoverRequest.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Request body for Failover API. + */ +@Fluent +public final class DrillRunFailoverRequest implements JsonSerializable { + /* + * AutoFailover - whether to pause between Fault and Failover for manual input. + */ + private AutoFailover autoFailover; + + /* + * The failover properties. + */ + private FailoverRequest failoverProperties; + + /** + * Creates an instance of DrillRunFailoverRequest class. + */ + public DrillRunFailoverRequest() { + } + + /** + * Get the autoFailover property: AutoFailover - whether to pause between Fault and Failover for manual input. + * + * @return the autoFailover value. + */ + public AutoFailover autoFailover() { + return this.autoFailover; + } + + /** + * Set the autoFailover property: AutoFailover - whether to pause between Fault and Failover for manual input. + * + * @param autoFailover the autoFailover value to set. + * @return the DrillRunFailoverRequest object itself. + */ + public DrillRunFailoverRequest withAutoFailover(AutoFailover autoFailover) { + this.autoFailover = autoFailover; + return this; + } + + /** + * Get the failoverProperties property: The failover properties. + * + * @return the failoverProperties value. + */ + public FailoverRequest failoverProperties() { + return this.failoverProperties; + } + + /** + * Set the failoverProperties property: The failover properties. + * + * @param failoverProperties the failoverProperties value to set. + * @return the DrillRunFailoverRequest object itself. + */ + public DrillRunFailoverRequest withFailoverProperties(FailoverRequest failoverProperties) { + this.failoverProperties = failoverProperties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("autoFailover", this.autoFailover == null ? null : this.autoFailover.toString()); + jsonWriter.writeJsonField("failoverProperties", this.failoverProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DrillRunFailoverRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DrillRunFailoverRequest if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DrillRunFailoverRequest. + */ + public static DrillRunFailoverRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DrillRunFailoverRequest deserializedDrillRunFailoverRequest = new DrillRunFailoverRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("autoFailover".equals(fieldName)) { + deserializedDrillRunFailoverRequest.autoFailover = AutoFailover.fromString(reader.getString()); + } else if ("failoverProperties".equals(fieldName)) { + deserializedDrillRunFailoverRequest.failoverProperties = FailoverRequest.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDrillRunFailoverRequest; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunOperationVerbs.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunOperationVerbs.java new file mode 100644 index 000000000000..9fb89b105171 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunOperationVerbs.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum for DrillRun operation actions. + */ +public final class DrillRunOperationVerbs extends ExpandableStringEnum { + /** + * Start Action. + */ + public static final DrillRunOperationVerbs START = fromString("Start"); + + /** + * Retry Action. + */ + public static final DrillRunOperationVerbs RETRY = fromString("Retry"); + + /** + * MarkAsComplete Action. + */ + public static final DrillRunOperationVerbs MARK_AS_COMPLETE = fromString("MarkAsComplete"); + + /** + * Cancel Action. + */ + public static final DrillRunOperationVerbs CANCEL = fromString("Cancel"); + + /** + * Creates a new instance of DrillRunOperationVerbs value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DrillRunOperationVerbs() { + } + + /** + * Creates or finds a DrillRunOperationVerbs from its string representation. + * + * @param name a name to look for. + * @return the corresponding DrillRunOperationVerbs. + */ + public static DrillRunOperationVerbs fromString(String name) { + return fromString(name, DrillRunOperationVerbs.class); + } + + /** + * Gets known DrillRunOperationVerbs values. + * + * @return known DrillRunOperationVerbs values. + */ + public static Collection values() { + return values(DrillRunOperationVerbs.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunProperties.java new file mode 100644 index 000000000000..63605146975a --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunProperties.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.util.List; + +/** + * Properties of the Resiliency DrillRun. + */ +@Immutable +public final class DrillRunProperties extends JobProperties { + /* + * The type of job. + */ + private JobType jobType = JobType.DRILL_RUN; + + /* + * Parent Drill resource. + */ + private String drillId; + + /* + * Drill mode. + */ + private DrillMode drillMode; + + /* + * Attestation of this Drill Run. + */ + private DrillAttestation attestation; + + /* + * Notes for this Drill. + */ + private List notes; + + /* + * Matrix of Actions supported on Operations. + */ + private List supportedVerbsForStage; + + /* + * The currently active operationID on this Drill Run. There can be only one active. + */ + private String currentActiveOperationId; + + /** + * Creates an instance of DrillRunProperties class. + */ + private DrillRunProperties() { + } + + /** + * Get the jobType property: The type of job. + * + * @return the jobType value. + */ + @Override + public JobType jobType() { + return this.jobType; + } + + /** + * Get the drillId property: Parent Drill resource. + * + * @return the drillId value. + */ + public String drillId() { + return this.drillId; + } + + /** + * Get the drillMode property: Drill mode. + * + * @return the drillMode value. + */ + public DrillMode drillMode() { + return this.drillMode; + } + + /** + * Get the attestation property: Attestation of this Drill Run. + * + * @return the attestation value. + */ + public DrillAttestation attestation() { + return this.attestation; + } + + /** + * Get the notes property: Notes for this Drill. + * + * @return the notes value. + */ + public List notes() { + return this.notes; + } + + /** + * Get the supportedVerbsForStage property: Matrix of Actions supported on Operations. + * + * @return the supportedVerbsForStage value. + */ + public List supportedVerbsForStage() { + return this.supportedVerbsForStage; + } + + /** + * Get the currentActiveOperationId property: The currently active operationID on this Drill Run. There can be only + * one active. + * + * @return the currentActiveOperationId value. + */ + public String currentActiveOperationId() { + return this.currentActiveOperationId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("errorDetails", errorDetails()); + jsonWriter.writeArrayField("retryDetails", retryDetails(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("jobExtendedInfo", jobExtendedInfo()); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DrillRunProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DrillRunProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DrillRunProperties. + */ + public static DrillRunProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DrillRunProperties deserializedDrillRunProperties = new DrillRunProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedDrillRunProperties.withStatus(JobStatus.fromString(reader.getString())); + } else if ("startTime".equals(fieldName)) { + deserializedDrillRunProperties.withStartTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("endTime".equals(fieldName)) { + deserializedDrillRunProperties.withEndTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("duration".equals(fieldName)) { + deserializedDrillRunProperties + .withDuration(reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()))); + } else if ("errorDetails".equals(fieldName)) { + deserializedDrillRunProperties.withErrorDetails(JobErrorInfo.fromJson(reader)); + } else if ("resourceId".equals(fieldName)) { + deserializedDrillRunProperties.withResourceId(reader.getString()); + } else if ("operation".equals(fieldName)) { + deserializedDrillRunProperties.withOperation(reader.getString()); + } else if ("retryDetails".equals(fieldName)) { + List retryDetails = reader.readArray(reader1 -> JobRetryDetails.fromJson(reader1)); + deserializedDrillRunProperties.withRetryDetails(retryDetails); + } else if ("jobExtendedInfo".equals(fieldName)) { + deserializedDrillRunProperties.withJobExtendedInfo(JobExtendedInfo.fromJson(reader)); + } else if ("userComments".equals(fieldName)) { + List userComments = reader.readArray(reader1 -> JobUserComment.fromJson(reader1)); + deserializedDrillRunProperties.withUserComments(userComments); + } else if ("executionConfigurations".equals(fieldName)) { + deserializedDrillRunProperties + .withExecutionConfigurations(ExecutionConfigurations.fromJson(reader)); + } else if ("triggeredBy".equals(fieldName)) { + deserializedDrillRunProperties.withTriggeredBy(JobTriggeredBy.fromString(reader.getString())); + } else if ("jobType".equals(fieldName)) { + deserializedDrillRunProperties.jobType = JobType.fromString(reader.getString()); + } else if ("drillId".equals(fieldName)) { + deserializedDrillRunProperties.drillId = reader.getString(); + } else if ("drillMode".equals(fieldName)) { + deserializedDrillRunProperties.drillMode = DrillMode.fromString(reader.getString()); + } else if ("attestation".equals(fieldName)) { + deserializedDrillRunProperties.attestation = DrillAttestation.fromString(reader.getString()); + } else if ("notes".equals(fieldName)) { + List notes = reader.readArray(reader1 -> reader1.getString()); + deserializedDrillRunProperties.notes = notes; + } else if ("supportedVerbsForStage".equals(fieldName)) { + List supportedVerbsForStage + = reader.readArray(reader1 -> SupportedVerbsForStage.fromJson(reader1)); + deserializedDrillRunProperties.supportedVerbsForStage = supportedVerbsForStage; + } else if ("currentActiveOperationId".equals(fieldName)) { + deserializedDrillRunProperties.currentActiveOperationId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDrillRunProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunResource.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunResource.java new file mode 100644 index 000000000000..ba507a827e1c --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunResource.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillRunResourceInner; + +/** + * An immutable client-side representation of DrillRunResource. + */ +public interface DrillRunResource { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + DrillRunResourceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillRunResourceInner object. + * + * @return the inner object. + */ + DrillRunResourceInner innerModel(); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunResourceProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunResourceProperties.java new file mode 100644 index 000000000000..baab678b21c0 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunResourceProperties.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.util.List; + +/** + * Properties of a Drill Run resource. + */ +@Immutable +public final class DrillRunResourceProperties extends JobResourceProperties { + /* + * Discriminator for the JobResource object hierarchy. + */ + private JobResourceType jobResourceType = JobResourceType.DRILL_RUN; + + /* + * The provisioning state of the Drill Run Resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of DrillRunResourceProperties class. + */ + private DrillRunResourceProperties() { + } + + /** + * Get the jobResourceType property: Discriminator for the JobResource object hierarchy. + * + * @return the jobResourceType value. + */ + @Override + public JobResourceType jobResourceType() { + return this.jobResourceType; + } + + /** + * Get the provisioningState property: The provisioning state of the Drill Run Resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("errorDetails", errorDetails()); + jsonWriter.writeArrayField("retryDetails", retryDetails(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("jobExtendedInfo", jobExtendedInfo()); + jsonWriter.writeStringField("jobResourceType", + this.jobResourceType == null ? null : this.jobResourceType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DrillRunResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DrillRunResourceProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DrillRunResourceProperties. + */ + public static DrillRunResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DrillRunResourceProperties deserializedDrillRunResourceProperties = new DrillRunResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedDrillRunResourceProperties.withStatus(JobStatus.fromString(reader.getString())); + } else if ("startTime".equals(fieldName)) { + deserializedDrillRunResourceProperties.withStartTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("endTime".equals(fieldName)) { + deserializedDrillRunResourceProperties.withEndTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("duration".equals(fieldName)) { + deserializedDrillRunResourceProperties + .withDuration(reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()))); + } else if ("errorDetails".equals(fieldName)) { + deserializedDrillRunResourceProperties.withErrorDetails(JobErrorInfo.fromJson(reader)); + } else if ("resourceId".equals(fieldName)) { + deserializedDrillRunResourceProperties.withResourceId(reader.getString()); + } else if ("operation".equals(fieldName)) { + deserializedDrillRunResourceProperties.withOperation(reader.getString()); + } else if ("retryDetails".equals(fieldName)) { + List retryDetails = reader.readArray(reader1 -> JobRetryDetails.fromJson(reader1)); + deserializedDrillRunResourceProperties.withRetryDetails(retryDetails); + } else if ("jobExtendedInfo".equals(fieldName)) { + deserializedDrillRunResourceProperties.withJobExtendedInfo(JobExtendedInfo.fromJson(reader)); + } else if ("userComments".equals(fieldName)) { + List userComments = reader.readArray(reader1 -> JobUserComment.fromJson(reader1)); + deserializedDrillRunResourceProperties.withUserComments(userComments); + } else if ("jobId".equals(fieldName)) { + deserializedDrillRunResourceProperties.withJobId(reader.getString()); + } else if ("taskId".equals(fieldName)) { + deserializedDrillRunResourceProperties.withTaskId(reader.getString()); + } else if ("taskName".equals(fieldName)) { + deserializedDrillRunResourceProperties.withTaskName(reader.getString()); + } else if ("jobResourceType".equals(fieldName)) { + deserializedDrillRunResourceProperties.jobResourceType + = JobResourceType.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedDrillRunResourceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDrillRunResourceProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunResources.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunResources.java new file mode 100644 index 000000000000..69deecbef32a --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunResources.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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 DrillRunResources. + */ +public interface DrillRunResources { + /** + * Get a DrillRunResource. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param drillRunResourceName The unique name (GUID) of the recovery job 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 a DrillRunResource along with {@link Response}. + */ + Response getWithResponse(String serviceGroupName, String drillName, String drillRunName, + String drillRunResourceName, Context context); + + /** + * Get a DrillRunResource. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param drillRunResourceName The unique name (GUID) of the recovery job 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 a DrillRunResource. + */ + DrillRunResource get(String serviceGroupName, String drillName, String drillRunName, String drillRunResourceName); + + /** + * List DrillRunResource resources by DrillRun. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 the response of a DrillRunResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName, String drillName, String drillRunName); + + /** + * List DrillRunResource resources by DrillRun. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillRunResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName, String drillName, String drillRunName, + Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunSubtasks.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunSubtasks.java new file mode 100644 index 000000000000..422aa0317751 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunSubtasks.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum for Drill Run Subtasks. + */ +public final class DrillRunSubtasks extends ExpandableStringEnum { + /** + * FaultInjection Subtasks. + */ + public static final DrillRunSubtasks FAULT_INJECTION = fromString("FaultInjection"); + + /** + * Failover Subtasks. + */ + public static final DrillRunSubtasks FAILOVER = fromString("Failover"); + + /** + * Reprotect Subtasks. + */ + public static final DrillRunSubtasks REPROTECT = fromString("Reprotect"); + + /** + * FailoverReverse Subtasks. + */ + public static final DrillRunSubtasks FAILOVER_REVERSE = fromString("FailoverReverse"); + + /** + * ReprotectReverse Subtasks. + */ + public static final DrillRunSubtasks REPROTECT_REVERSE = fromString("ReprotectReverse"); + + /** + * Creates a new instance of DrillRunSubtasks value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DrillRunSubtasks() { + } + + /** + * Creates or finds a DrillRunSubtasks from its string representation. + * + * @param name a name to look for. + * @return the corresponding DrillRunSubtasks. + */ + public static DrillRunSubtasks fromString(String name) { + return fromString(name, DrillRunSubtasks.class); + } + + /** + * Gets known DrillRunSubtasks values. + * + * @return known DrillRunSubtasks values. + */ + public static Collection values() { + return values(DrillRunSubtasks.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRuns.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRuns.java new file mode 100644 index 000000000000..97168df4d695 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRuns.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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 DrillRuns. + */ +public interface DrillRuns { + /** + * Get a DrillRun. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 DrillRun along with {@link Response}. + */ + Response getWithResponse(String serviceGroupName, String drillName, String drillRunName, Context context); + + /** + * Get a DrillRun. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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 DrillRun. + */ + DrillRun get(String serviceGroupName, String drillName, String drillRunName); + + /** + * List DrillRun resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillRun list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName, String drillName); + + /** + * List DrillRun resources by Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DrillRun list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName, String drillName, Context context); + + /** + * This initiates a new Failover operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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. + */ + void failOver(String serviceGroupName, String operationId, String drillName, String drillRunName, + DrillRunFailoverRequest body); + + /** + * This initiates a new Failover operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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. + */ + void failOver(String serviceGroupName, String operationId, String drillName, String drillRunName, + DrillRunFailoverRequest body, Context context); + + /** + * This initiates a new Reprotect operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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. + */ + void reprotect(String serviceGroupName, String operationId, String drillName, String drillRunName); + + /** + * This initiates a new Reprotect operation on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reprotect(String serviceGroupName, String operationId, String drillName, String drillRunName, Context context); + + /** + * This enables the user to add notes on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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. + */ + void addNotes(String serviceGroupName, String operationId, String drillName, String drillRunName, + DrillRunAddNotesRequest body); + + /** + * This enables the user to add notes on this Drill Run. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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. + */ + void addNotes(String serviceGroupName, String operationId, String drillName, String drillRunName, + DrillRunAddNotesRequest body, Context context); + + /** + * This unblocks a Failover workflow that is paused after the Fault stage, to proceed to the Failover stage. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (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. + */ + void resume(String serviceGroupName, String operationId, String drillName, String drillRunName); + + /** + * This unblocks a Failover workflow that is paused after the Fault stage, to proceed to the Failover stage. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resume(String serviceGroupName, String operationId, String drillName, String drillRunName, Context context); + + /** + * This enables the user to mark this stage as complete, disabling further retries on it. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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. + */ + void markAsComplete(String serviceGroupName, String operationId, String drillName, String drillRunName, + MarkAsCompleteRequest body); + + /** + * This enables the user to mark this stage as complete, disabling further retries on it. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param drillRunName The name of the DrillRun (GUID). + * @param body The content of the action 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. + */ + void markAsComplete(String serviceGroupName, String operationId, String drillName, String drillRunName, + MarkAsCompleteRequest body, Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillStartRequest.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillStartRequest.java new file mode 100644 index 000000000000..8fab9a76ad98 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillStartRequest.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Request body of the Start Action of Drill. + */ +@Fluent +public final class DrillStartRequest implements JsonSerializable { + /* + * Mode of starting the Drill + */ + private DrillMode mode; + + /** + * Creates an instance of DrillStartRequest class. + */ + public DrillStartRequest() { + } + + /** + * Get the mode property: Mode of starting the Drill. + * + * @return the mode value. + */ + public DrillMode mode() { + return this.mode; + } + + /** + * Set the mode property: Mode of starting the Drill. + * + * @param mode the mode value to set. + * @return the DrillStartRequest object itself. + */ + public DrillStartRequest withMode(DrillMode mode) { + this.mode = mode; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DrillStartRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DrillStartRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DrillStartRequest. + */ + public static DrillStartRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DrillStartRequest deserializedDrillStartRequest = new DrillStartRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedDrillStartRequest.mode = DrillMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDrillStartRequest; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillType.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillType.java new file mode 100644 index 000000000000..7e3e60cbea79 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum for Drill type object hierarchy. + */ +public final class DrillType extends ExpandableStringEnum { + /** + * Zonal Drill. + */ + public static final DrillType ZONAL = fromString("Zonal"); + + /** + * Regional Drill. + */ + public static final DrillType REGIONAL = fromString("Regional"); + + /** + * Creates a new instance of DrillType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DrillType() { + } + + /** + * Creates or finds a DrillType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DrillType. + */ + public static DrillType fromString(String name) { + return fromString(name, DrillType.class); + } + + /** + * Gets known DrillType values. + * + * @return known DrillType values. + */ + public static Collection values() { + return values(DrillType.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillUpdate.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillUpdate.java new file mode 100644 index 000000000000..8c08d5d44975 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillUpdate.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The type used for update operations of the Drill. + */ +@Fluent +public final class DrillUpdate implements JsonSerializable { + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /* + * The resource-specific properties for this resource. + */ + private DrillUpdateProperties properties; + + /** + * Creates an instance of DrillUpdate class. + */ + public DrillUpdate() { + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the DrillUpdate object itself. + */ + public DrillUpdate withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public DrillUpdateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the DrillUpdate object itself. + */ + public DrillUpdate withProperties(DrillUpdateProperties properties) { + this.properties = properties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DrillUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DrillUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DrillUpdate. + */ + public static DrillUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DrillUpdate deserializedDrillUpdate = new DrillUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedDrillUpdate.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedDrillUpdate.properties = DrillUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDrillUpdate; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillUpdateProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillUpdateProperties.java new file mode 100644 index 000000000000..b405f3013296 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillUpdateProperties.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The updatable properties of the Drill. + */ +@Fluent +public final class DrillUpdateProperties implements JsonSerializable { + /* + * Recovery Plan properties. + */ + private RecoveryPlanPropertiesOfDrill recoveryPlanProperties; + + /* + * Properties for internal resources that are created for the Drill. + */ + private AssetPropertiesOfDrill drillAssetProperties; + + /* + * Chaos Resource properties. + */ + private ChaosResourcePropertiesOfDrill chaosResourceProperties; + + /* + * RBAC setup mode. + */ + private RBACSetupMode rbacSetupMode; + + /* + * Monitoring properties of the Drill. + */ + private MonitoringPropertiesOfDrill monitoringProperties; + + /** + * Creates an instance of DrillUpdateProperties class. + */ + public DrillUpdateProperties() { + } + + /** + * Get the recoveryPlanProperties property: Recovery Plan properties. + * + * @return the recoveryPlanProperties value. + */ + public RecoveryPlanPropertiesOfDrill recoveryPlanProperties() { + return this.recoveryPlanProperties; + } + + /** + * Set the recoveryPlanProperties property: Recovery Plan properties. + * + * @param recoveryPlanProperties the recoveryPlanProperties value to set. + * @return the DrillUpdateProperties object itself. + */ + public DrillUpdateProperties withRecoveryPlanProperties(RecoveryPlanPropertiesOfDrill recoveryPlanProperties) { + this.recoveryPlanProperties = recoveryPlanProperties; + return this; + } + + /** + * Get the drillAssetProperties property: Properties for internal resources that are created for the Drill. + * + * @return the drillAssetProperties value. + */ + public AssetPropertiesOfDrill drillAssetProperties() { + return this.drillAssetProperties; + } + + /** + * Set the drillAssetProperties property: Properties for internal resources that are created for the Drill. + * + * @param drillAssetProperties the drillAssetProperties value to set. + * @return the DrillUpdateProperties object itself. + */ + public DrillUpdateProperties withDrillAssetProperties(AssetPropertiesOfDrill drillAssetProperties) { + this.drillAssetProperties = drillAssetProperties; + return this; + } + + /** + * Get the chaosResourceProperties property: Chaos Resource properties. + * + * @return the chaosResourceProperties value. + */ + public ChaosResourcePropertiesOfDrill chaosResourceProperties() { + return this.chaosResourceProperties; + } + + /** + * Set the chaosResourceProperties property: Chaos Resource properties. + * + * @param chaosResourceProperties the chaosResourceProperties value to set. + * @return the DrillUpdateProperties object itself. + */ + public DrillUpdateProperties withChaosResourceProperties(ChaosResourcePropertiesOfDrill chaosResourceProperties) { + this.chaosResourceProperties = chaosResourceProperties; + return this; + } + + /** + * Get the rbacSetupMode property: RBAC setup mode. + * + * @return the rbacSetupMode value. + */ + public RBACSetupMode rbacSetupMode() { + return this.rbacSetupMode; + } + + /** + * Set the rbacSetupMode property: RBAC setup mode. + * + * @param rbacSetupMode the rbacSetupMode value to set. + * @return the DrillUpdateProperties object itself. + */ + public DrillUpdateProperties withRbacSetupMode(RBACSetupMode rbacSetupMode) { + this.rbacSetupMode = rbacSetupMode; + return this; + } + + /** + * Get the monitoringProperties property: Monitoring properties of the Drill. + * + * @return the monitoringProperties value. + */ + public MonitoringPropertiesOfDrill monitoringProperties() { + return this.monitoringProperties; + } + + /** + * Set the monitoringProperties property: Monitoring properties of the Drill. + * + * @param monitoringProperties the monitoringProperties value to set. + * @return the DrillUpdateProperties object itself. + */ + public DrillUpdateProperties withMonitoringProperties(MonitoringPropertiesOfDrill monitoringProperties) { + this.monitoringProperties = monitoringProperties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("recoveryPlanProperties", this.recoveryPlanProperties); + jsonWriter.writeJsonField("drillAssetProperties", this.drillAssetProperties); + jsonWriter.writeJsonField("chaosResourceProperties", this.chaosResourceProperties); + jsonWriter.writeStringField("rbacSetupMode", this.rbacSetupMode == null ? null : this.rbacSetupMode.toString()); + jsonWriter.writeJsonField("monitoringProperties", this.monitoringProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DrillUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DrillUpdateProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DrillUpdateProperties. + */ + public static DrillUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DrillUpdateProperties deserializedDrillUpdateProperties = new DrillUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recoveryPlanProperties".equals(fieldName)) { + deserializedDrillUpdateProperties.recoveryPlanProperties + = RecoveryPlanPropertiesOfDrill.fromJson(reader); + } else if ("drillAssetProperties".equals(fieldName)) { + deserializedDrillUpdateProperties.drillAssetProperties = AssetPropertiesOfDrill.fromJson(reader); + } else if ("chaosResourceProperties".equals(fieldName)) { + deserializedDrillUpdateProperties.chaosResourceProperties + = ChaosResourcePropertiesOfDrill.fromJson(reader); + } else if ("rbacSetupMode".equals(fieldName)) { + deserializedDrillUpdateProperties.rbacSetupMode = RBACSetupMode.fromString(reader.getString()); + } else if ("monitoringProperties".equals(fieldName)) { + deserializedDrillUpdateProperties.monitoringProperties + = MonitoringPropertiesOfDrill.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDrillUpdateProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Drills.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Drills.java new file mode 100644 index 000000000000..5d088e2140a1 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Drills.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.models.DrillInner; + +/** + * Resource collection API of Drills. + */ +public interface Drills { + /** + * Get a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Drill along with {@link Response}. + */ + Response getWithResponse(String serviceGroupName, String drillName, Context context); + + /** + * Get a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Drill. + */ + Drill get(String serviceGroupName, String drillName); + + /** + * Create a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return drill resource. + */ + Drill create(String serviceGroupName, String drillName, DrillInner resource); + + /** + * Create a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return drill resource. + */ + Drill create(String serviceGroupName, String drillName, DrillInner resource, Context context); + + /** + * Update a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String drillName, DrillUpdate properties); + + /** + * Update a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String drillName, DrillUpdate properties, Context context); + + /** + * Delete a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String drillName); + + /** + * Delete a Drill. + * + * @param serviceGroupName The name of the service group. + * @param drillName The name of the Drill. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 delete(String serviceGroupName, String drillName, Context context); + + /** + * List Drill resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Drill list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName); + + /** + * List Drill resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Drill list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName, String skipToken, Integer top, Context context); + + /** + * This returns eligible resource to be faulted or failed over. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + void validateForExecution(String serviceGroupName, String operationId, String drillName, + ValidateForExecutionRequest body); + + /** + * This returns eligible resource to be faulted or failed over. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + void validateForExecution(String serviceGroupName, String operationId, String drillName, + ValidateForExecutionRequest body, Context context); + + /** + * This starts a new running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + void start(String serviceGroupName, String operationId, String drillName, DrillStartRequest body); + + /** + * This starts a new running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + void start(String serviceGroupName, String operationId, String drillName, DrillStartRequest body, Context context); + + /** + * This ends the currently running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + void end(String serviceGroupName, String operationId, String drillName, DrillEndRequest body); + + /** + * This ends the currently running instance of the Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + void end(String serviceGroupName, String operationId, String drillName, DrillEndRequest body, Context context); + + /** + * This enables the user to include, exclude or update resources from their Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + void addOrUpdateResources(String serviceGroupName, String operationId, String drillName, + AddOrUpdateResourcesRequest body); + + /** + * This enables the user to include, exclude or update resources from their Drill. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param body The content of the action 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. + */ + void addOrUpdateResources(String serviceGroupName, String operationId, String drillName, + AddOrUpdateResourcesRequest body, Context context); + + /** + * This triggers detection of any drifts from the desired state of Resources and RBAC. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resyncReadinessCheck(String serviceGroupName, String operationId, String drillName); + + /** + * This triggers detection of any drifts from the desired state of Resources and RBAC. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param drillName The name of the Drill. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resyncReadinessCheck(String serviceGroupName, String operationId, String drillName, Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Enrollment.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Enrollment.java new file mode 100644 index 000000000000..e9484516c697 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Enrollment.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.EnrollmentInner; + +/** + * An immutable client-side representation of Enrollment. + */ +public interface Enrollment { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + EnrollmentProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.resiliencemanagement.fluent.models.EnrollmentInner object. + * + * @return the inner object. + */ + EnrollmentInner innerModel(); + + /** + * The entirety of the Enrollment definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The Enrollment definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Enrollment definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the Enrollment definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, usagePlanName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @return the next definition stage. + */ + WithCreate withExistingUsagePlan(String resourceGroupName, String usagePlanName); + } + + /** + * The stage of the Enrollment 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Enrollment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Enrollment create(Context context); + } + + /** + * The stage of the Enrollment definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(EnrollmentProperties properties); + } + } + + /** + * Begins update for the Enrollment resource. + * + * @return the stage of resource update. + */ + Enrollment.Update update(); + + /** + * The template for Enrollment update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Enrollment apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Enrollment apply(Context context); + } + + /** + * The Enrollment update stages. + */ + interface UpdateStages { + /** + * The stage of the Enrollment update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(EnrollmentProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Enrollment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Enrollment refresh(Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/EnrollmentProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/EnrollmentProperties.java new file mode 100644 index 000000000000..b09291ed6a85 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/EnrollmentProperties.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of enrollment properties. + */ +@Fluent +public final class EnrollmentProperties implements JsonSerializable { + /* + * ARM resource identifier of the service group associated with this usage plan. + */ + private String serviceGroupId; + + /* + * Provisioning state of the enrollment. + */ + private ProvisioningState provisioningState; + + /* + * Details of any errors encountered during Enrollment create or update. + */ + private ManagementError errorDetails; + + /** + * Creates an instance of EnrollmentProperties class. + */ + public EnrollmentProperties() { + } + + /** + * Get the serviceGroupId property: ARM resource identifier of the service group associated with this usage plan. + * + * @return the serviceGroupId value. + */ + public String serviceGroupId() { + return this.serviceGroupId; + } + + /** + * Set the serviceGroupId property: ARM resource identifier of the service group associated with this usage plan. + * + * @param serviceGroupId the serviceGroupId value to set. + * @return the EnrollmentProperties object itself. + */ + public EnrollmentProperties withServiceGroupId(String serviceGroupId) { + this.serviceGroupId = serviceGroupId; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the enrollment. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the errorDetails property: Details of any errors encountered during Enrollment create or update. + * + * @return the errorDetails value. + */ + public ManagementError errorDetails() { + return this.errorDetails; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serviceGroupId", this.serviceGroupId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnrollmentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnrollmentProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EnrollmentProperties. + */ + public static EnrollmentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnrollmentProperties deserializedEnrollmentProperties = new EnrollmentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceGroupId".equals(fieldName)) { + deserializedEnrollmentProperties.serviceGroupId = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedEnrollmentProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("errorDetails".equals(fieldName)) { + deserializedEnrollmentProperties.errorDetails = ManagementError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEnrollmentProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Enrollments.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Enrollments.java new file mode 100644 index 000000000000..5f7fb1ee2d80 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Enrollments.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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 Enrollments. + */ +public interface Enrollments { + /** + * Get an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Enrollment along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String usagePlanName, String enrollmentName, + Context context); + + /** + * Get an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Enrollment. + */ + Enrollment get(String resourceGroupName, String usagePlanName, String enrollmentName); + + /** + * Delete an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 delete(String resourceGroupName, String usagePlanName, String enrollmentName); + + /** + * Delete an Enrollment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param enrollmentName The name of the enrollment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 delete(String resourceGroupName, String usagePlanName, String enrollmentName, Context context); + + /** + * List Enrollments by Usage Plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Enrollment list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String usagePlanName); + + /** + * List Enrollments by Usage Plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Enrollment list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String usagePlanName, Context context); + + /** + * Get an Enrollment. + * + * @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 an Enrollment along with {@link Response}. + */ + Enrollment getById(String id); + + /** + * Get an Enrollment. + * + * @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 an Enrollment along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete an Enrollment. + * + * @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 an Enrollment. + * + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Enrollment resource. + * + * @param name resource name. + * @return the first stage of the new Enrollment definition. + */ + Enrollment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ErrorDetails.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ErrorDetails.java new file mode 100644 index 000000000000..c4fbd769c08c --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ErrorDetails.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Errors in T&C / RBAC assignment. + */ +@Immutable +public final class ErrorDetails implements JsonSerializable { + /* + * Error code. + */ + private String code; + + /* + * Error message. + */ + private String message; + + /* + * A list of recommendations to resolve the error. + */ + private List recommendations; + + /** + * Creates an instance of ErrorDetails class. + */ + private ErrorDetails() { + } + + /** + * Get the code property: Error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: Error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the recommendations property: A list of recommendations to resolve the error. + * + * @return the recommendations value. + */ + public List recommendations() { + return this.recommendations; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeArrayField("recommendations", this.recommendations, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ErrorDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ErrorDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ErrorDetails. + */ + public static ErrorDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ErrorDetails deserializedErrorDetails = new ErrorDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedErrorDetails.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedErrorDetails.message = reader.getString(); + } else if ("recommendations".equals(fieldName)) { + List recommendations = reader.readArray(reader1 -> reader1.getString()); + deserializedErrorDetails.recommendations = recommendations; + } else { + reader.skipChildren(); + } + } + + return deserializedErrorDetails; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExclusionReason.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExclusionReason.java new file mode 100644 index 000000000000..5272e0fbe322 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExclusionReason.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum for the reason why a resource is excluded. + */ +public final class ExclusionReason extends ExpandableStringEnum { + /** + * The resource was excluded by user selection. + */ + public static final ExclusionReason USER_SELECTED_EXCLUSION = fromString("UserSelectedExclusion"); + + /** + * The resource failed over and is excluded. + */ + public static final ExclusionReason FAILED_OVER_RESOURCE = fromString("FailedOverResource"); + + /** + * The resource is unsupported and excluded. + */ + public static final ExclusionReason UNSUPPORTED_RESOURCE = fromString("UnsupportedResource"); + + /** + * Creates a new instance of ExclusionReason value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExclusionReason() { + } + + /** + * Creates or finds a ExclusionReason from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExclusionReason. + */ + public static ExclusionReason fromString(String name) { + return fromString(name, ExclusionReason.class); + } + + /** + * Gets known ExclusionReason values. + * + * @return known ExclusionReason values. + */ + public static Collection values() { + return values(ExclusionReason.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExclusionState.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExclusionState.java new file mode 100644 index 000000000000..c0d841bf5503 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExclusionState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum for the status of the resource in the goal. + */ +public final class ExclusionState extends ExpandableStringEnum { + /** + * Resource is not included in the goals. + */ + public static final ExclusionState EXCLUDED = fromString("Excluded"); + + /** + * Resource is excluded from the goals. + */ + public static final ExclusionState INCLUDED = fromString("Included"); + + /** + * Creates a new instance of ExclusionState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExclusionState() { + } + + /** + * Creates or finds a ExclusionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExclusionState. + */ + public static ExclusionState fromString(String name) { + return fromString(name, ExclusionState.class); + } + + /** + * Gets known ExclusionState values. + * + * @return known ExclusionState values. + */ + public static Collection values() { + return values(ExclusionState.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExecutionConfigurations.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExecutionConfigurations.java new file mode 100644 index 000000000000..e39636eaaa87 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExecutionConfigurations.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Execution configurations for recovery action. + */ +@Fluent +public final class ExecutionConfigurations implements JsonSerializable { + /* + * User consent for performing recovery action. + */ + private UserConsent userConsent; + + /** + * Creates an instance of ExecutionConfigurations class. + */ + public ExecutionConfigurations() { + } + + /** + * Get the userConsent property: User consent for performing recovery action. + * + * @return the userConsent value. + */ + public UserConsent userConsent() { + return this.userConsent; + } + + /** + * Set the userConsent property: User consent for performing recovery action. + * + * @param userConsent the userConsent value to set. + * @return the ExecutionConfigurations object itself. + */ + public ExecutionConfigurations withUserConsent(UserConsent userConsent) { + this.userConsent = userConsent; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userConsent", this.userConsent == null ? null : this.userConsent.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecutionConfigurations from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecutionConfigurations if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExecutionConfigurations. + */ + public static ExecutionConfigurations fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecutionConfigurations deserializedExecutionConfigurations = new ExecutionConfigurations(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userConsent".equals(fieldName)) { + deserializedExecutionConfigurations.userConsent = UserConsent.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedExecutionConfigurations; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExecutionReadinessState.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExecutionReadinessState.java new file mode 100644 index 000000000000..56a42f08d7ff --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExecutionReadinessState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Drill Execution Readiness State. + */ +public final class ExecutionReadinessState extends ExpandableStringEnum { + /** + * Drill is ready to run. + */ + public static final ExecutionReadinessState READY = fromString("Ready"); + + /** + * Drill is not ready to run. Details captured in AttentionReason field. + */ + public static final ExecutionReadinessState NEEDS_ATTENTION = fromString("NeedsAttention"); + + /** + * Creates a new instance of ExecutionReadinessState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExecutionReadinessState() { + } + + /** + * Creates or finds a ExecutionReadinessState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExecutionReadinessState. + */ + public static ExecutionReadinessState fromString(String name) { + return fromString(name, ExecutionReadinessState.class); + } + + /** + * Gets known ExecutionReadinessState values. + * + * @return known ExecutionReadinessState values. + */ + public static Collection values() { + return values(ExecutionReadinessState.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExecutionState.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExecutionState.java new file mode 100644 index 000000000000..2fbf5a731d57 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExecutionState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Drill Execution State. + */ +public final class ExecutionState extends ExpandableStringEnum { + /** + * Drill is not running currently. + */ + public static final ExecutionState NOT_RUNNING = fromString("NotRunning"); + + /** + * Drill is running currently. + */ + public static final ExecutionState RUNNING = fromString("Running"); + + /** + * Drill is paused, waiting for manual resume. + */ + public static final ExecutionState PAUSED = fromString("Paused"); + + /** + * Creates a new instance of ExecutionState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExecutionState() { + } + + /** + * Creates or finds a ExecutionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExecutionState. + */ + public static ExecutionState fromString(String name) { + return fromString(name, ExecutionState.class); + } + + /** + * Gets known ExecutionState values. + * + * @return known ExecutionState values. + */ + public static Collection values() { + return values(ExecutionState.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExtensionObjectState.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExtensionObjectState.java new file mode 100644 index 000000000000..248afd2d152f --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExtensionObjectState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum for AttentionReason - Extension Object State. + */ +public final class ExtensionObjectState extends ExpandableStringEnum { + /** + * Extension object exists. + */ + public static final ExtensionObjectState EXISTS = fromString("Exists"); + + /** + * Extension object not exists. + */ + public static final ExtensionObjectState NOT_EXISTS = fromString("NotExists"); + + /** + * Creates a new instance of ExtensionObjectState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExtensionObjectState() { + } + + /** + * Creates or finds a ExtensionObjectState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtensionObjectState. + */ + public static ExtensionObjectState fromString(String name) { + return fromString(name, ExtensionObjectState.class); + } + + /** + * Gets known ExtensionObjectState values. + * + * @return known ExtensionObjectState values. + */ + public static Collection values() { + return values(ExtensionObjectState.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FailoverDirectionTypes.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FailoverDirectionTypes.java new file mode 100644 index 000000000000..652165447e8c --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FailoverDirectionTypes.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Types of Failover directions. + */ +public final class FailoverDirectionTypes extends ExpandableStringEnum { + /** + * Failover resources from specific locations. + */ + public static final FailoverDirectionTypes FROM_SPECIFIC_LOCATIONS = fromString("FromSpecificLocations"); + + /** + * Creates a new instance of FailoverDirectionTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FailoverDirectionTypes() { + } + + /** + * Creates or finds a FailoverDirectionTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding FailoverDirectionTypes. + */ + public static FailoverDirectionTypes fromString(String name) { + return fromString(name, FailoverDirectionTypes.class); + } + + /** + * Gets known FailoverDirectionTypes values. + * + * @return known FailoverDirectionTypes values. + */ + public static Collection values() { + return values(FailoverDirectionTypes.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FailoverRequest.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FailoverRequest.java new file mode 100644 index 000000000000..01171f001227 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FailoverRequest.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Failover post action request. + */ +@Fluent +public final class FailoverRequest implements JsonSerializable { + /* + * Type of Failover direction. + */ + private FailoverDirectionTypes failoverDirection; + + /* + * Additional properties for Failover. + */ + private FailoverRequestProperties failoverRequestProperties; + + /** + * Creates an instance of FailoverRequest class. + */ + public FailoverRequest() { + } + + /** + * Get the failoverDirection property: Type of Failover direction. + * + * @return the failoverDirection value. + */ + public FailoverDirectionTypes failoverDirection() { + return this.failoverDirection; + } + + /** + * Set the failoverDirection property: Type of Failover direction. + * + * @param failoverDirection the failoverDirection value to set. + * @return the FailoverRequest object itself. + */ + public FailoverRequest withFailoverDirection(FailoverDirectionTypes failoverDirection) { + this.failoverDirection = failoverDirection; + return this; + } + + /** + * Get the failoverRequestProperties property: Additional properties for Failover. + * + * @return the failoverRequestProperties value. + */ + public FailoverRequestProperties failoverRequestProperties() { + return this.failoverRequestProperties; + } + + /** + * Set the failoverRequestProperties property: Additional properties for Failover. + * + * @param failoverRequestProperties the failoverRequestProperties value to set. + * @return the FailoverRequest object itself. + */ + public FailoverRequest withFailoverRequestProperties(FailoverRequestProperties failoverRequestProperties) { + this.failoverRequestProperties = failoverRequestProperties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("failoverDirection", + this.failoverDirection == null ? null : this.failoverDirection.toString()); + jsonWriter.writeJsonField("failoverRequestProperties", this.failoverRequestProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FailoverRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FailoverRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FailoverRequest. + */ + public static FailoverRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FailoverRequest deserializedFailoverRequest = new FailoverRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("failoverDirection".equals(fieldName)) { + deserializedFailoverRequest.failoverDirection + = FailoverDirectionTypes.fromString(reader.getString()); + } else if ("failoverRequestProperties".equals(fieldName)) { + deserializedFailoverRequest.failoverRequestProperties = FailoverRequestProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFailoverRequest; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FailoverRequestProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FailoverRequestProperties.java new file mode 100644 index 000000000000..340848a2ae9d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FailoverRequestProperties.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Additional properties for Failover. + */ +@Fluent +public final class FailoverRequestProperties implements JsonSerializable { + /* + * Source locations from where resources to be failed-over. + */ + private List sourceLocations; + + /* + * Selected recovery resource Ids to be processed. If not provided, all qualified resources based on the source + * location(s) will be processed. + */ + private List selectedResourceIds; + + /* + * Execution configurations for the recovery action. + */ + private ExecutionConfigurations executionConfigurations; + + /** + * Creates an instance of FailoverRequestProperties class. + */ + public FailoverRequestProperties() { + } + + /** + * Get the sourceLocations property: Source locations from where resources to be failed-over. + * + * @return the sourceLocations value. + */ + public List sourceLocations() { + return this.sourceLocations; + } + + /** + * Set the sourceLocations property: Source locations from where resources to be failed-over. + * + * @param sourceLocations the sourceLocations value to set. + * @return the FailoverRequestProperties object itself. + */ + public FailoverRequestProperties withSourceLocations(List sourceLocations) { + this.sourceLocations = sourceLocations; + return this; + } + + /** + * Get the selectedResourceIds property: Selected recovery resource Ids to be processed. If not provided, all + * qualified resources based on the source location(s) will be processed. + * + * @return the selectedResourceIds value. + */ + public List selectedResourceIds() { + return this.selectedResourceIds; + } + + /** + * Set the selectedResourceIds property: Selected recovery resource Ids to be processed. If not provided, all + * qualified resources based on the source location(s) will be processed. + * + * @param selectedResourceIds the selectedResourceIds value to set. + * @return the FailoverRequestProperties object itself. + */ + public FailoverRequestProperties withSelectedResourceIds(List selectedResourceIds) { + this.selectedResourceIds = selectedResourceIds; + return this; + } + + /** + * Get the executionConfigurations property: Execution configurations for the recovery action. + * + * @return the executionConfigurations value. + */ + public ExecutionConfigurations executionConfigurations() { + return this.executionConfigurations; + } + + /** + * Set the executionConfigurations property: Execution configurations for the recovery action. + * + * @param executionConfigurations the executionConfigurations value to set. + * @return the FailoverRequestProperties object itself. + */ + public FailoverRequestProperties withExecutionConfigurations(ExecutionConfigurations executionConfigurations) { + this.executionConfigurations = executionConfigurations; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("sourceLocations", this.sourceLocations, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("selectedResourceIds", this.selectedResourceIds, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("executionConfigurations", this.executionConfigurations); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FailoverRequestProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FailoverRequestProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FailoverRequestProperties. + */ + public static FailoverRequestProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FailoverRequestProperties deserializedFailoverRequestProperties = new FailoverRequestProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceLocations".equals(fieldName)) { + List sourceLocations = reader.readArray(reader1 -> reader1.getString()); + deserializedFailoverRequestProperties.sourceLocations = sourceLocations; + } else if ("selectedResourceIds".equals(fieldName)) { + List selectedResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedFailoverRequestProperties.selectedResourceIds = selectedResourceIds; + } else if ("executionConfigurations".equals(fieldName)) { + deserializedFailoverRequestProperties.executionConfigurations + = ExecutionConfigurations.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFailoverRequestProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FailoverState.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FailoverState.java new file mode 100644 index 000000000000..3be5d693dbd9 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FailoverState.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * A state specific to the resource that helps identify its Failover state. + */ +public final class FailoverState extends ExpandableStringEnum { + /** + * The resource is Not in failedOver state. + */ + public static final FailoverState NONE = fromString("None"); + + /** + * The resource is in failed-over state. + */ + public static final FailoverState FAILED_OVER = fromString("FailedOver"); + + /** + * The resource is in failover commit pending state. + */ + public static final FailoverState FAILED_OVER_COMMIT_PENDING = fromString("FailedOverCommitPending"); + + /** + * The resource is in reprotect pending state. + */ + public static final FailoverState FAILED_OVER_REPROTECT_PENDING = fromString("FailedOverReprotectPending"); + + /** + * Creates a new instance of FailoverState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FailoverState() { + } + + /** + * Creates or finds a FailoverState from its string representation. + * + * @param name a name to look for. + * @return the corresponding FailoverState. + */ + public static FailoverState fromString(String name) { + return fromString(name, FailoverState.class); + } + + /** + * Gets known FailoverState values. + * + * @return known FailoverState values. + */ + public static Collection values() { + return values(FailoverState.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FaultDetails.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FaultDetails.java new file mode 100644 index 000000000000..bd988d11651e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FaultDetails.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Fault Details. + */ +@Fluent +public final class FaultDetails implements JsonSerializable { + /* + * fault urn. + */ + private String faultUrn; + + /* + * fault name + */ + private String faultName; + + /* + * ARMId of the target resource where fault will be applied. For non-NSG, same as ResourceId. For NSG, its the NSG + * resource and not the actual resource which is to be simulated for faulting. + */ + private String targetResourceId; + + /** + * Creates an instance of FaultDetails class. + */ + public FaultDetails() { + } + + /** + * Get the faultUrn property: fault urn. + * + * @return the faultUrn value. + */ + public String faultUrn() { + return this.faultUrn; + } + + /** + * Set the faultUrn property: fault urn. + * + * @param faultUrn the faultUrn value to set. + * @return the FaultDetails object itself. + */ + public FaultDetails withFaultUrn(String faultUrn) { + this.faultUrn = faultUrn; + return this; + } + + /** + * Get the faultName property: fault name. + * + * @return the faultName value. + */ + public String faultName() { + return this.faultName; + } + + /** + * Set the faultName property: fault name. + * + * @param faultName the faultName value to set. + * @return the FaultDetails object itself. + */ + public FaultDetails withFaultName(String faultName) { + this.faultName = faultName; + return this; + } + + /** + * Get the targetResourceId property: ARMId of the target resource where fault will be applied. For non-NSG, same as + * ResourceId. For NSG, its the NSG resource and not the actual resource which is to be simulated for faulting. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: ARMId of the target resource where fault will be applied. For non-NSG, same as + * ResourceId. For NSG, its the NSG resource and not the actual resource which is to be simulated for faulting. + * + * @param targetResourceId the targetResourceId value to set. + * @return the FaultDetails object itself. + */ + public FaultDetails withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("faultUrn", this.faultUrn); + jsonWriter.writeStringField("faultName", this.faultName); + jsonWriter.writeStringField("targetResourceId", this.targetResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FaultDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FaultDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FaultDetails. + */ + public static FaultDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FaultDetails deserializedFaultDetails = new FaultDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("faultUrn".equals(fieldName)) { + deserializedFaultDetails.faultUrn = reader.getString(); + } else if ("faultName".equals(fieldName)) { + deserializedFaultDetails.faultName = reader.getString(); + } else if ("targetResourceId".equals(fieldName)) { + deserializedFaultDetails.targetResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFaultDetails; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FaultProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FaultProperties.java new file mode 100644 index 000000000000..3e020ab49c6d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FaultProperties.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Fault Properties. + */ +@Fluent +public final class FaultProperties implements JsonSerializable { + /* + * Available faults for this resource. + */ + private List availableFaults; + + /* + * Default fault provided by the system. + */ + private FaultDetails defaultFault; + + /* + * Override fault provided by the user. + */ + private FaultDetails overriddenDefaultFault; + + /* + * Custom Fault Details selected by user + */ + private CustomFaultDetails customFault; + + /** + * Creates an instance of FaultProperties class. + */ + public FaultProperties() { + } + + /** + * Get the availableFaults property: Available faults for this resource. + * + * @return the availableFaults value. + */ + public List availableFaults() { + return this.availableFaults; + } + + /** + * Get the defaultFault property: Default fault provided by the system. + * + * @return the defaultFault value. + */ + public FaultDetails defaultFault() { + return this.defaultFault; + } + + /** + * Get the overriddenDefaultFault property: Override fault provided by the user. + * + * @return the overriddenDefaultFault value. + */ + public FaultDetails overriddenDefaultFault() { + return this.overriddenDefaultFault; + } + + /** + * Set the overriddenDefaultFault property: Override fault provided by the user. + * + * @param overriddenDefaultFault the overriddenDefaultFault value to set. + * @return the FaultProperties object itself. + */ + public FaultProperties withOverriddenDefaultFault(FaultDetails overriddenDefaultFault) { + this.overriddenDefaultFault = overriddenDefaultFault; + return this; + } + + /** + * Get the customFault property: Custom Fault Details selected by user. + * + * @return the customFault value. + */ + public CustomFaultDetails customFault() { + return this.customFault; + } + + /** + * Set the customFault property: Custom Fault Details selected by user. + * + * @param customFault the customFault value to set. + * @return the FaultProperties object itself. + */ + public FaultProperties withCustomFault(CustomFaultDetails customFault) { + this.customFault = customFault; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("overriddenDefaultFault", this.overriddenDefaultFault); + jsonWriter.writeJsonField("customFault", this.customFault); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FaultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FaultProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FaultProperties. + */ + public static FaultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FaultProperties deserializedFaultProperties = new FaultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("availableFaults".equals(fieldName)) { + List availableFaults = reader.readArray(reader1 -> FaultDetails.fromJson(reader1)); + deserializedFaultProperties.availableFaults = availableFaults; + } else if ("defaultFault".equals(fieldName)) { + deserializedFaultProperties.defaultFault = FaultDetails.fromJson(reader); + } else if ("overriddenDefaultFault".equals(fieldName)) { + deserializedFaultProperties.overriddenDefaultFault = FaultDetails.fromJson(reader); + } else if ("customFault".equals(fieldName)) { + deserializedFaultProperties.customFault = CustomFaultDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFaultProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ForceInclusionAndUpdate.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ForceInclusionAndUpdate.java new file mode 100644 index 000000000000..38a7a49018b1 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ForceInclusionAndUpdate.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum for ForceInclusionAndUpdate. + */ +public final class ForceInclusionAndUpdate extends ExpandableStringEnum { + /** + * Enable ForceInclusionAndUpdate. + */ + public static final ForceInclusionAndUpdate ENABLE = fromString("Enable"); + + /** + * Disable ForceInclusionAndUpdate. + */ + public static final ForceInclusionAndUpdate DISABLE = fromString("Disable"); + + /** + * Creates a new instance of ForceInclusionAndUpdate value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ForceInclusionAndUpdate() { + } + + /** + * Creates or finds a ForceInclusionAndUpdate from its string representation. + * + * @param name a name to look for. + * @return the corresponding ForceInclusionAndUpdate. + */ + public static ForceInclusionAndUpdate fromString(String name) { + return fromString(name, ForceInclusionAndUpdate.class); + } + + /** + * Gets known ForceInclusionAndUpdate values. + * + * @return known ForceInclusionAndUpdate values. + */ + public static Collection values() { + return values(ForceInclusionAndUpdate.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalAssignment.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalAssignment.java new file mode 100644 index 000000000000..90c281027760 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalAssignment.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalAssignmentInner; + +/** + * An immutable client-side representation of GoalAssignment. + */ +public interface GoalAssignment { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + GoalAssignmentProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalAssignmentInner object. + * + * @return the inner object. + */ + GoalAssignmentInner innerModel(); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalAssignmentProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalAssignmentProperties.java new file mode 100644 index 000000000000..123c2037f409 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalAssignmentProperties.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of goal assignment property. + */ +@Fluent +public final class GoalAssignmentProperties implements JsonSerializable { + /* + * Arm id of the goal template. + */ + private String goalTemplateId; + + /* + * The type of goal assignment. + */ + private GoalAssignmentType goalAssignmentType; + + /* + * List of service level resources. + */ + private List serviceLevelResources; + + /* + * Provisioning state + */ + private ProvisioningState provisioningState; + + /* + * Details of any errors encountered during the operation. + */ + private ManagementError errorDetails; + + /** + * Creates an instance of GoalAssignmentProperties class. + */ + public GoalAssignmentProperties() { + } + + /** + * Get the goalTemplateId property: Arm id of the goal template. + * + * @return the goalTemplateId value. + */ + public String goalTemplateId() { + return this.goalTemplateId; + } + + /** + * Set the goalTemplateId property: Arm id of the goal template. + * + * @param goalTemplateId the goalTemplateId value to set. + * @return the GoalAssignmentProperties object itself. + */ + public GoalAssignmentProperties withGoalTemplateId(String goalTemplateId) { + this.goalTemplateId = goalTemplateId; + return this; + } + + /** + * Get the goalAssignmentType property: The type of goal assignment. + * + * @return the goalAssignmentType value. + */ + public GoalAssignmentType goalAssignmentType() { + return this.goalAssignmentType; + } + + /** + * Set the goalAssignmentType property: The type of goal assignment. + * + * @param goalAssignmentType the goalAssignmentType value to set. + * @return the GoalAssignmentProperties object itself. + */ + public GoalAssignmentProperties withGoalAssignmentType(GoalAssignmentType goalAssignmentType) { + this.goalAssignmentType = goalAssignmentType; + return this; + } + + /** + * Get the serviceLevelResources property: List of service level resources. + * + * @return the serviceLevelResources value. + */ + public List serviceLevelResources() { + return this.serviceLevelResources; + } + + /** + * Set the serviceLevelResources property: List of service level resources. + * + * @param serviceLevelResources the serviceLevelResources value to set. + * @return the GoalAssignmentProperties object itself. + */ + public GoalAssignmentProperties withServiceLevelResources(List serviceLevelResources) { + this.serviceLevelResources = serviceLevelResources; + return this; + } + + /** + * Get the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the errorDetails property: Details of any errors encountered during the operation. + * + * @return the errorDetails value. + */ + public ManagementError errorDetails() { + return this.errorDetails; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("goalTemplateId", this.goalTemplateId); + jsonWriter.writeStringField("goalAssignmentType", + this.goalAssignmentType == null ? null : this.goalAssignmentType.toString()); + jsonWriter.writeArrayField("serviceLevelResources", this.serviceLevelResources, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GoalAssignmentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GoalAssignmentProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GoalAssignmentProperties. + */ + public static GoalAssignmentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GoalAssignmentProperties deserializedGoalAssignmentProperties = new GoalAssignmentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("goalTemplateId".equals(fieldName)) { + deserializedGoalAssignmentProperties.goalTemplateId = reader.getString(); + } else if ("goalAssignmentType".equals(fieldName)) { + deserializedGoalAssignmentProperties.goalAssignmentType + = GoalAssignmentType.fromString(reader.getString()); + } else if ("serviceLevelResources".equals(fieldName)) { + List serviceLevelResources + = reader.readArray(reader1 -> ServiceLevelResource.fromJson(reader1)); + deserializedGoalAssignmentProperties.serviceLevelResources = serviceLevelResources; + } else if ("provisioningState".equals(fieldName)) { + deserializedGoalAssignmentProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("errorDetails".equals(fieldName)) { + deserializedGoalAssignmentProperties.errorDetails = ManagementError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGoalAssignmentProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalAssignmentType.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalAssignmentType.java new file mode 100644 index 000000000000..249398f3ecb8 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalAssignmentType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Supported type of goal assignment. + */ +public final class GoalAssignmentType extends ExpandableStringEnum { + /** + * Resiliency goal assignment type. + */ + public static final GoalAssignmentType RESILIENCY = fromString("Resiliency"); + + /** + * Creates a new instance of GoalAssignmentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GoalAssignmentType() { + } + + /** + * Creates or finds a GoalAssignmentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding GoalAssignmentType. + */ + public static GoalAssignmentType fromString(String name) { + return fromString(name, GoalAssignmentType.class); + } + + /** + * Gets known GoalAssignmentType values. + * + * @return known GoalAssignmentType values. + */ + public static Collection values() { + return values(GoalAssignmentType.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalAssignments.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalAssignments.java new file mode 100644 index 000000000000..52a06c3acec7 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalAssignments.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.models.GoalAssignmentInner; + +/** + * Resource collection API of GoalAssignments. + */ +public interface GoalAssignments { + /** + * Get a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 GoalAssignment along with {@link Response}. + */ + Response getWithResponse(String serviceGroupName, String goalAssignmentName, Context context); + + /** + * Get a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 GoalAssignment. + */ + GoalAssignment get(String serviceGroupName, String goalAssignmentName); + + /** + * Create a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 createOrUpdate(String serviceGroupName, String goalAssignmentName, GoalAssignmentInner resource); + + /** + * Create a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 createOrUpdate(String serviceGroupName, String goalAssignmentName, GoalAssignmentInner resource, + Context context); + + /** + * Update a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String goalAssignmentName, GoalAssignmentInner properties); + + /** + * Update a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String goalAssignmentName, GoalAssignmentInner properties, Context context); + + /** + * Action to exclude a resource from goal assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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. + */ + void updateGoalResources(String serviceGroupName, String goalAssignmentName, UpdateGoalResourceRequest body); + + /** + * Action to exclude a resource from goal assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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. + */ + void updateGoalResources(String serviceGroupName, String goalAssignmentName, UpdateGoalResourceRequest body, + Context context); + + /** + * Refreshes the goal resources under a goal assignment. This operation scans for new resources under the scope of + * the assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 refreshGoalResources(String serviceGroupName, String goalAssignmentName); + + /** + * Refreshes the goal resources under a goal assignment. This operation scans for new resources under the scope of + * the assignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 refreshGoalResources(String serviceGroupName, String goalAssignmentName, Context context); + + /** + * Delete a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String goalAssignmentName); + + /** + * Delete a GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 delete(String serviceGroupName, String goalAssignmentName, Context context); + + /** + * Recommends capacity improvements for resources under the goal assignments scope. Returns AI-powered capacity + * assessments and recommendations. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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. + */ + void recommendCapacity(String serviceGroupName, String goalAssignmentName, RecommendCapacityRequest body); + + /** + * Recommends capacity improvements for resources under the goal assignments scope. Returns AI-powered capacity + * assessments and recommendations. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param body The content of the action 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. + */ + void recommendCapacity(String serviceGroupName, String goalAssignmentName, RecommendCapacityRequest body, + Context context); + + /** + * List GoalAssignment resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalAssignment list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName); + + /** + * List GoalAssignment resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalAssignment list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName, String skipToken, Integer top, Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalResource.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalResource.java new file mode 100644 index 000000000000..5967a46dbfe9 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalResource.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalResourceInner; + +/** + * An immutable client-side representation of GoalResource. + */ +public interface GoalResource { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + GoalResourceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalResourceInner object. + * + * @return the inner object. + */ + GoalResourceInner innerModel(); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalResourceProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalResourceProperties.java new file mode 100644 index 000000000000..10d5d0cf4c05 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalResourceProperties.java @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of goal assignment property. + */ +@Fluent +public final class GoalResourceProperties implements JsonSerializable { + /* + * Arm Id of resource under the SG for which the extension resource is maintained. + */ + private String resourceArmId; + + /* + * Flag which depicts whether the Arm resource is excluded for high availability recommendation. + */ + private ExclusionState highAvailabilityGoalParticipation; + + /* + * Flag which depicts whether the Arm resource is manually attested for high availability recommendation. + */ + private AttestationState highAvailabilityAttestationStatus; + + /* + * Flag which depicts whether the Arm resource is excluded for disaster recovery recommendation. + */ + private ExclusionState disasterRecoveryGoalParticipation; + + /* + * Flag which depicts whether the Arm resource is manually attested for disaster recovery recommendation. + */ + private AttestationState disasterRecoveryAttestationStatus; + + /* + * Reason for exclusion from high availability goals. + */ + private ExclusionReason exclusionReasonForHighAvailabilityGoals; + + /* + * Reason for exclusion from disaster recovery goals. + */ + private ExclusionReason exclusionReasonForDisasterRecoveryGoals; + + /* + * List of user confirmations for high availability solutions. + */ + private List userConfirmationForHighAvailability; + + /* + * List of service groups of which this resource is memberof. + */ + private List serviceGroupMemberships; + + /* + * Provisioning state + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of GoalResourceProperties class. + */ + public GoalResourceProperties() { + } + + /** + * Get the resourceArmId property: Arm Id of resource under the SG for which the extension resource is maintained. + * + * @return the resourceArmId value. + */ + public String resourceArmId() { + return this.resourceArmId; + } + + /** + * Set the resourceArmId property: Arm Id of resource under the SG for which the extension resource is maintained. + * + * @param resourceArmId the resourceArmId value to set. + * @return the GoalResourceProperties object itself. + */ + public GoalResourceProperties withResourceArmId(String resourceArmId) { + this.resourceArmId = resourceArmId; + return this; + } + + /** + * Get the highAvailabilityGoalParticipation property: Flag which depicts whether the Arm resource is excluded for + * high availability recommendation. + * + * @return the highAvailabilityGoalParticipation value. + */ + public ExclusionState highAvailabilityGoalParticipation() { + return this.highAvailabilityGoalParticipation; + } + + /** + * Set the highAvailabilityGoalParticipation property: Flag which depicts whether the Arm resource is excluded for + * high availability recommendation. + * + * @param highAvailabilityGoalParticipation the highAvailabilityGoalParticipation value to set. + * @return the GoalResourceProperties object itself. + */ + public GoalResourceProperties + withHighAvailabilityGoalParticipation(ExclusionState highAvailabilityGoalParticipation) { + this.highAvailabilityGoalParticipation = highAvailabilityGoalParticipation; + return this; + } + + /** + * Get the highAvailabilityAttestationStatus property: Flag which depicts whether the Arm resource is manually + * attested for high availability recommendation. + * + * @return the highAvailabilityAttestationStatus value. + */ + public AttestationState highAvailabilityAttestationStatus() { + return this.highAvailabilityAttestationStatus; + } + + /** + * Set the highAvailabilityAttestationStatus property: Flag which depicts whether the Arm resource is manually + * attested for high availability recommendation. + * + * @param highAvailabilityAttestationStatus the highAvailabilityAttestationStatus value to set. + * @return the GoalResourceProperties object itself. + */ + public GoalResourceProperties + withHighAvailabilityAttestationStatus(AttestationState highAvailabilityAttestationStatus) { + this.highAvailabilityAttestationStatus = highAvailabilityAttestationStatus; + return this; + } + + /** + * Get the disasterRecoveryGoalParticipation property: Flag which depicts whether the Arm resource is excluded for + * disaster recovery recommendation. + * + * @return the disasterRecoveryGoalParticipation value. + */ + public ExclusionState disasterRecoveryGoalParticipation() { + return this.disasterRecoveryGoalParticipation; + } + + /** + * Set the disasterRecoveryGoalParticipation property: Flag which depicts whether the Arm resource is excluded for + * disaster recovery recommendation. + * + * @param disasterRecoveryGoalParticipation the disasterRecoveryGoalParticipation value to set. + * @return the GoalResourceProperties object itself. + */ + public GoalResourceProperties + withDisasterRecoveryGoalParticipation(ExclusionState disasterRecoveryGoalParticipation) { + this.disasterRecoveryGoalParticipation = disasterRecoveryGoalParticipation; + return this; + } + + /** + * Get the disasterRecoveryAttestationStatus property: Flag which depicts whether the Arm resource is manually + * attested for disaster recovery recommendation. + * + * @return the disasterRecoveryAttestationStatus value. + */ + public AttestationState disasterRecoveryAttestationStatus() { + return this.disasterRecoveryAttestationStatus; + } + + /** + * Set the disasterRecoveryAttestationStatus property: Flag which depicts whether the Arm resource is manually + * attested for disaster recovery recommendation. + * + * @param disasterRecoveryAttestationStatus the disasterRecoveryAttestationStatus value to set. + * @return the GoalResourceProperties object itself. + */ + public GoalResourceProperties + withDisasterRecoveryAttestationStatus(AttestationState disasterRecoveryAttestationStatus) { + this.disasterRecoveryAttestationStatus = disasterRecoveryAttestationStatus; + return this; + } + + /** + * Get the exclusionReasonForHighAvailabilityGoals property: Reason for exclusion from high availability goals. + * + * @return the exclusionReasonForHighAvailabilityGoals value. + */ + public ExclusionReason exclusionReasonForHighAvailabilityGoals() { + return this.exclusionReasonForHighAvailabilityGoals; + } + + /** + * Get the exclusionReasonForDisasterRecoveryGoals property: Reason for exclusion from disaster recovery goals. + * + * @return the exclusionReasonForDisasterRecoveryGoals value. + */ + public ExclusionReason exclusionReasonForDisasterRecoveryGoals() { + return this.exclusionReasonForDisasterRecoveryGoals; + } + + /** + * Get the userConfirmationForHighAvailability property: List of user confirmations for high availability solutions. + * + * @return the userConfirmationForHighAvailability value. + */ + public List userConfirmationForHighAvailability() { + return this.userConfirmationForHighAvailability; + } + + /** + * Set the userConfirmationForHighAvailability property: List of user confirmations for high availability solutions. + * + * @param userConfirmationForHighAvailability the userConfirmationForHighAvailability value to set. + * @return the GoalResourceProperties object itself. + */ + public GoalResourceProperties withUserConfirmationForHighAvailability( + List userConfirmationForHighAvailability) { + this.userConfirmationForHighAvailability = userConfirmationForHighAvailability; + return this; + } + + /** + * Get the serviceGroupMemberships property: List of service groups of which this resource is memberof. + * + * @return the serviceGroupMemberships value. + */ + public List serviceGroupMemberships() { + return this.serviceGroupMemberships; + } + + /** + * Get the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceArmId", this.resourceArmId); + jsonWriter.writeStringField("highAvailabilityGoalParticipation", + this.highAvailabilityGoalParticipation == null ? null : this.highAvailabilityGoalParticipation.toString()); + jsonWriter.writeStringField("highAvailabilityAttestationStatus", + this.highAvailabilityAttestationStatus == null ? null : this.highAvailabilityAttestationStatus.toString()); + jsonWriter.writeStringField("disasterRecoveryGoalParticipation", + this.disasterRecoveryGoalParticipation == null ? null : this.disasterRecoveryGoalParticipation.toString()); + jsonWriter.writeStringField("disasterRecoveryAttestationStatus", + this.disasterRecoveryAttestationStatus == null ? null : this.disasterRecoveryAttestationStatus.toString()); + jsonWriter.writeArrayField("userConfirmationForHighAvailability", this.userConfirmationForHighAvailability, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GoalResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GoalResourceProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GoalResourceProperties. + */ + public static GoalResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GoalResourceProperties deserializedGoalResourceProperties = new GoalResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceArmId".equals(fieldName)) { + deserializedGoalResourceProperties.resourceArmId = reader.getString(); + } else if ("highAvailabilityGoalParticipation".equals(fieldName)) { + deserializedGoalResourceProperties.highAvailabilityGoalParticipation + = ExclusionState.fromString(reader.getString()); + } else if ("highAvailabilityAttestationStatus".equals(fieldName)) { + deserializedGoalResourceProperties.highAvailabilityAttestationStatus + = AttestationState.fromString(reader.getString()); + } else if ("disasterRecoveryGoalParticipation".equals(fieldName)) { + deserializedGoalResourceProperties.disasterRecoveryGoalParticipation + = ExclusionState.fromString(reader.getString()); + } else if ("disasterRecoveryAttestationStatus".equals(fieldName)) { + deserializedGoalResourceProperties.disasterRecoveryAttestationStatus + = AttestationState.fromString(reader.getString()); + } else if ("exclusionReasonForHighAvailabilityGoals".equals(fieldName)) { + deserializedGoalResourceProperties.exclusionReasonForHighAvailabilityGoals + = ExclusionReason.fromString(reader.getString()); + } else if ("exclusionReasonForDisasterRecoveryGoals".equals(fieldName)) { + deserializedGoalResourceProperties.exclusionReasonForDisasterRecoveryGoals + = ExclusionReason.fromString(reader.getString()); + } else if ("userConfirmationForHighAvailability".equals(fieldName)) { + List userConfirmationForHighAvailability + = reader.readArray(reader1 -> UserConfirmationForHighAvailabilityItem.fromJson(reader1)); + deserializedGoalResourceProperties.userConfirmationForHighAvailability + = userConfirmationForHighAvailability; + } else if ("serviceGroupMemberships".equals(fieldName)) { + List serviceGroupMemberships + = reader.readArray(reader1 -> ServiceGroupMembership.fromJson(reader1)); + deserializedGoalResourceProperties.serviceGroupMemberships = serviceGroupMemberships; + } else if ("provisioningState".equals(fieldName)) { + deserializedGoalResourceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGoalResourceProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalResources.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalResources.java new file mode 100644 index 000000000000..6d7f2d6eff6e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalResources.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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 GoalResources. + */ +public interface GoalResources { + /** + * Get a GoalResource. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param goalResourceName The name of the GoalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 GoalResource along with {@link Response}. + */ + Response getWithResponse(String serviceGroupName, String goalAssignmentName, String goalResourceName, + Context context); + + /** + * Get a GoalResource. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param goalResourceName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 GoalResource. + */ + GoalResource get(String serviceGroupName, String goalAssignmentName, String goalResourceName); + + /** + * List GoalResource resources by GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName, String goalAssignmentName); + + /** + * List GoalResource resources by GoalAssignment. + * + * @param serviceGroupName The name of the service group. + * @param goalAssignmentName The name of the GoalAssignment. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName, String goalAssignmentName, String skipToken, Integer top, + Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalTemplate.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalTemplate.java new file mode 100644 index 000000000000..8f200bd394b0 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalTemplate.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalTemplateInner; + +/** + * An immutable client-side representation of GoalTemplate. + */ +public interface GoalTemplate { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + GoalTemplateProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalTemplateInner object. + * + * @return the inner object. + */ + GoalTemplateInner innerModel(); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalTemplateProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalTemplateProperties.java new file mode 100644 index 000000000000..892d5f5e0708 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalTemplateProperties.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of goal template property. + */ +@Fluent +public final class GoalTemplateProperties implements JsonSerializable { + /* + * Option specified by customer under high availability section of goal template + */ + private RequirementSelected requireHighAvailability; + + /* + * Option specified by customer under disaster recovery section of goal template + */ + private RequirementSelected requireDisasterRecovery; + + /* + * Regional recovery point objective specified by customer. eg, PT15M for 15 minutes + */ + private String regionalRecoveryPointObjective; + + /* + * Regional recovery time objective specified by customer. eg, PT15M for 15 minutes + */ + private String regionalRecoveryTimeObjective; + + /* + * Type of Goal Template created by customer + */ + private GoalType goalType; + + /* + * Provisioning state + */ + private ProvisioningState provisioningState; + + /* + * Details of any errors encountered during the operation. + */ + private ManagementError errorDetails; + + /** + * Creates an instance of GoalTemplateProperties class. + */ + public GoalTemplateProperties() { + } + + /** + * Get the requireHighAvailability property: Option specified by customer under high availability section of goal + * template. + * + * @return the requireHighAvailability value. + */ + public RequirementSelected requireHighAvailability() { + return this.requireHighAvailability; + } + + /** + * Set the requireHighAvailability property: Option specified by customer under high availability section of goal + * template. + * + * @param requireHighAvailability the requireHighAvailability value to set. + * @return the GoalTemplateProperties object itself. + */ + public GoalTemplateProperties withRequireHighAvailability(RequirementSelected requireHighAvailability) { + this.requireHighAvailability = requireHighAvailability; + return this; + } + + /** + * Get the requireDisasterRecovery property: Option specified by customer under disaster recovery section of goal + * template. + * + * @return the requireDisasterRecovery value. + */ + public RequirementSelected requireDisasterRecovery() { + return this.requireDisasterRecovery; + } + + /** + * Set the requireDisasterRecovery property: Option specified by customer under disaster recovery section of goal + * template. + * + * @param requireDisasterRecovery the requireDisasterRecovery value to set. + * @return the GoalTemplateProperties object itself. + */ + public GoalTemplateProperties withRequireDisasterRecovery(RequirementSelected requireDisasterRecovery) { + this.requireDisasterRecovery = requireDisasterRecovery; + return this; + } + + /** + * Get the regionalRecoveryPointObjective property: Regional recovery point objective specified by customer. eg, + * PT15M for 15 minutes. + * + * @return the regionalRecoveryPointObjective value. + */ + public String regionalRecoveryPointObjective() { + return this.regionalRecoveryPointObjective; + } + + /** + * Set the regionalRecoveryPointObjective property: Regional recovery point objective specified by customer. eg, + * PT15M for 15 minutes. + * + * @param regionalRecoveryPointObjective the regionalRecoveryPointObjective value to set. + * @return the GoalTemplateProperties object itself. + */ + public GoalTemplateProperties withRegionalRecoveryPointObjective(String regionalRecoveryPointObjective) { + this.regionalRecoveryPointObjective = regionalRecoveryPointObjective; + return this; + } + + /** + * Get the regionalRecoveryTimeObjective property: Regional recovery time objective specified by customer. eg, PT15M + * for 15 minutes. + * + * @return the regionalRecoveryTimeObjective value. + */ + public String regionalRecoveryTimeObjective() { + return this.regionalRecoveryTimeObjective; + } + + /** + * Set the regionalRecoveryTimeObjective property: Regional recovery time objective specified by customer. eg, PT15M + * for 15 minutes. + * + * @param regionalRecoveryTimeObjective the regionalRecoveryTimeObjective value to set. + * @return the GoalTemplateProperties object itself. + */ + public GoalTemplateProperties withRegionalRecoveryTimeObjective(String regionalRecoveryTimeObjective) { + this.regionalRecoveryTimeObjective = regionalRecoveryTimeObjective; + return this; + } + + /** + * Get the goalType property: Type of Goal Template created by customer. + * + * @return the goalType value. + */ + public GoalType goalType() { + return this.goalType; + } + + /** + * Set the goalType property: Type of Goal Template created by customer. + * + * @param goalType the goalType value to set. + * @return the GoalTemplateProperties object itself. + */ + public GoalTemplateProperties withGoalType(GoalType goalType) { + this.goalType = goalType; + return this; + } + + /** + * Get the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the errorDetails property: Details of any errors encountered during the operation. + * + * @return the errorDetails value. + */ + public ManagementError errorDetails() { + return this.errorDetails; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("goalType", this.goalType == null ? null : this.goalType.toString()); + jsonWriter.writeStringField("requireHighAvailability", + this.requireHighAvailability == null ? null : this.requireHighAvailability.toString()); + jsonWriter.writeStringField("requireDisasterRecovery", + this.requireDisasterRecovery == null ? null : this.requireDisasterRecovery.toString()); + jsonWriter.writeStringField("regionalRecoveryPointObjective", this.regionalRecoveryPointObjective); + jsonWriter.writeStringField("regionalRecoveryTimeObjective", this.regionalRecoveryTimeObjective); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GoalTemplateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GoalTemplateProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GoalTemplateProperties. + */ + public static GoalTemplateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GoalTemplateProperties deserializedGoalTemplateProperties = new GoalTemplateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("goalType".equals(fieldName)) { + deserializedGoalTemplateProperties.goalType = GoalType.fromString(reader.getString()); + } else if ("requireHighAvailability".equals(fieldName)) { + deserializedGoalTemplateProperties.requireHighAvailability + = RequirementSelected.fromString(reader.getString()); + } else if ("requireDisasterRecovery".equals(fieldName)) { + deserializedGoalTemplateProperties.requireDisasterRecovery + = RequirementSelected.fromString(reader.getString()); + } else if ("regionalRecoveryPointObjective".equals(fieldName)) { + deserializedGoalTemplateProperties.regionalRecoveryPointObjective = reader.getString(); + } else if ("regionalRecoveryTimeObjective".equals(fieldName)) { + deserializedGoalTemplateProperties.regionalRecoveryTimeObjective = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedGoalTemplateProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("errorDetails".equals(fieldName)) { + deserializedGoalTemplateProperties.errorDetails = ManagementError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGoalTemplateProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalTemplates.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalTemplates.java new file mode 100644 index 000000000000..a626ba610922 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalTemplates.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.models.GoalTemplateInner; + +/** + * Resource collection API of GoalTemplates. + */ +public interface GoalTemplates { + /** + * Get a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 GoalTemplate along with {@link Response}. + */ + Response getWithResponse(String serviceGroupName, String goalTemplateName, Context context); + + /** + * Get a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 GoalTemplate. + */ + GoalTemplate get(String serviceGroupName, String goalTemplateName); + + /** + * Create a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal template a AzureResilienceProviderHub resource. + */ + GoalTemplate createOrUpdate(String serviceGroupName, String goalTemplateName, GoalTemplateInner resource); + + /** + * Create a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return goal template a AzureResilienceProviderHub resource. + */ + GoalTemplate createOrUpdate(String serviceGroupName, String goalTemplateName, GoalTemplateInner resource, + Context context); + + /** + * Update a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String goalTemplateName, GoalTemplateInner properties); + + /** + * Update a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String goalTemplateName, GoalTemplateInner properties, Context context); + + /** + * Delete a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String goalTemplateName); + + /** + * Delete a GoalTemplate. + * + * @param serviceGroupName The name of the service group. + * @param goalTemplateName The name of the goalTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 delete(String serviceGroupName, String goalTemplateName, Context context); + + /** + * List GoalTemplate resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalTemplate list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName); + + /** + * List GoalTemplate resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GoalTemplate list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName, String skipToken, Integer top, Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalType.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalType.java new file mode 100644 index 000000000000..47df3c2bb64f --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Supported type of goal. + */ +public final class GoalType extends ExpandableStringEnum { + /** + * Resiliency goal type. + */ + public static final GoalType RESILIENCY = fromString("Resiliency"); + + /** + * Creates a new instance of GoalType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GoalType() { + } + + /** + * Creates or finds a GoalType from its string representation. + * + * @param name a name to look for. + * @return the corresponding GoalType. + */ + public static GoalType fromString(String name) { + return fromString(name, GoalType.class); + } + + /** + * Gets known GoalType values. + * + * @return known GoalType values. + */ + public static Collection values() { + return values(GoalType.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalsData.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalsData.java new file mode 100644 index 000000000000..4543fd128b52 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalsData.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of goals data in unified resilience item. + */ +@Immutable +public final class GoalsData implements JsonSerializable { + /* + * Arm id of the goal template. + */ + private String templateId; + + /* + * Arm id of the goal assignment. + */ + private String assignmentId; + + /* + * Regional RPO set in resilience goal in minutes. + */ + private IsoDuration regionalRecoveryPointObjectiveInMinutes; + + /* + * Computed recovery point estimated for the service group in minutes. + */ + private IsoDuration regionalRecoveryPointEstimatedInMinutes; + + /* + * Regional RPO status of the service group. + */ + private ResilienceHealthStatus regionalRecoveryPointObjectiveStatus; + + /* + * Regional RTO set in resilience goal in minutes. + */ + private IsoDuration regionalRecoveryTimeObjectiveInMinutes; + + /* + * Computed RTA for the service group in minutes. + */ + private IsoDuration regionalRecoveryTimeActualInMinutes; + + /* + * Regional RTO status of the service group. + */ + private ResilienceHealthStatus regionalRecoveryTimeObjectiveStatus; + + /* + * Whether the resource is required for high availability. + */ + private UnifiedResilienceItemRequirementSelected requireHighAvailability; + + /* + * Whether the resource is required for disaster recovery. + */ + private UnifiedResilienceItemRequirementSelected requireDisasterRecovery; + + /** + * Creates an instance of GoalsData class. + */ + private GoalsData() { + } + + /** + * Get the templateId property: Arm id of the goal template. + * + * @return the templateId value. + */ + public String templateId() { + return this.templateId; + } + + /** + * Get the assignmentId property: Arm id of the goal assignment. + * + * @return the assignmentId value. + */ + public String assignmentId() { + return this.assignmentId; + } + + /** + * Get the regionalRecoveryPointObjectiveInMinutes property: Regional RPO set in resilience goal in minutes. + * + * @return the regionalRecoveryPointObjectiveInMinutes value. + */ + public IsoDuration regionalRecoveryPointObjectiveInMinutes() { + return this.regionalRecoveryPointObjectiveInMinutes; + } + + /** + * Get the regionalRecoveryPointEstimatedInMinutes property: Computed recovery point estimated for the service group + * in minutes. + * + * @return the regionalRecoveryPointEstimatedInMinutes value. + */ + public IsoDuration regionalRecoveryPointEstimatedInMinutes() { + return this.regionalRecoveryPointEstimatedInMinutes; + } + + /** + * Get the regionalRecoveryPointObjectiveStatus property: Regional RPO status of the service group. + * + * @return the regionalRecoveryPointObjectiveStatus value. + */ + public ResilienceHealthStatus regionalRecoveryPointObjectiveStatus() { + return this.regionalRecoveryPointObjectiveStatus; + } + + /** + * Get the regionalRecoveryTimeObjectiveInMinutes property: Regional RTO set in resilience goal in minutes. + * + * @return the regionalRecoveryTimeObjectiveInMinutes value. + */ + public IsoDuration regionalRecoveryTimeObjectiveInMinutes() { + return this.regionalRecoveryTimeObjectiveInMinutes; + } + + /** + * Get the regionalRecoveryTimeActualInMinutes property: Computed RTA for the service group in minutes. + * + * @return the regionalRecoveryTimeActualInMinutes value. + */ + public IsoDuration regionalRecoveryTimeActualInMinutes() { + return this.regionalRecoveryTimeActualInMinutes; + } + + /** + * Get the regionalRecoveryTimeObjectiveStatus property: Regional RTO status of the service group. + * + * @return the regionalRecoveryTimeObjectiveStatus value. + */ + public ResilienceHealthStatus regionalRecoveryTimeObjectiveStatus() { + return this.regionalRecoveryTimeObjectiveStatus; + } + + /** + * Get the requireHighAvailability property: Whether the resource is required for high availability. + * + * @return the requireHighAvailability value. + */ + public UnifiedResilienceItemRequirementSelected requireHighAvailability() { + return this.requireHighAvailability; + } + + /** + * Get the requireDisasterRecovery property: Whether the resource is required for disaster recovery. + * + * @return the requireDisasterRecovery value. + */ + public UnifiedResilienceItemRequirementSelected requireDisasterRecovery() { + return this.requireDisasterRecovery; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("templateId", this.templateId); + jsonWriter.writeStringField("assignmentId", this.assignmentId); + jsonWriter.writeStringField("regionalRecoveryPointObjectiveStatus", + this.regionalRecoveryPointObjectiveStatus == null + ? null + : this.regionalRecoveryPointObjectiveStatus.toString()); + jsonWriter.writeStringField("regionalRecoveryTimeObjectiveStatus", + this.regionalRecoveryTimeObjectiveStatus == null + ? null + : this.regionalRecoveryTimeObjectiveStatus.toString()); + jsonWriter.writeStringField("regionalRecoveryPointObjectiveInMinutes", + this.regionalRecoveryPointObjectiveInMinutes == null + ? null + : this.regionalRecoveryPointObjectiveInMinutes.toString()); + jsonWriter.writeStringField("regionalRecoveryPointEstimatedInMinutes", + this.regionalRecoveryPointEstimatedInMinutes == null + ? null + : this.regionalRecoveryPointEstimatedInMinutes.toString()); + jsonWriter.writeStringField("regionalRecoveryTimeObjectiveInMinutes", + this.regionalRecoveryTimeObjectiveInMinutes == null + ? null + : this.regionalRecoveryTimeObjectiveInMinutes.toString()); + jsonWriter.writeStringField("regionalRecoveryTimeActualInMinutes", + this.regionalRecoveryTimeActualInMinutes == null + ? null + : this.regionalRecoveryTimeActualInMinutes.toString()); + jsonWriter.writeStringField("requireHighAvailability", + this.requireHighAvailability == null ? null : this.requireHighAvailability.toString()); + jsonWriter.writeStringField("requireDisasterRecovery", + this.requireDisasterRecovery == null ? null : this.requireDisasterRecovery.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GoalsData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GoalsData if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GoalsData. + */ + public static GoalsData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GoalsData deserializedGoalsData = new GoalsData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("templateId".equals(fieldName)) { + deserializedGoalsData.templateId = reader.getString(); + } else if ("assignmentId".equals(fieldName)) { + deserializedGoalsData.assignmentId = reader.getString(); + } else if ("regionalRecoveryPointObjectiveStatus".equals(fieldName)) { + deserializedGoalsData.regionalRecoveryPointObjectiveStatus + = ResilienceHealthStatus.fromString(reader.getString()); + } else if ("regionalRecoveryTimeObjectiveStatus".equals(fieldName)) { + deserializedGoalsData.regionalRecoveryTimeObjectiveStatus + = ResilienceHealthStatus.fromString(reader.getString()); + } else if ("regionalRecoveryPointObjectiveInMinutes".equals(fieldName)) { + deserializedGoalsData.regionalRecoveryPointObjectiveInMinutes + = IsoDuration.fromString(reader.getString()); + } else if ("regionalRecoveryPointEstimatedInMinutes".equals(fieldName)) { + deserializedGoalsData.regionalRecoveryPointEstimatedInMinutes + = IsoDuration.fromString(reader.getString()); + } else if ("regionalRecoveryTimeObjectiveInMinutes".equals(fieldName)) { + deserializedGoalsData.regionalRecoveryTimeObjectiveInMinutes + = IsoDuration.fromString(reader.getString()); + } else if ("regionalRecoveryTimeActualInMinutes".equals(fieldName)) { + deserializedGoalsData.regionalRecoveryTimeActualInMinutes + = IsoDuration.fromString(reader.getString()); + } else if ("requireHighAvailability".equals(fieldName)) { + deserializedGoalsData.requireHighAvailability + = UnifiedResilienceItemRequirementSelected.fromString(reader.getString()); + } else if ("requireDisasterRecovery".equals(fieldName)) { + deserializedGoalsData.requireDisasterRecovery + = UnifiedResilienceItemRequirementSelected.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGoalsData; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/HAStatus.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/HAStatus.java new file mode 100644 index 000000000000..c2a34dca3c92 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/HAStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * HA Status. + */ +public final class HAStatus extends ExpandableStringEnum { + /** + * HA enabled. + */ + public static final HAStatus ENABLED = fromString("Enabled"); + + /** + * HA not enabled. + */ + public static final HAStatus NOT_ENABLED = fromString("NotEnabled"); + + /** + * Creates a new instance of HAStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HAStatus() { + } + + /** + * Creates or finds a HAStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding HAStatus. + */ + public static HAStatus fromString(String name) { + return fromString(name, HAStatus.class); + } + + /** + * Gets known HAStatus values. + * + * @return known HAStatus values. + */ + public static Collection values() { + return values(HAStatus.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/IncludeOrUpdateResource.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/IncludeOrUpdateResource.java new file mode 100644 index 000000000000..dc23aefff9c5 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/IncludeOrUpdateResource.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Include or Update resource. + */ +@Fluent +public final class IncludeOrUpdateResource implements JsonSerializable { + /* + * Id of the DrillResource to be included (NOT the ARM Id of the underlying resource). + */ + private String id; + + /* + * Fault properties. + */ + private FaultProperties faultProperties; + + /** + * Creates an instance of IncludeOrUpdateResource class. + */ + public IncludeOrUpdateResource() { + } + + /** + * Get the id property: Id of the DrillResource to be included (NOT the ARM Id of the underlying resource). + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Id of the DrillResource to be included (NOT the ARM Id of the underlying resource). + * + * @param id the id value to set. + * @return the IncludeOrUpdateResource object itself. + */ + public IncludeOrUpdateResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get the faultProperties property: Fault properties. + * + * @return the faultProperties value. + */ + public FaultProperties faultProperties() { + return this.faultProperties; + } + + /** + * Set the faultProperties property: Fault properties. + * + * @param faultProperties the faultProperties value to set. + * @return the IncludeOrUpdateResource object itself. + */ + public IncludeOrUpdateResource withFaultProperties(FaultProperties faultProperties) { + this.faultProperties = faultProperties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("faultProperties", this.faultProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IncludeOrUpdateResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IncludeOrUpdateResource if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IncludeOrUpdateResource. + */ + public static IncludeOrUpdateResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IncludeOrUpdateResource deserializedIncludeOrUpdateResource = new IncludeOrUpdateResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIncludeOrUpdateResource.id = reader.getString(); + } else if ("faultProperties".equals(fieldName)) { + deserializedIncludeOrUpdateResource.faultProperties = FaultProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIncludeOrUpdateResource; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/InitialConfig.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/InitialConfig.java new file mode 100644 index 000000000000..ab7f16ee95d6 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/InitialConfig.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum for Initial config of Drill object. + */ +public final class InitialConfig extends ExpandableStringEnum { + /** + * Initial config pending. + */ + public static final InitialConfig PENDING = fromString("Pending"); + + /** + * Initial config complete. + */ + public static final InitialConfig COMPLETE = fromString("Complete"); + + /** + * Creates a new instance of InitialConfig value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InitialConfig() { + } + + /** + * Creates or finds a InitialConfig from its string representation. + * + * @param name a name to look for. + * @return the corresponding InitialConfig. + */ + public static InitialConfig fromString(String name) { + return fromString(name, InitialConfig.class); + } + + /** + * Gets known InitialConfig values. + * + * @return known InitialConfig values. + */ + public static Collection values() { + return values(InitialConfig.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/IsoDuration.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/IsoDuration.java new file mode 100644 index 000000000000..faaa5792f4d6 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/IsoDuration.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ISO 8601 duration formats. + */ +public final class IsoDuration extends ExpandableStringEnum { + /** + * 15 minutes. + */ + public static final IsoDuration PT15M = fromString("PT15M"); + + /** + * 1 hour. + */ + public static final IsoDuration PT1H = fromString("PT1H"); + + /** + * 4 hours. + */ + public static final IsoDuration PT4H = fromString("PT4H"); + + /** + * 24 hours. + */ + public static final IsoDuration PT24H = fromString("PT24H"); + + /** + * Creates a new instance of IsoDuration value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IsoDuration() { + } + + /** + * Creates or finds a IsoDuration from its string representation. + * + * @param name a name to look for. + * @return the corresponding IsoDuration. + */ + public static IsoDuration fromString(String name) { + return fromString(name, IsoDuration.class); + } + + /** + * Gets known IsoDuration values. + * + * @return known IsoDuration values. + */ + public static Collection values() { + return values(IsoDuration.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobErrorInfo.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobErrorInfo.java new file mode 100644 index 000000000000..617441c756e8 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobErrorInfo.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Job Error information. + */ +@Immutable +public final class JobErrorInfo implements JsonSerializable { + /* + * A code representing the error. + */ + private String errorCode; + + /* + * A detailed message explaining the error. + */ + private String errorMessage; + + /* + * A list of recommendations to resolve the error. + */ + private List recommendations; + + /** + * Creates an instance of JobErrorInfo class. + */ + private JobErrorInfo() { + } + + /** + * Get the errorCode property: A code representing the error. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Get the errorMessage property: A detailed message explaining the error. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Get the recommendations property: A list of recommendations to resolve the error. + * + * @return the recommendations value. + */ + public List recommendations() { + return this.recommendations; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobErrorInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobErrorInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the JobErrorInfo. + */ + public static JobErrorInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobErrorInfo deserializedJobErrorInfo = new JobErrorInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errorCode".equals(fieldName)) { + deserializedJobErrorInfo.errorCode = reader.getString(); + } else if ("errorMessage".equals(fieldName)) { + deserializedJobErrorInfo.errorMessage = reader.getString(); + } else if ("recommendations".equals(fieldName)) { + List recommendations = reader.readArray(reader1 -> reader1.getString()); + deserializedJobErrorInfo.recommendations = recommendations; + } else { + reader.skipChildren(); + } + } + + return deserializedJobErrorInfo; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobExtendedInfo.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobExtendedInfo.java new file mode 100644 index 000000000000..e8b278f4091b --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobExtendedInfo.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Additional information for job. + */ +@Immutable +public final class JobExtendedInfo implements JsonSerializable { + /* + * List of tasks associated with this job. + */ + private List tasksList; + + /* + * Non localized error message on job execution. + */ + private String dynamicErrorMessage; + + /** + * Creates an instance of JobExtendedInfo class. + */ + private JobExtendedInfo() { + } + + /** + * Get the tasksList property: List of tasks associated with this job. + * + * @return the tasksList value. + */ + public List tasksList() { + return this.tasksList; + } + + /** + * Get the dynamicErrorMessage property: Non localized error message on job execution. + * + * @return the dynamicErrorMessage value. + */ + public String dynamicErrorMessage() { + return this.dynamicErrorMessage; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobExtendedInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobExtendedInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the JobExtendedInfo. + */ + public static JobExtendedInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobExtendedInfo deserializedJobExtendedInfo = new JobExtendedInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tasksList".equals(fieldName)) { + List tasksList = reader.readArray(reader1 -> JobTaskDetail.fromJson(reader1)); + deserializedJobExtendedInfo.tasksList = tasksList; + } else if ("dynamicErrorMessage".equals(fieldName)) { + deserializedJobExtendedInfo.dynamicErrorMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJobExtendedInfo; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobProperties.java new file mode 100644 index 000000000000..968276baf821 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobProperties.java @@ -0,0 +1,440 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Definition of a job, including its type, status, timing, and additional details. + */ +@Immutable +public class JobProperties implements JsonSerializable { + /* + * The type of job. + */ + private JobType jobType = JobType.fromString("JobProperties"); + + /* + * The current status of the job execution. + */ + private JobStatus status; + + /* + * The start time of the job execution. + */ + private OffsetDateTime startTime; + + /* + * The end time of the job execution. + */ + private OffsetDateTime endTime; + + /* + * The time elapsed during the execution of this job. + */ + private Duration duration; + + /* + * Details of any errors that occurred during the execution of this job. + */ + private JobErrorInfo errorDetails; + + /* + * The resource for which this job was created. This is typically the resource that the job is intended to manage or + * operate on. + */ + private String resourceId; + + /* + * The operation that this job is intended to perform. + */ + private String operation; + + /* + * Details of any retries that have been attempted for this job. + */ + private List retryDetails; + + /* + * Additional information about the job. + */ + private JobExtendedInfo jobExtendedInfo; + + /* + * User Comments. + */ + private List userComments; + + /* + * Execution configurations for the job. + */ + private ExecutionConfigurations executionConfigurations; + + /* + * Indicates whether the job was triggered by the system or a user. + */ + private JobTriggeredBy triggeredBy; + + /** + * Creates an instance of JobProperties class. + */ + protected JobProperties() { + } + + /** + * Get the jobType property: The type of job. + * + * @return the jobType value. + */ + public JobType jobType() { + return this.jobType; + } + + /** + * Get the status property: The current status of the job execution. + * + * @return the status value. + */ + public JobStatus status() { + return this.status; + } + + /** + * Set the status property: The current status of the job execution. + * + * @param status the status value to set. + * @return the JobProperties object itself. + */ + JobProperties withStatus(JobStatus status) { + this.status = status; + return this; + } + + /** + * Get the startTime property: The start time of the job execution. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time of the job execution. + * + * @param startTime the startTime value to set. + * @return the JobProperties object itself. + */ + JobProperties withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time of the job execution. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time of the job execution. + * + * @param endTime the endTime value to set. + * @return the JobProperties object itself. + */ + JobProperties withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the duration property: The time elapsed during the execution of this job. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Set the duration property: The time elapsed during the execution of this job. + * + * @param duration the duration value to set. + * @return the JobProperties object itself. + */ + JobProperties withDuration(Duration duration) { + this.duration = duration; + return this; + } + + /** + * Get the errorDetails property: Details of any errors that occurred during the execution of this job. + * + * @return the errorDetails value. + */ + public JobErrorInfo errorDetails() { + return this.errorDetails; + } + + /** + * Set the errorDetails property: Details of any errors that occurred during the execution of this job. + * + * @param errorDetails the errorDetails value to set. + * @return the JobProperties object itself. + */ + JobProperties withErrorDetails(JobErrorInfo errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + /** + * Get the resourceId property: The resource for which this job was created. This is typically the resource that the + * job is intended to manage or operate on. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource for which this job was created. This is typically the resource that the + * job is intended to manage or operate on. + * + * @param resourceId the resourceId value to set. + * @return the JobProperties object itself. + */ + JobProperties withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the operation property: The operation that this job is intended to perform. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: The operation that this job is intended to perform. + * + * @param operation the operation value to set. + * @return the JobProperties object itself. + */ + JobProperties withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the retryDetails property: Details of any retries that have been attempted for this job. + * + * @return the retryDetails value. + */ + public List retryDetails() { + return this.retryDetails; + } + + /** + * Set the retryDetails property: Details of any retries that have been attempted for this job. + * + * @param retryDetails the retryDetails value to set. + * @return the JobProperties object itself. + */ + JobProperties withRetryDetails(List retryDetails) { + this.retryDetails = retryDetails; + return this; + } + + /** + * Get the jobExtendedInfo property: Additional information about the job. + * + * @return the jobExtendedInfo value. + */ + public JobExtendedInfo jobExtendedInfo() { + return this.jobExtendedInfo; + } + + /** + * Set the jobExtendedInfo property: Additional information about the job. + * + * @param jobExtendedInfo the jobExtendedInfo value to set. + * @return the JobProperties object itself. + */ + JobProperties withJobExtendedInfo(JobExtendedInfo jobExtendedInfo) { + this.jobExtendedInfo = jobExtendedInfo; + return this; + } + + /** + * Get the userComments property: User Comments. + * + * @return the userComments value. + */ + public List userComments() { + return this.userComments; + } + + /** + * Set the userComments property: User Comments. + * + * @param userComments the userComments value to set. + * @return the JobProperties object itself. + */ + JobProperties withUserComments(List userComments) { + this.userComments = userComments; + return this; + } + + /** + * Get the executionConfigurations property: Execution configurations for the job. + * + * @return the executionConfigurations value. + */ + public ExecutionConfigurations executionConfigurations() { + return this.executionConfigurations; + } + + /** + * Set the executionConfigurations property: Execution configurations for the job. + * + * @param executionConfigurations the executionConfigurations value to set. + * @return the JobProperties object itself. + */ + JobProperties withExecutionConfigurations(ExecutionConfigurations executionConfigurations) { + this.executionConfigurations = executionConfigurations; + return this; + } + + /** + * Get the triggeredBy property: Indicates whether the job was triggered by the system or a user. + * + * @return the triggeredBy value. + */ + public JobTriggeredBy triggeredBy() { + return this.triggeredBy; + } + + /** + * Set the triggeredBy property: Indicates whether the job was triggered by the system or a user. + * + * @param triggeredBy the triggeredBy value to set. + * @return the JobProperties object itself. + */ + JobProperties withTriggeredBy(JobTriggeredBy triggeredBy) { + this.triggeredBy = triggeredBy; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeJsonField("errorDetails", this.errorDetails); + jsonWriter.writeArrayField("retryDetails", this.retryDetails, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("jobExtendedInfo", this.jobExtendedInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the JobProperties. + */ + public static JobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("jobType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("DrillRun".equals(discriminatorValue)) { + return DrillRunProperties.fromJson(readerToUse.reset()); + } else if ("RecoveryPlan".equals(discriminatorValue)) { + return RecoveryJobProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static JobProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobProperties deserializedJobProperties = new JobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobType".equals(fieldName)) { + deserializedJobProperties.jobType = JobType.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedJobProperties.status = JobStatus.fromString(reader.getString()); + } else if ("startTime".equals(fieldName)) { + deserializedJobProperties.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedJobProperties.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("duration".equals(fieldName)) { + deserializedJobProperties.duration + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("errorDetails".equals(fieldName)) { + deserializedJobProperties.errorDetails = JobErrorInfo.fromJson(reader); + } else if ("resourceId".equals(fieldName)) { + deserializedJobProperties.resourceId = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedJobProperties.operation = reader.getString(); + } else if ("retryDetails".equals(fieldName)) { + List retryDetails = reader.readArray(reader1 -> JobRetryDetails.fromJson(reader1)); + deserializedJobProperties.retryDetails = retryDetails; + } else if ("jobExtendedInfo".equals(fieldName)) { + deserializedJobProperties.jobExtendedInfo = JobExtendedInfo.fromJson(reader); + } else if ("userComments".equals(fieldName)) { + List userComments = reader.readArray(reader1 -> JobUserComment.fromJson(reader1)); + deserializedJobProperties.userComments = userComments; + } else if ("executionConfigurations".equals(fieldName)) { + deserializedJobProperties.executionConfigurations = ExecutionConfigurations.fromJson(reader); + } else if ("triggeredBy".equals(fieldName)) { + deserializedJobProperties.triggeredBy = JobTriggeredBy.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedJobProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobResourceProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobResourceProperties.java new file mode 100644 index 000000000000..3b608b550d89 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobResourceProperties.java @@ -0,0 +1,468 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Definition of job-resource. + */ +@Immutable +public class JobResourceProperties implements JsonSerializable { + /* + * Discriminator for the JobResource object hierarchy. + */ + private JobResourceType jobResourceType = JobResourceType.fromString("JobResourceProperties"); + + /* + * The current status of the job execution. + */ + private JobStatus status; + + /* + * The start time of the job execution. + */ + private OffsetDateTime startTime; + + /* + * The end time of the job execution. + */ + private OffsetDateTime endTime; + + /* + * The time elapsed during the execution of this job. + */ + private Duration duration; + + /* + * Details of any errors that occurred during the execution of this job. + */ + private JobErrorInfo errorDetails; + + /* + * The resource for which this job was created. This is typically the resource that the job is intended to manage or + * operate on. + */ + private String resourceId; + + /* + * The operation that this job is intended to perform. + */ + private String operation; + + /* + * Details of any retries that have been attempted for this job. + */ + private List retryDetails; + + /* + * Additional information about the job. + */ + private JobExtendedInfo jobExtendedInfo; + + /* + * User Comments. + */ + private List userComments; + + /* + * Id of the Job under which this job-resource exists. + */ + private String jobId; + + /* + * Id of the job-task to which this job resource is associated. + */ + private String taskId; + + /* + * Friendly name of the job-task to which this job resource is associated. + */ + private String taskName; + + /** + * Creates an instance of JobResourceProperties class. + */ + protected JobResourceProperties() { + } + + /** + * Get the jobResourceType property: Discriminator for the JobResource object hierarchy. + * + * @return the jobResourceType value. + */ + public JobResourceType jobResourceType() { + return this.jobResourceType; + } + + /** + * Get the status property: The current status of the job execution. + * + * @return the status value. + */ + public JobStatus status() { + return this.status; + } + + /** + * Set the status property: The current status of the job execution. + * + * @param status the status value to set. + * @return the JobResourceProperties object itself. + */ + JobResourceProperties withStatus(JobStatus status) { + this.status = status; + return this; + } + + /** + * Get the startTime property: The start time of the job execution. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time of the job execution. + * + * @param startTime the startTime value to set. + * @return the JobResourceProperties object itself. + */ + JobResourceProperties withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time of the job execution. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time of the job execution. + * + * @param endTime the endTime value to set. + * @return the JobResourceProperties object itself. + */ + JobResourceProperties withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the duration property: The time elapsed during the execution of this job. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Set the duration property: The time elapsed during the execution of this job. + * + * @param duration the duration value to set. + * @return the JobResourceProperties object itself. + */ + JobResourceProperties withDuration(Duration duration) { + this.duration = duration; + return this; + } + + /** + * Get the errorDetails property: Details of any errors that occurred during the execution of this job. + * + * @return the errorDetails value. + */ + public JobErrorInfo errorDetails() { + return this.errorDetails; + } + + /** + * Set the errorDetails property: Details of any errors that occurred during the execution of this job. + * + * @param errorDetails the errorDetails value to set. + * @return the JobResourceProperties object itself. + */ + JobResourceProperties withErrorDetails(JobErrorInfo errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + /** + * Get the resourceId property: The resource for which this job was created. This is typically the resource that the + * job is intended to manage or operate on. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource for which this job was created. This is typically the resource that the + * job is intended to manage or operate on. + * + * @param resourceId the resourceId value to set. + * @return the JobResourceProperties object itself. + */ + JobResourceProperties withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the operation property: The operation that this job is intended to perform. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: The operation that this job is intended to perform. + * + * @param operation the operation value to set. + * @return the JobResourceProperties object itself. + */ + JobResourceProperties withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the retryDetails property: Details of any retries that have been attempted for this job. + * + * @return the retryDetails value. + */ + public List retryDetails() { + return this.retryDetails; + } + + /** + * Set the retryDetails property: Details of any retries that have been attempted for this job. + * + * @param retryDetails the retryDetails value to set. + * @return the JobResourceProperties object itself. + */ + JobResourceProperties withRetryDetails(List retryDetails) { + this.retryDetails = retryDetails; + return this; + } + + /** + * Get the jobExtendedInfo property: Additional information about the job. + * + * @return the jobExtendedInfo value. + */ + public JobExtendedInfo jobExtendedInfo() { + return this.jobExtendedInfo; + } + + /** + * Set the jobExtendedInfo property: Additional information about the job. + * + * @param jobExtendedInfo the jobExtendedInfo value to set. + * @return the JobResourceProperties object itself. + */ + JobResourceProperties withJobExtendedInfo(JobExtendedInfo jobExtendedInfo) { + this.jobExtendedInfo = jobExtendedInfo; + return this; + } + + /** + * Get the userComments property: User Comments. + * + * @return the userComments value. + */ + public List userComments() { + return this.userComments; + } + + /** + * Set the userComments property: User Comments. + * + * @param userComments the userComments value to set. + * @return the JobResourceProperties object itself. + */ + JobResourceProperties withUserComments(List userComments) { + this.userComments = userComments; + return this; + } + + /** + * Get the jobId property: Id of the Job under which this job-resource exists. + * + * @return the jobId value. + */ + public String jobId() { + return this.jobId; + } + + /** + * Set the jobId property: Id of the Job under which this job-resource exists. + * + * @param jobId the jobId value to set. + * @return the JobResourceProperties object itself. + */ + JobResourceProperties withJobId(String jobId) { + this.jobId = jobId; + return this; + } + + /** + * Get the taskId property: Id of the job-task to which this job resource is associated. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: Id of the job-task to which this job resource is associated. + * + * @param taskId the taskId value to set. + * @return the JobResourceProperties object itself. + */ + JobResourceProperties withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get the taskName property: Friendly name of the job-task to which this job resource is associated. + * + * @return the taskName value. + */ + public String taskName() { + return this.taskName; + } + + /** + * Set the taskName property: Friendly name of the job-task to which this job resource is associated. + * + * @param taskName the taskName value to set. + * @return the JobResourceProperties object itself. + */ + JobResourceProperties withTaskName(String taskName) { + this.taskName = taskName; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("jobResourceType", + this.jobResourceType == null ? null : this.jobResourceType.toString()); + jsonWriter.writeJsonField("errorDetails", this.errorDetails); + jsonWriter.writeArrayField("retryDetails", this.retryDetails, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("jobExtendedInfo", this.jobExtendedInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobResourceProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the JobResourceProperties. + */ + public static JobResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("jobResourceType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("DrillRun".equals(discriminatorValue)) { + return DrillRunResourceProperties.fromJson(readerToUse.reset()); + } else if ("RecoveryPlan".equals(discriminatorValue)) { + return RecoveryJobResourceProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static JobResourceProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobResourceProperties deserializedJobResourceProperties = new JobResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobResourceType".equals(fieldName)) { + deserializedJobResourceProperties.jobResourceType = JobResourceType.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedJobResourceProperties.status = JobStatus.fromString(reader.getString()); + } else if ("startTime".equals(fieldName)) { + deserializedJobResourceProperties.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedJobResourceProperties.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("duration".equals(fieldName)) { + deserializedJobResourceProperties.duration + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("errorDetails".equals(fieldName)) { + deserializedJobResourceProperties.errorDetails = JobErrorInfo.fromJson(reader); + } else if ("resourceId".equals(fieldName)) { + deserializedJobResourceProperties.resourceId = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedJobResourceProperties.operation = reader.getString(); + } else if ("retryDetails".equals(fieldName)) { + List retryDetails = reader.readArray(reader1 -> JobRetryDetails.fromJson(reader1)); + deserializedJobResourceProperties.retryDetails = retryDetails; + } else if ("jobExtendedInfo".equals(fieldName)) { + deserializedJobResourceProperties.jobExtendedInfo = JobExtendedInfo.fromJson(reader); + } else if ("userComments".equals(fieldName)) { + List userComments = reader.readArray(reader1 -> JobUserComment.fromJson(reader1)); + deserializedJobResourceProperties.userComments = userComments; + } else if ("jobId".equals(fieldName)) { + deserializedJobResourceProperties.jobId = reader.getString(); + } else if ("taskId".equals(fieldName)) { + deserializedJobResourceProperties.taskId = reader.getString(); + } else if ("taskName".equals(fieldName)) { + deserializedJobResourceProperties.taskName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJobResourceProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobResourceType.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobResourceType.java new file mode 100644 index 000000000000..a2aafc7ab31d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobResourceType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * A job resource type indicates the kind of jobresource. + */ +public final class JobResourceType extends ExpandableStringEnum { + /** + * Abstract job resource - invalid. + */ + public static final JobResourceType INVALID = fromString("Invalid"); + + /** + * Recovery Orchestration Plan created job resource. + */ + public static final JobResourceType RECOVERY_PLAN = fromString("RecoveryPlan"); + + /** + * Drill Run job resource. + */ + public static final JobResourceType DRILL_RUN = fromString("DrillRun"); + + /** + * Creates a new instance of JobResourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JobResourceType() { + } + + /** + * Creates or finds a JobResourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobResourceType. + */ + public static JobResourceType fromString(String name) { + return fromString(name, JobResourceType.class); + } + + /** + * Gets known JobResourceType values. + * + * @return known JobResourceType values. + */ + public static Collection values() { + return values(JobResourceType.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobRetryDetails.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobRetryDetails.java new file mode 100644 index 000000000000..b6f26fd9f288 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobRetryDetails.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Job Retry Details. + */ +@Immutable +public final class JobRetryDetails implements JsonSerializable { + /* + * The current status of the job execution. + */ + private JobStatus status; + + /* + * The start time of the job execution. + */ + private OffsetDateTime startTime; + + /* + * The end time of the job execution. + */ + private OffsetDateTime endTime; + + /* + * The time elapsed during the execution of this job. + */ + private Duration duration; + + /* + * Details of any errors that occurred during the execution of this job. + */ + private JobErrorInfo errorDetails; + + /* + * The retry attempt number of the job. + */ + private int retryAttempt; + + /* + * User Comments. + */ + private List userComments; + + /** + * Creates an instance of JobRetryDetails class. + */ + private JobRetryDetails() { + } + + /** + * Get the status property: The current status of the job execution. + * + * @return the status value. + */ + public JobStatus status() { + return this.status; + } + + /** + * Get the startTime property: The start time of the job execution. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: The end time of the job execution. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the duration property: The time elapsed during the execution of this job. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Get the errorDetails property: Details of any errors that occurred during the execution of this job. + * + * @return the errorDetails value. + */ + public JobErrorInfo errorDetails() { + return this.errorDetails; + } + + /** + * Get the retryAttempt property: The retry attempt number of the job. + * + * @return the retryAttempt value. + */ + public int retryAttempt() { + return this.retryAttempt; + } + + /** + * Get the userComments property: User Comments. + * + * @return the userComments value. + */ + public List userComments() { + return this.userComments; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("retryAttempt", this.retryAttempt); + jsonWriter.writeJsonField("errorDetails", this.errorDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobRetryDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobRetryDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the JobRetryDetails. + */ + public static JobRetryDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobRetryDetails deserializedJobRetryDetails = new JobRetryDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("retryAttempt".equals(fieldName)) { + deserializedJobRetryDetails.retryAttempt = reader.getInt(); + } else if ("status".equals(fieldName)) { + deserializedJobRetryDetails.status = JobStatus.fromString(reader.getString()); + } else if ("startTime".equals(fieldName)) { + deserializedJobRetryDetails.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedJobRetryDetails.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("duration".equals(fieldName)) { + deserializedJobRetryDetails.duration + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("errorDetails".equals(fieldName)) { + deserializedJobRetryDetails.errorDetails = JobErrorInfo.fromJson(reader); + } else if ("userComments".equals(fieldName)) { + List userComments = reader.readArray(reader1 -> JobUserComment.fromJson(reader1)); + deserializedJobRetryDetails.userComments = userComments; + } else { + reader.skipChildren(); + } + } + + return deserializedJobRetryDetails; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobStatus.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobStatus.java new file mode 100644 index 000000000000..b384d6e46465 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobStatus.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Job Statuses. + */ +public final class JobStatus extends ExpandableStringEnum { + /** + * The job status is not applicable. + */ + public static final JobStatus NOT_APPLICABLE = fromString("NotApplicable"); + + /** + * The job has not started yet. + */ + public static final JobStatus NOT_STARTED = fromString("NotStarted"); + + /** + * The job is pending execution, awaiting the completion of dependent stages. + */ + public static final JobStatus PENDING = fromString("Pending"); + + /** + * The job is currently in progress. + */ + public static final JobStatus IN_PROGRESS = fromString("InProgress"); + + /** + * The job has been completed successfully. + */ + public static final JobStatus COMPLETED = fromString("Completed"); + + /** + * The job has been completed with warnings. + */ + public static final JobStatus COMPLETED_WITH_WARNINGS = fromString("CompletedWithWarnings"); + + /** + * The job has failed. + */ + public static final JobStatus FAILED = fromString("Failed"); + + /** + * The job skipped for the resource (resource not qualified or not applicable). + */ + public static final JobStatus SKIPPED = fromString("Skipped"); + + /** + * The job is in the process of being cancelled. + */ + public static final JobStatus CANCELLING = fromString("Cancelling"); + + /** + * The job has been cancelled. + */ + public static final JobStatus CANCELLED = fromString("Cancelled"); + + /** + * The job is currently paused. + */ + public static final JobStatus PAUSED = fromString("Paused"); + + /** + * Creates a new instance of JobStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JobStatus() { + } + + /** + * Creates or finds a JobStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobStatus. + */ + public static JobStatus fromString(String name) { + return fromString(name, JobStatus.class); + } + + /** + * Gets known JobStatus values. + * + * @return known JobStatus values. + */ + public static Collection values() { + return values(JobStatus.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobTaskDetail.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobTaskDetail.java new file mode 100644 index 000000000000..c344afa89b36 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobTaskDetail.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Job task details. + */ +@Immutable +public final class JobTaskDetail implements JsonSerializable { + /* + * The current status of the job execution. + */ + private JobStatus status; + + /* + * The start time of the job execution. + */ + private OffsetDateTime startTime; + + /* + * The end time of the job execution. + */ + private OffsetDateTime endTime; + + /* + * The time elapsed during the execution of this job. + */ + private Duration duration; + + /* + * Details of any errors that occurred during the execution of this job. + */ + private JobErrorInfo errorDetails; + + /* + * Identifier of the task. + */ + private String taskId; + + /* + * Friendly name of the task. + */ + private String taskName; + + /* + * Identifiers of linked jobs to this task. + */ + private List linkedJobIds; + + /* + * User Comments. + */ + private List userComments; + + /* + * List of sub-tasks associated with this job. + */ + private List subTasksList; + + /* + * Retry details of the task. + */ + private List retryDetails; + + /** + * Creates an instance of JobTaskDetail class. + */ + private JobTaskDetail() { + } + + /** + * Get the status property: The current status of the job execution. + * + * @return the status value. + */ + public JobStatus status() { + return this.status; + } + + /** + * Get the startTime property: The start time of the job execution. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: The end time of the job execution. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the duration property: The time elapsed during the execution of this job. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Get the errorDetails property: Details of any errors that occurred during the execution of this job. + * + * @return the errorDetails value. + */ + public JobErrorInfo errorDetails() { + return this.errorDetails; + } + + /** + * Get the taskId property: Identifier of the task. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Get the taskName property: Friendly name of the task. + * + * @return the taskName value. + */ + public String taskName() { + return this.taskName; + } + + /** + * Get the linkedJobIds property: Identifiers of linked jobs to this task. + * + * @return the linkedJobIds value. + */ + public List linkedJobIds() { + return this.linkedJobIds; + } + + /** + * Get the userComments property: User Comments. + * + * @return the userComments value. + */ + public List userComments() { + return this.userComments; + } + + /** + * Get the subTasksList property: List of sub-tasks associated with this job. + * + * @return the subTasksList value. + */ + public List subTasksList() { + return this.subTasksList; + } + + /** + * Get the retryDetails property: Retry details of the task. + * + * @return the retryDetails value. + */ + public List retryDetails() { + return this.retryDetails; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("errorDetails", this.errorDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobTaskDetail from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobTaskDetail if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the JobTaskDetail. + */ + public static JobTaskDetail fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobTaskDetail deserializedJobTaskDetail = new JobTaskDetail(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedJobTaskDetail.status = JobStatus.fromString(reader.getString()); + } else if ("startTime".equals(fieldName)) { + deserializedJobTaskDetail.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedJobTaskDetail.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("duration".equals(fieldName)) { + deserializedJobTaskDetail.duration + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("errorDetails".equals(fieldName)) { + deserializedJobTaskDetail.errorDetails = JobErrorInfo.fromJson(reader); + } else if ("taskId".equals(fieldName)) { + deserializedJobTaskDetail.taskId = reader.getString(); + } else if ("taskName".equals(fieldName)) { + deserializedJobTaskDetail.taskName = reader.getString(); + } else if ("linkedJobIds".equals(fieldName)) { + List linkedJobIds = reader.readArray(reader1 -> reader1.getString()); + deserializedJobTaskDetail.linkedJobIds = linkedJobIds; + } else if ("userComments".equals(fieldName)) { + List userComments = reader.readArray(reader1 -> JobUserComment.fromJson(reader1)); + deserializedJobTaskDetail.userComments = userComments; + } else if ("subTasksList".equals(fieldName)) { + List subTasksList = reader.readArray(reader1 -> JobTaskDetail.fromJson(reader1)); + deserializedJobTaskDetail.subTasksList = subTasksList; + } else if ("retryDetails".equals(fieldName)) { + List retryDetails = reader.readArray(reader1 -> JobRetryDetails.fromJson(reader1)); + deserializedJobTaskDetail.retryDetails = retryDetails; + } else { + reader.skipChildren(); + } + } + + return deserializedJobTaskDetail; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobTriggeredBy.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobTriggeredBy.java new file mode 100644 index 000000000000..b15ea2cb5fb1 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobTriggeredBy.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Job TriggeredBy. + */ +public final class JobTriggeredBy extends ExpandableStringEnum { + /** + * Triggered by the system. + */ + public static final JobTriggeredBy SYSTEM = fromString("System"); + + /** + * Triggered by the user. + */ + public static final JobTriggeredBy USER = fromString("User"); + + /** + * Creates a new instance of JobTriggeredBy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JobTriggeredBy() { + } + + /** + * Creates or finds a JobTriggeredBy from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobTriggeredBy. + */ + public static JobTriggeredBy fromString(String name) { + return fromString(name, JobTriggeredBy.class); + } + + /** + * Gets known JobTriggeredBy values. + * + * @return known JobTriggeredBy values. + */ + public static Collection values() { + return values(JobTriggeredBy.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobType.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobType.java new file mode 100644 index 000000000000..a88040a38b11 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * A job type indicates the kind of job. + */ +public final class JobType extends ExpandableStringEnum { + /** + * Abstract job - invalid. + */ + public static final JobType INVALID = fromString("Invalid"); + + /** + * Recovery Orchestration Plan created job. + */ + public static final JobType RECOVERY_PLAN = fromString("RecoveryPlan"); + + /** + * Drill Oober job which represents a given instance of Drill. + */ + public static final JobType DRILL_RUN = fromString("DrillRun"); + + /** + * Creates a new instance of JobType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JobType() { + } + + /** + * Creates or finds a JobType from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobType. + */ + public static JobType fromString(String name) { + return fromString(name, JobType.class); + } + + /** + * Gets known JobType values. + * + * @return known JobType values. + */ + public static Collection values() { + return values(JobType.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobUserComment.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobUserComment.java new file mode 100644 index 000000000000..e4d4aa9a195b --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobUserComment.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Job User's Comment. + */ +@Immutable +public final class JobUserComment implements JsonSerializable { + /* + * The type of the user comment. + */ + private CommentType commentType; + + /* + * The time of user comment. + */ + private OffsetDateTime commentTime; + + /* + * User Comment + */ + private String comments; + + /** + * Creates an instance of JobUserComment class. + */ + private JobUserComment() { + } + + /** + * Get the commentType property: The type of the user comment. + * + * @return the commentType value. + */ + public CommentType commentType() { + return this.commentType; + } + + /** + * Get the commentTime property: The time of user comment. + * + * @return the commentTime value. + */ + public OffsetDateTime commentTime() { + return this.commentTime; + } + + /** + * Get the comments property: User Comment. + * + * @return the comments value. + */ + public String comments() { + return this.comments; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobUserComment from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobUserComment if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the JobUserComment. + */ + public static JobUserComment fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobUserComment deserializedJobUserComment = new JobUserComment(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("commentType".equals(fieldName)) { + deserializedJobUserComment.commentType = CommentType.fromString(reader.getString()); + } else if ("commentTime".equals(fieldName)) { + deserializedJobUserComment.commentTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("comments".equals(fieldName)) { + deserializedJobUserComment.comments = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJobUserComment; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/LastRunProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/LastRunProperties.java new file mode 100644 index 000000000000..c31a3c09a8a6 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/LastRunProperties.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** + * Definition of Last Run properties. + */ +@Immutable +public final class LastRunProperties implements JsonSerializable { + /* + * Timestamp of the last run of this Drill. + */ + private OffsetDateTime lastRunTime; + + /* + * Status of the last run of this Drill. + */ + private JobStatus lastRunState; + + /* + * Timespan of the last run of this Drill. + */ + private Duration lastRunDuration; + + /* + * Attestation state of the last run of this Drill. + */ + private DrillAttestation lastRunAttestation; + + /** + * Creates an instance of LastRunProperties class. + */ + private LastRunProperties() { + } + + /** + * Get the lastRunTime property: Timestamp of the last run of this Drill. + * + * @return the lastRunTime value. + */ + public OffsetDateTime lastRunTime() { + return this.lastRunTime; + } + + /** + * Get the lastRunState property: Status of the last run of this Drill. + * + * @return the lastRunState value. + */ + public JobStatus lastRunState() { + return this.lastRunState; + } + + /** + * Get the lastRunDuration property: Timespan of the last run of this Drill. + * + * @return the lastRunDuration value. + */ + public Duration lastRunDuration() { + return this.lastRunDuration; + } + + /** + * Get the lastRunAttestation property: Attestation state of the last run of this Drill. + * + * @return the lastRunAttestation value. + */ + public DrillAttestation lastRunAttestation() { + return this.lastRunAttestation; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LastRunProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LastRunProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LastRunProperties. + */ + public static LastRunProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LastRunProperties deserializedLastRunProperties = new LastRunProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("lastRunTime".equals(fieldName)) { + deserializedLastRunProperties.lastRunTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastRunState".equals(fieldName)) { + deserializedLastRunProperties.lastRunState = JobStatus.fromString(reader.getString()); + } else if ("lastRunDuration".equals(fieldName)) { + deserializedLastRunProperties.lastRunDuration + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("lastRunAttestation".equals(fieldName)) { + deserializedLastRunProperties.lastRunAttestation = DrillAttestation.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLastRunProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ManagedOnBehalfOfConfiguration.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ManagedOnBehalfOfConfiguration.java new file mode 100644 index 000000000000..94ff8b68af12 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ManagedOnBehalfOfConfiguration.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Configuration of the managed on behalf of resource. + */ +@Immutable +public final class ManagedOnBehalfOfConfiguration implements JsonSerializable { + /* + * Associated MoboBrokerResources. + */ + private List moboBrokerResources; + + /** + * Creates an instance of ManagedOnBehalfOfConfiguration class. + */ + private ManagedOnBehalfOfConfiguration() { + } + + /** + * Get the moboBrokerResources property: Associated MoboBrokerResources. + * + * @return the moboBrokerResources value. + */ + public List moboBrokerResources() { + return this.moboBrokerResources; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedOnBehalfOfConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedOnBehalfOfConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedOnBehalfOfConfiguration. + */ + public static ManagedOnBehalfOfConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedOnBehalfOfConfiguration deserializedManagedOnBehalfOfConfiguration + = new ManagedOnBehalfOfConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("moboBrokerResources".equals(fieldName)) { + List moboBrokerResources + = reader.readArray(reader1 -> MoboBrokerResource.fromJson(reader1)); + deserializedManagedOnBehalfOfConfiguration.moboBrokerResources = moboBrokerResources; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedOnBehalfOfConfiguration; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ManagedServiceIdentity.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..65956c8b79be --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ManagedServiceIdentity.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class ManagedServiceIdentity implements JsonSerializable { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private String principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private String tenantId; + + /* + * The type of managed identity assigned to this resource. + */ + private ManagedServiceIdentityType type; + + /* + * The identities assigned to this resource by the user. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of managed identity assigned to this resource. + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity assigned to this resource. + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId = reader.getString(); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ManagedServiceIdentityType.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..da3a32f95496 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ManagedServiceIdentityType.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** + * No managed identity. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * System assigned managed identity. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * User assigned managed identity. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * System and user assigned managed identity. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/MarkAsCompleteRequest.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/MarkAsCompleteRequest.java new file mode 100644 index 000000000000..b83ff3cee3c4 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/MarkAsCompleteRequest.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Request body for MarkAsComplete API. + */ +@Fluent +public final class MarkAsCompleteRequest implements JsonSerializable { + /* + * State of the Drill Run. + */ + private DrillRunSubtasks drillRunStage; + + /** + * Creates an instance of MarkAsCompleteRequest class. + */ + public MarkAsCompleteRequest() { + } + + /** + * Get the drillRunStage property: State of the Drill Run. + * + * @return the drillRunStage value. + */ + public DrillRunSubtasks drillRunStage() { + return this.drillRunStage; + } + + /** + * Set the drillRunStage property: State of the Drill Run. + * + * @param drillRunStage the drillRunStage value to set. + * @return the MarkAsCompleteRequest object itself. + */ + public MarkAsCompleteRequest withDrillRunStage(DrillRunSubtasks drillRunStage) { + this.drillRunStage = drillRunStage; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("drillRunStage", this.drillRunStage == null ? null : this.drillRunStage.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MarkAsCompleteRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarkAsCompleteRequest if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MarkAsCompleteRequest. + */ + public static MarkAsCompleteRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarkAsCompleteRequest deserializedMarkAsCompleteRequest = new MarkAsCompleteRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("drillRunStage".equals(fieldName)) { + deserializedMarkAsCompleteRequest.drillRunStage = DrillRunSubtasks.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMarkAsCompleteRequest; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/MembershipType.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/MembershipType.java new file mode 100644 index 000000000000..c5a20f33cd9a --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/MembershipType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Membership type of the service group to resource. + */ +public final class MembershipType extends ExpandableStringEnum { + /** + * Resource is direct member of service group. + */ + public static final MembershipType DIRECT = fromString("Direct"); + + /** + * Resource is member of service group through subscription. + */ + public static final MembershipType THROUGH_SUBSCRIPTION = fromString("ThroughSubscription"); + + /** + * Resource is member of service group through resource group. + */ + public static final MembershipType THROUGH_RESOURCE_GROUP = fromString("ThroughResourceGroup"); + + /** + * Creates a new instance of MembershipType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MembershipType() { + } + + /** + * Creates or finds a MembershipType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MembershipType. + */ + public static MembershipType fromString(String name) { + return fromString(name, MembershipType.class); + } + + /** + * Gets known MembershipType values. + * + * @return known MembershipType values. + */ + public static Collection values() { + return values(MembershipType.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/MoboBrokerResource.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/MoboBrokerResource.java new file mode 100644 index 000000000000..09bad7555276 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/MoboBrokerResource.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * MoboBroker resource. + */ +@Immutable +public final class MoboBrokerResource implements JsonSerializable { + /* + * The fully qualified resource ID of the MoboBroker resource. + * Example: + * `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{ + * resourceType}/{resourceName}` + */ + private String id; + + /** + * Creates an instance of MoboBrokerResource class. + */ + private MoboBrokerResource() { + } + + /** + * Get the id property: The fully qualified resource ID of the MoboBroker resource. + * Example: + * `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}`. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MoboBrokerResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MoboBrokerResource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MoboBrokerResource. + */ + public static MoboBrokerResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MoboBrokerResource deserializedMoboBrokerResource = new MoboBrokerResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMoboBrokerResource.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMoboBrokerResource; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/MonitoringPropertiesOfDrill.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/MonitoringPropertiesOfDrill.java new file mode 100644 index 000000000000..01053562bd4c --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/MonitoringPropertiesOfDrill.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Drill monitoring properties. + */ +@Fluent +public final class MonitoringPropertiesOfDrill implements JsonSerializable { + /* + * Identity to use for Drill monitoring operations. + */ + private AssociatedIdentity identity; + + /* + * Full ARM Id of the Log analytics workspace created by Resiliency service where health data is collected. + */ + private String logAnalyticsWorkspaceId; + + /* + * Full ARM Id of the Data collection rule created by Resiliency service which will route data for RAW health data + * for service group resources. + */ + private String rawMetricsDataCollectionRuleId; + + /* + * Full ARM Id of the Data collection rule created by Resiliency service which will route data for Aggregate health + * data of service group. + */ + private String serviceGroupMetricsDataCollectionRuleId; + + /* + * Full ARM Id of the Data collection endpoint created by Resiliency service which will route data for service group + * and its resources. + */ + private String dataCollectionEndpointId; + + /** + * Creates an instance of MonitoringPropertiesOfDrill class. + */ + public MonitoringPropertiesOfDrill() { + } + + /** + * Get the identity property: Identity to use for Drill monitoring operations. + * + * @return the identity value. + */ + public AssociatedIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Identity to use for Drill monitoring operations. + * + * @param identity the identity value to set. + * @return the MonitoringPropertiesOfDrill object itself. + */ + public MonitoringPropertiesOfDrill withIdentity(AssociatedIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the logAnalyticsWorkspaceId property: Full ARM Id of the Log analytics workspace created by Resiliency + * service where health data is collected. + * + * @return the logAnalyticsWorkspaceId value. + */ + public String logAnalyticsWorkspaceId() { + return this.logAnalyticsWorkspaceId; + } + + /** + * Get the rawMetricsDataCollectionRuleId property: Full ARM Id of the Data collection rule created by Resiliency + * service which will route data for RAW health data for service group resources. + * + * @return the rawMetricsDataCollectionRuleId value. + */ + public String rawMetricsDataCollectionRuleId() { + return this.rawMetricsDataCollectionRuleId; + } + + /** + * Get the serviceGroupMetricsDataCollectionRuleId property: Full ARM Id of the Data collection rule created by + * Resiliency service which will route data for Aggregate health data of service group. + * + * @return the serviceGroupMetricsDataCollectionRuleId value. + */ + public String serviceGroupMetricsDataCollectionRuleId() { + return this.serviceGroupMetricsDataCollectionRuleId; + } + + /** + * Get the dataCollectionEndpointId property: Full ARM Id of the Data collection endpoint created by Resiliency + * service which will route data for service group and its resources. + * + * @return the dataCollectionEndpointId value. + */ + public String dataCollectionEndpointId() { + return this.dataCollectionEndpointId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitoringPropertiesOfDrill from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitoringPropertiesOfDrill if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MonitoringPropertiesOfDrill. + */ + public static MonitoringPropertiesOfDrill fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitoringPropertiesOfDrill deserializedMonitoringPropertiesOfDrill = new MonitoringPropertiesOfDrill(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedMonitoringPropertiesOfDrill.identity = AssociatedIdentity.fromJson(reader); + } else if ("logAnalyticsWorkspaceId".equals(fieldName)) { + deserializedMonitoringPropertiesOfDrill.logAnalyticsWorkspaceId = reader.getString(); + } else if ("rawMetricsDataCollectionRuleId".equals(fieldName)) { + deserializedMonitoringPropertiesOfDrill.rawMetricsDataCollectionRuleId = reader.getString(); + } else if ("serviceGroupMetricsDataCollectionRuleId".equals(fieldName)) { + deserializedMonitoringPropertiesOfDrill.serviceGroupMetricsDataCollectionRuleId + = reader.getString(); + } else if ("dataCollectionEndpointId".equals(fieldName)) { + deserializedMonitoringPropertiesOfDrill.dataCollectionEndpointId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoringPropertiesOfDrill; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Operation.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Operation.java new file mode 100644 index 000000000000..657a0239dc06 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Operation.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.resourcemanager.resiliencemanagement.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.resiliencemanagement.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/OperationDisplay.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/OperationDisplay.java new file mode 100644 index 000000000000..9ac22e1402a4 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Localized display information for an operation. + */ +@Immutable +public final class OperationDisplay implements JsonSerializable { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". + */ + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". + */ + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + */ + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + private OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/OperationQualificationDetails.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/OperationQualificationDetails.java new file mode 100644 index 000000000000..f6a62a3015b3 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/OperationQualificationDetails.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Details of qualification for an operation. + */ +@Immutable +public final class OperationQualificationDetails implements JsonSerializable { + /* + * Resource qualification state for the operation. + */ + private QualificationState qualificationState; + + /* + * Reasons for resource not qualified for the operation. + */ + private List notQualifiedReasons; + + /** + * Creates an instance of OperationQualificationDetails class. + */ + private OperationQualificationDetails() { + } + + /** + * Get the qualificationState property: Resource qualification state for the operation. + * + * @return the qualificationState value. + */ + public QualificationState qualificationState() { + return this.qualificationState; + } + + /** + * Get the notQualifiedReasons property: Reasons for resource not qualified for the operation. + * + * @return the notQualifiedReasons value. + */ + public List notQualifiedReasons() { + return this.notQualifiedReasons; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("qualificationState", + this.qualificationState == null ? null : this.qualificationState.toString()); + jsonWriter.writeArrayField("notQualifiedReasons", this.notQualifiedReasons, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationQualificationDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationQualificationDetails if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationQualificationDetails. + */ + public static OperationQualificationDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationQualificationDetails deserializedOperationQualificationDetails + = new OperationQualificationDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("qualificationState".equals(fieldName)) { + deserializedOperationQualificationDetails.qualificationState + = QualificationState.fromString(reader.getString()); + } else if ("notQualifiedReasons".equals(fieldName)) { + List notQualifiedReasons = reader.readArray(reader1 -> reader1.getString()); + deserializedOperationQualificationDetails.notQualifiedReasons = notQualifiedReasons; + } else { + reader.skipChildren(); + } + } + + return deserializedOperationQualificationDetails; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/OperationStatus.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/OperationStatus.java new file mode 100644 index 000000000000..dac7f3a57bb8 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/OperationStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of OperationStatus. + */ +public interface OperationStatus { + /** + * Returns the current status of an async operation. + * + * @param location The location name. + * @param operationId The ID of an ongoing async 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 current status of an async operation along with {@link Response}. + */ + Response getWithResponse(String location, String operationId, Context context); + + /** + * Returns the current status of an async operation. + * + * @param location The location name. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult get(String location, String operationId); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/OperationStatusResult.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/OperationStatusResult.java new file mode 100644 index 000000000000..edfbf0738c4c --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/OperationStatusResult.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.OperationStatusResultInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of OperationStatusResult. + */ +public interface OperationStatusResult { + /** + * Gets the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the async operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: Operation status. + * + * @return the status value. + */ + String status(); + + /** + * Gets the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + Double percentComplete(); + + /** + * Gets the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the operations property: The operations list. + * + * @return the operations value. + */ + List operations(); + + /** + * Gets the error property: If present, details of the operation error. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + String resourceId(); + + /** + * Gets the inner com.azure.resourcemanager.resiliencemanagement.fluent.models.OperationStatusResultInner object. + * + * @return the inner object. + */ + OperationStatusResultInner innerModel(); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Operations.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Operations.java new file mode 100644 index 000000000000..b0c8489f8e45 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Operations.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Operations. + */ +public interface Operations { + /** + * List the operations for the 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List the operations for the 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Origin.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Origin.java new file mode 100644 index 000000000000..c05b2e8691fb --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Origin.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Indicates the operation is initiated by a user. + */ + public static final Origin USER = fromString("user"); + + /** + * Indicates the operation is initiated by a system. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Indicates the operation is initiated by a user or system. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ProvisioningState.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ProvisioningState.java new file mode 100644 index 000000000000..923335f00926 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ProvisioningState.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of the current operation. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Resource has been created. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Resource creation failed. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Resource creation was canceled. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Initial provisioning in progress. + */ + public static final ProvisioningState PROVISIONING = fromString("Provisioning"); + + /** + * Update in progress. + */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * Deletion in progress. + */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** + * Change accepted for processing. + */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/QualificationState.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/QualificationState.java new file mode 100644 index 000000000000..1ba3ff8565f5 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/QualificationState.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * A state type that indicates qualification of a resource for an operation. + */ +public final class QualificationState extends ExpandableStringEnum { + /** + * A state that indicates the qualification state is unknown. + */ + public static final QualificationState UNKNOWN = fromString("Unknown"); + + /** + * A state that indicates the resource is qualified for the operation. + */ + public static final QualificationState QUALIFIED = fromString("Qualified"); + + /** + * A state that indicates the resource is not qualified for the operation. + */ + public static final QualificationState NOT_QUALIFIED = fromString("NotQualified"); + + /** + * A state that indicates the resource is excluded from the recovery plan itself. + */ + public static final QualificationState EXCLUDED = fromString("Excluded"); + + /** + * Creates a new instance of QualificationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public QualificationState() { + } + + /** + * Creates or finds a QualificationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding QualificationState. + */ + public static QualificationState fromString(String name) { + return fromString(name, QualificationState.class); + } + + /** + * Gets known QualificationState values. + * + * @return known QualificationState values. + */ + public static Collection values() { + return values(QualificationState.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RBACSetupMode.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RBACSetupMode.java new file mode 100644 index 000000000000..ec5007e2c467 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RBACSetupMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * RBAC setup mode. + */ +public final class RBACSetupMode extends ExpandableStringEnum { + /** + * Automated-CustomRole mode. + */ + public static final RBACSetupMode AUTOMATED_CUSTOM_ROLE = fromString("AutomatedCustomRole"); + + /** + * Automated-BuiltinRoles mode. + */ + public static final RBACSetupMode AUTOMATED_BUILTIN_ROLES = fromString("AutomatedBuiltinRoles"); + + /** + * Manual mode. + */ + public static final RBACSetupMode MANUAL = fromString("Manual"); + + /** + * Creates a new instance of RBACSetupMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RBACSetupMode() { + } + + /** + * Creates or finds a RBACSetupMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding RBACSetupMode. + */ + public static RBACSetupMode fromString(String name) { + return fromString(name, RBACSetupMode.class); + } + + /** + * Gets known RBACSetupMode values. + * + * @return known RBACSetupMode values. + */ + public static Collection values() { + return values(RBACSetupMode.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RBACState.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RBACState.java new file mode 100644 index 000000000000..aff35d23164f --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RBACState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum for AttentionReason - RBAC state on a resource. + */ +public final class RBACState extends ExpandableStringEnum { + /** + * RBAC set. + */ + public static final RBACState SET = fromString("Set"); + + /** + * RBAC not set. + */ + public static final RBACState NOT_SET = fromString("NotSet"); + + /** + * Creates a new instance of RBACState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RBACState() { + } + + /** + * Creates or finds a RBACState from its string representation. + * + * @param name a name to look for. + * @return the corresponding RBACState. + */ + public static RBACState fromString(String name) { + return fromString(name, RBACState.class); + } + + /** + * Gets known RBACState values. + * + * @return known RBACState values. + */ + public static Collection values() { + return values(RBACState.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ReasonForRequestingConfirmation.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ReasonForRequestingConfirmation.java new file mode 100644 index 000000000000..76575ef14cf5 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ReasonForRequestingConfirmation.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum for the reason for requesting user confirmation for a high availability solution. + */ +public final class ReasonForRequestingConfirmation extends ExpandableStringEnum { + /** + * Zone pinned ZRS data disks conditional. + */ + public static final ReasonForRequestingConfirmation ZONE_PINNED_ZRS_DATA_DISKS_CONDITIONAL + = fromString("ZonePinnedZrsDataDisksConditional"); + + /** + * VM in multi-zone scale set stateless only. + */ + public static final ReasonForRequestingConfirmation VM_IN_MULTI_ZONE_SCALE_SET_STATELESS_ONLY + = fromString("VmInMultiZoneScaleSetStatelessOnly"); + + /** + * Creates a new instance of ReasonForRequestingConfirmation value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ReasonForRequestingConfirmation() { + } + + /** + * Creates or finds a ReasonForRequestingConfirmation from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReasonForRequestingConfirmation. + */ + public static ReasonForRequestingConfirmation fromString(String name) { + return fromString(name, ReasonForRequestingConfirmation.class); + } + + /** + * Gets known ReasonForRequestingConfirmation values. + * + * @return known ReasonForRequestingConfirmation values. + */ + public static Collection values() { + return values(ReasonForRequestingConfirmation.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecommendCapacityRequest.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecommendCapacityRequest.java new file mode 100644 index 000000000000..3ff738e7b9f7 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecommendCapacityRequest.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Request body for the recommend capacity action. Provide specific resource IDs to evaluate, or pass an empty array to + * let the service automatically select non-resilient resources from the goal assignment. + */ +@Fluent +public final class RecommendCapacityRequest implements JsonSerializable { + /* + * Azure resource IDs to evaluate for resiliency. Pass an empty array to automatically discover and evaluate + * non-resilient resources in the service group. Maximum 50 resources per request. + */ + private List resourceIds; + + /** + * Creates an instance of RecommendCapacityRequest class. + */ + public RecommendCapacityRequest() { + } + + /** + * Get the resourceIds property: Azure resource IDs to evaluate for resiliency. Pass an empty array to automatically + * discover and evaluate non-resilient resources in the service group. Maximum 50 resources per request. + * + * @return the resourceIds value. + */ + public List resourceIds() { + return this.resourceIds; + } + + /** + * Set the resourceIds property: Azure resource IDs to evaluate for resiliency. Pass an empty array to automatically + * discover and evaluate non-resilient resources in the service group. Maximum 50 resources per request. + * + * @param resourceIds the resourceIds value to set. + * @return the RecommendCapacityRequest object itself. + */ + public RecommendCapacityRequest withResourceIds(List resourceIds) { + this.resourceIds = resourceIds; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("resourceIds", this.resourceIds, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecommendCapacityRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecommendCapacityRequest if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecommendCapacityRequest. + */ + public static RecommendCapacityRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecommendCapacityRequest deserializedRecommendCapacityRequest = new RecommendCapacityRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceIds".equals(fieldName)) { + List resourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedRecommendCapacityRequest.resourceIds = resourceIds; + } else { + reader.skipChildren(); + } + } + + return deserializedRecommendCapacityRequest; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecommendationsData.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecommendationsData.java new file mode 100644 index 000000000000..04592776832e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecommendationsData.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of recommendations data in unified resilience item. + */ +@Immutable +public final class RecommendationsData implements JsonSerializable { + /* + * The high availability section of resilience recommendation. + */ + private RecommendationsHighAvailabilityData highAvailability; + + /** + * Creates an instance of RecommendationsData class. + */ + private RecommendationsData() { + } + + /** + * Get the highAvailability property: The high availability section of resilience recommendation. + * + * @return the highAvailability value. + */ + public RecommendationsHighAvailabilityData highAvailability() { + return this.highAvailability; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("highAvailability", this.highAvailability); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecommendationsData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecommendationsData if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecommendationsData. + */ + public static RecommendationsData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecommendationsData deserializedRecommendationsData = new RecommendationsData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("highAvailability".equals(fieldName)) { + deserializedRecommendationsData.highAvailability + = RecommendationsHighAvailabilityData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRecommendationsData; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecommendationsHighAvailabilityData.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecommendationsHighAvailabilityData.java new file mode 100644 index 000000000000..1aea404eccb3 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecommendationsHighAvailabilityData.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of recommendation data related to high availability in unified resilience item. + */ +@Immutable +public final class RecommendationsHighAvailabilityData + implements JsonSerializable { + /* + * Count of resources that have high availability enabled. + */ + private Long enabledResourceCount; + + /* + * Count of resources that do not have high availability enabled. + */ + private Long notEnabledResourceCount; + + /* + * Count of resources that have not been evaluated for high availability. + */ + private Long notEvaluatedResourceCount; + + /* + * The date and time when the high availability recommendations were last evaluated. + */ + private OffsetDateTime evaluationDateTime; + + /** + * Creates an instance of RecommendationsHighAvailabilityData class. + */ + private RecommendationsHighAvailabilityData() { + } + + /** + * Get the enabledResourceCount property: Count of resources that have high availability enabled. + * + * @return the enabledResourceCount value. + */ + public Long enabledResourceCount() { + return this.enabledResourceCount; + } + + /** + * Get the notEnabledResourceCount property: Count of resources that do not have high availability enabled. + * + * @return the notEnabledResourceCount value. + */ + public Long notEnabledResourceCount() { + return this.notEnabledResourceCount; + } + + /** + * Get the notEvaluatedResourceCount property: Count of resources that have not been evaluated for high + * availability. + * + * @return the notEvaluatedResourceCount value. + */ + public Long notEvaluatedResourceCount() { + return this.notEvaluatedResourceCount; + } + + /** + * Get the evaluationDateTime property: The date and time when the high availability recommendations were last + * evaluated. + * + * @return the evaluationDateTime value. + */ + public OffsetDateTime evaluationDateTime() { + return this.evaluationDateTime; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("enabledResourceCount", this.enabledResourceCount); + jsonWriter.writeNumberField("notEnabledResourceCount", this.notEnabledResourceCount); + jsonWriter.writeNumberField("notEvaluatedResourceCount", this.notEvaluatedResourceCount); + jsonWriter.writeStringField("evaluationDateTime", + this.evaluationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.evaluationDateTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecommendationsHighAvailabilityData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecommendationsHighAvailabilityData if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RecommendationsHighAvailabilityData. + */ + public static RecommendationsHighAvailabilityData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecommendationsHighAvailabilityData deserializedRecommendationsHighAvailabilityData + = new RecommendationsHighAvailabilityData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabledResourceCount".equals(fieldName)) { + deserializedRecommendationsHighAvailabilityData.enabledResourceCount + = reader.getNullable(JsonReader::getLong); + } else if ("notEnabledResourceCount".equals(fieldName)) { + deserializedRecommendationsHighAvailabilityData.notEnabledResourceCount + = reader.getNullable(JsonReader::getLong); + } else if ("notEvaluatedResourceCount".equals(fieldName)) { + deserializedRecommendationsHighAvailabilityData.notEvaluatedResourceCount + = reader.getNullable(JsonReader::getLong); + } else if ("evaluationDateTime".equals(fieldName)) { + deserializedRecommendationsHighAvailabilityData.evaluationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedRecommendationsHighAvailabilityData; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryActionRequest.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryActionRequest.java new file mode 100644 index 000000000000..44fc8a1dc6c7 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryActionRequest.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Request body for providing user input for a recovery action. + */ +@Fluent +public final class RecoveryActionRequest implements JsonSerializable { + /* + * User-provided input for the action. + */ + private String description; + + /** + * Creates an instance of RecoveryActionRequest class. + */ + public RecoveryActionRequest() { + } + + /** + * Get the description property: User-provided input for the action. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: User-provided input for the action. + * + * @param description the description value to set. + * @return the RecoveryActionRequest object itself. + */ + public RecoveryActionRequest withDescription(String description) { + this.description = description; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryActionRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryActionRequest if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RecoveryActionRequest. + */ + public static RecoveryActionRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryActionRequest deserializedRecoveryActionRequest = new RecoveryActionRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedRecoveryActionRequest.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryActionRequest; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroup.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroup.java new file mode 100644 index 000000000000..dd9d152511b9 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroup.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a recovery orchestration group resource in the Azure Resilience Management provider namespace. + */ +@Fluent +public final class RecoveryGroup extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private RecoveryGroupProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RecoveryGroup class. + */ + public RecoveryGroup() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public RecoveryGroupProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the RecoveryGroup object itself. + */ + public RecoveryGroup withProperties(RecoveryGroupProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryGroup if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecoveryGroup. + */ + public static RecoveryGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryGroup deserializedRecoveryGroup = new RecoveryGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRecoveryGroup.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRecoveryGroup.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRecoveryGroup.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRecoveryGroup.properties = RecoveryGroupProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRecoveryGroup.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryGroup; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupActionSettings.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupActionSettings.java new file mode 100644 index 000000000000..4bf1c5bb535a --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupActionSettings.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Settings for a recovery group action. + */ +@Immutable +public final class RecoveryGroupActionSettings implements JsonSerializable { + /* + * The action task associated with this job resource. + */ + private ActionTask actionTask; + + /* + * Sequence number for the action. + */ + private Integer actionSequence; + + /* + * Type of the recovery group action. + */ + private RecoveryGroupActionType recoveryGroupActionType; + + /* + * Name of the action. + */ + private String actionName; + + /* + * User description of the action. + */ + private String actionDescription; + + /** + * Creates an instance of RecoveryGroupActionSettings class. + */ + private RecoveryGroupActionSettings() { + } + + /** + * Get the actionTask property: The action task associated with this job resource. + * + * @return the actionTask value. + */ + public ActionTask actionTask() { + return this.actionTask; + } + + /** + * Get the actionSequence property: Sequence number for the action. + * + * @return the actionSequence value. + */ + public Integer actionSequence() { + return this.actionSequence; + } + + /** + * Get the recoveryGroupActionType property: Type of the recovery group action. + * + * @return the recoveryGroupActionType value. + */ + public RecoveryGroupActionType recoveryGroupActionType() { + return this.recoveryGroupActionType; + } + + /** + * Get the actionName property: Name of the action. + * + * @return the actionName value. + */ + public String actionName() { + return this.actionName; + } + + /** + * Get the actionDescription property: User description of the action. + * + * @return the actionDescription value. + */ + public String actionDescription() { + return this.actionDescription; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryGroupActionSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryGroupActionSettings if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RecoveryGroupActionSettings. + */ + public static RecoveryGroupActionSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryGroupActionSettings deserializedRecoveryGroupActionSettings = new RecoveryGroupActionSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actionTask".equals(fieldName)) { + deserializedRecoveryGroupActionSettings.actionTask = ActionTask.fromString(reader.getString()); + } else if ("actionSequence".equals(fieldName)) { + deserializedRecoveryGroupActionSettings.actionSequence = reader.getNullable(JsonReader::getInt); + } else if ("recoveryGroupActionType".equals(fieldName)) { + deserializedRecoveryGroupActionSettings.recoveryGroupActionType + = RecoveryGroupActionType.fromString(reader.getString()); + } else if ("actionName".equals(fieldName)) { + deserializedRecoveryGroupActionSettings.actionName = reader.getString(); + } else if ("actionDescription".equals(fieldName)) { + deserializedRecoveryGroupActionSettings.actionDescription = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryGroupActionSettings; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupActionType.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupActionType.java new file mode 100644 index 000000000000..d75f18261172 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupActionType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the type of recovery orchestration group actions. + */ +public final class RecoveryGroupActionType extends ExpandableStringEnum { + /** + * A manual action type for the recovery orchestration group. + */ + public static final RecoveryGroupActionType MANUAL_ACTION = fromString("ManualAction"); + + /** + * A custom runbook action type for the recovery orchestration group. + */ + public static final RecoveryGroupActionType CUSTOM_RUNBOOK = fromString("CustomRunbook"); + + /** + * Creates a new instance of RecoveryGroupActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RecoveryGroupActionType() { + } + + /** + * Creates or finds a RecoveryGroupActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecoveryGroupActionType. + */ + public static RecoveryGroupActionType fromString(String name) { + return fromString(name, RecoveryGroupActionType.class); + } + + /** + * Gets known RecoveryGroupActionType values. + * + * @return known RecoveryGroupActionType values. + */ + public static Collection values() { + return values(RecoveryGroupActionType.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupBaseAction.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupBaseAction.java new file mode 100644 index 000000000000..464ac20df869 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupBaseAction.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines an action for the recovery orchestration group. + */ +@Fluent +public class RecoveryGroupBaseAction implements JsonSerializable { + /* + * The type of the recovery orchestration group action. + */ + private RecoveryGroupActionType type = RecoveryGroupActionType.fromString("RecoveryGroupBaseAction"); + + /* + * The name of the recovery orchestration group action. + */ + private String name; + + /* + * A description of the recovery orchestration group action, containing the instructions to be performed during this + * action. + */ + private String description; + + /* + * The maximum amount of time, in minutes, allowed for the action to complete before it times out. + */ + private int timeoutInMinutes; + + /** + * Creates an instance of RecoveryGroupBaseAction class. + */ + public RecoveryGroupBaseAction() { + } + + /** + * Get the type property: The type of the recovery orchestration group action. + * + * @return the type value. + */ + public RecoveryGroupActionType type() { + return this.type; + } + + /** + * Get the name property: The name of the recovery orchestration group action. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the recovery orchestration group action. + * + * @param name the name value to set. + * @return the RecoveryGroupBaseAction object itself. + */ + public RecoveryGroupBaseAction withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: A description of the recovery orchestration group action, containing the + * instructions to be performed during this action. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the recovery orchestration group action, containing the + * instructions to be performed during this action. + * + * @param description the description value to set. + * @return the RecoveryGroupBaseAction object itself. + */ + public RecoveryGroupBaseAction withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the timeoutInMinutes property: The maximum amount of time, in minutes, allowed for the action to complete + * before it times out. + * + * @return the timeoutInMinutes value. + */ + public int timeoutInMinutes() { + return this.timeoutInMinutes; + } + + /** + * Set the timeoutInMinutes property: The maximum amount of time, in minutes, allowed for the action to complete + * before it times out. + * + * @param timeoutInMinutes the timeoutInMinutes value to set. + * @return the RecoveryGroupBaseAction object itself. + */ + public RecoveryGroupBaseAction withTimeoutInMinutes(int timeoutInMinutes) { + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeIntField("timeoutInMinutes", this.timeoutInMinutes); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryGroupBaseAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryGroupBaseAction if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecoveryGroupBaseAction. + */ + public static RecoveryGroupBaseAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("ManualAction".equals(discriminatorValue)) { + return RecoveryGroupManualAction.fromJson(readerToUse.reset()); + } else if ("CustomRunbook".equals(discriminatorValue)) { + return RecoveryGroupCustomRunbookAction.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static RecoveryGroupBaseAction fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryGroupBaseAction deserializedRecoveryGroupBaseAction = new RecoveryGroupBaseAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedRecoveryGroupBaseAction.name = reader.getString(); + } else if ("timeoutInMinutes".equals(fieldName)) { + deserializedRecoveryGroupBaseAction.timeoutInMinutes = reader.getInt(); + } else if ("type".equals(fieldName)) { + deserializedRecoveryGroupBaseAction.type = RecoveryGroupActionType.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedRecoveryGroupBaseAction.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryGroupBaseAction; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupCustomRunbookAction.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupCustomRunbookAction.java new file mode 100644 index 000000000000..f396b2c7808d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupCustomRunbookAction.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Defines a custom runbook action for the recovery orchestration group. + */ +@Fluent +public final class RecoveryGroupCustomRunbookAction extends RecoveryGroupBaseAction { + /* + * The type of the recovery orchestration group action. + */ + private RecoveryGroupActionType type = RecoveryGroupActionType.CUSTOM_RUNBOOK; + + /* + * The ARM Resource ID of the resource that includes the actionable script, such as a Runbook in an Automation + * Account. + */ + private String actionResourceId; + + /* + * Key-value parameters for the operation. + */ + private Map parameters; + + /* + * The identity associated with actionResourceId for RBAC. + */ + private AssociatedIdentity associatedIdentity; + + /** + * Creates an instance of RecoveryGroupCustomRunbookAction class. + */ + public RecoveryGroupCustomRunbookAction() { + } + + /** + * Get the type property: The type of the recovery orchestration group action. + * + * @return the type value. + */ + @Override + public RecoveryGroupActionType type() { + return this.type; + } + + /** + * Get the actionResourceId property: The ARM Resource ID of the resource that includes the actionable script, such + * as a Runbook in an Automation Account. + * + * @return the actionResourceId value. + */ + public String actionResourceId() { + return this.actionResourceId; + } + + /** + * Set the actionResourceId property: The ARM Resource ID of the resource that includes the actionable script, such + * as a Runbook in an Automation Account. + * + * @param actionResourceId the actionResourceId value to set. + * @return the RecoveryGroupCustomRunbookAction object itself. + */ + public RecoveryGroupCustomRunbookAction withActionResourceId(String actionResourceId) { + this.actionResourceId = actionResourceId; + return this; + } + + /** + * Get the parameters property: Key-value parameters for the operation. + * + * @return the parameters value. + */ + public Map parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Key-value parameters for the operation. + * + * @param parameters the parameters value to set. + * @return the RecoveryGroupCustomRunbookAction object itself. + */ + public RecoveryGroupCustomRunbookAction withParameters(Map parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the associatedIdentity property: The identity associated with actionResourceId for RBAC. + * + * @return the associatedIdentity value. + */ + public AssociatedIdentity associatedIdentity() { + return this.associatedIdentity; + } + + /** + * Set the associatedIdentity property: The identity associated with actionResourceId for RBAC. + * + * @param associatedIdentity the associatedIdentity value to set. + * @return the RecoveryGroupCustomRunbookAction object itself. + */ + public RecoveryGroupCustomRunbookAction withAssociatedIdentity(AssociatedIdentity associatedIdentity) { + this.associatedIdentity = associatedIdentity; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RecoveryGroupCustomRunbookAction withName(String name) { + super.withName(name); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RecoveryGroupCustomRunbookAction withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RecoveryGroupCustomRunbookAction withTimeoutInMinutes(int timeoutInMinutes) { + super.withTimeoutInMinutes(timeoutInMinutes); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeIntField("timeoutInMinutes", timeoutInMinutes()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("actionResourceId", this.actionResourceId); + jsonWriter.writeMapField("parameters", this.parameters, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("associatedIdentity", this.associatedIdentity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryGroupCustomRunbookAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryGroupCustomRunbookAction if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecoveryGroupCustomRunbookAction. + */ + public static RecoveryGroupCustomRunbookAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryGroupCustomRunbookAction deserializedRecoveryGroupCustomRunbookAction + = new RecoveryGroupCustomRunbookAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedRecoveryGroupCustomRunbookAction.withName(reader.getString()); + } else if ("timeoutInMinutes".equals(fieldName)) { + deserializedRecoveryGroupCustomRunbookAction.withTimeoutInMinutes(reader.getInt()); + } else if ("description".equals(fieldName)) { + deserializedRecoveryGroupCustomRunbookAction.withDescription(reader.getString()); + } else if ("type".equals(fieldName)) { + deserializedRecoveryGroupCustomRunbookAction.type + = RecoveryGroupActionType.fromString(reader.getString()); + } else if ("actionResourceId".equals(fieldName)) { + deserializedRecoveryGroupCustomRunbookAction.actionResourceId = reader.getString(); + } else if ("parameters".equals(fieldName)) { + Map parameters = reader.readMap(reader1 -> reader1.getString()); + deserializedRecoveryGroupCustomRunbookAction.parameters = parameters; + } else if ("associatedIdentity".equals(fieldName)) { + deserializedRecoveryGroupCustomRunbookAction.associatedIdentity + = AssociatedIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryGroupCustomRunbookAction; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupManualAction.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupManualAction.java new file mode 100644 index 000000000000..d1d04cfc9cfa --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupManualAction.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines a manual action for the recovery orchestration group. + */ +@Fluent +public final class RecoveryGroupManualAction extends RecoveryGroupBaseAction { + /* + * The type of the recovery orchestration group action. + */ + private RecoveryGroupActionType type = RecoveryGroupActionType.MANUAL_ACTION; + + /** + * Creates an instance of RecoveryGroupManualAction class. + */ + public RecoveryGroupManualAction() { + } + + /** + * Get the type property: The type of the recovery orchestration group action. + * + * @return the type value. + */ + @Override + public RecoveryGroupActionType type() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Override + public RecoveryGroupManualAction withName(String name) { + super.withName(name); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RecoveryGroupManualAction withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RecoveryGroupManualAction withTimeoutInMinutes(int timeoutInMinutes) { + super.withTimeoutInMinutes(timeoutInMinutes); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeIntField("timeoutInMinutes", timeoutInMinutes()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryGroupManualAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryGroupManualAction if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecoveryGroupManualAction. + */ + public static RecoveryGroupManualAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryGroupManualAction deserializedRecoveryGroupManualAction = new RecoveryGroupManualAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedRecoveryGroupManualAction.withName(reader.getString()); + } else if ("timeoutInMinutes".equals(fieldName)) { + deserializedRecoveryGroupManualAction.withTimeoutInMinutes(reader.getInt()); + } else if ("description".equals(fieldName)) { + deserializedRecoveryGroupManualAction.withDescription(reader.getString()); + } else if ("type".equals(fieldName)) { + deserializedRecoveryGroupManualAction.type = RecoveryGroupActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryGroupManualAction; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupProperties.java new file mode 100644 index 000000000000..1ea6b0d6bb3f --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupProperties.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the recovery orchestration group. + */ +@Fluent +public final class RecoveryGroupProperties implements JsonSerializable { + /* + * A unique id for the recovery orchestration group, which is a GUID. + */ + private String groupUniqueId; + + /* + * The order ID of the recovery orchestration group. + */ + private int orderId; + + /* + * A description of the recovery orchestration group. + */ + private String description; + + /* + * Pre-actions for the recovery orchestration group. + */ + private List preActions; + + /* + * Post-actions for the recovery orchestration group. + */ + private List postActions; + + /** + * Creates an instance of RecoveryGroupProperties class. + */ + public RecoveryGroupProperties() { + } + + /** + * Get the groupUniqueId property: A unique id for the recovery orchestration group, which is a GUID. + * + * @return the groupUniqueId value. + */ + public String groupUniqueId() { + return this.groupUniqueId; + } + + /** + * Set the groupUniqueId property: A unique id for the recovery orchestration group, which is a GUID. + * + * @param groupUniqueId the groupUniqueId value to set. + * @return the RecoveryGroupProperties object itself. + */ + public RecoveryGroupProperties withGroupUniqueId(String groupUniqueId) { + this.groupUniqueId = groupUniqueId; + return this; + } + + /** + * Get the orderId property: The order ID of the recovery orchestration group. + * + * @return the orderId value. + */ + public int orderId() { + return this.orderId; + } + + /** + * Set the orderId property: The order ID of the recovery orchestration group. + * + * @param orderId the orderId value to set. + * @return the RecoveryGroupProperties object itself. + */ + public RecoveryGroupProperties withOrderId(int orderId) { + this.orderId = orderId; + return this; + } + + /** + * Get the description property: A description of the recovery orchestration group. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the recovery orchestration group. + * + * @param description the description value to set. + * @return the RecoveryGroupProperties object itself. + */ + public RecoveryGroupProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the preActions property: Pre-actions for the recovery orchestration group. + * + * @return the preActions value. + */ + public List preActions() { + return this.preActions; + } + + /** + * Set the preActions property: Pre-actions for the recovery orchestration group. + * + * @param preActions the preActions value to set. + * @return the RecoveryGroupProperties object itself. + */ + public RecoveryGroupProperties withPreActions(List preActions) { + this.preActions = preActions; + return this; + } + + /** + * Get the postActions property: Post-actions for the recovery orchestration group. + * + * @return the postActions value. + */ + public List postActions() { + return this.postActions; + } + + /** + * Set the postActions property: Post-actions for the recovery orchestration group. + * + * @param postActions the postActions value to set. + * @return the RecoveryGroupProperties object itself. + */ + public RecoveryGroupProperties withPostActions(List postActions) { + this.postActions = postActions; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("groupUniqueId", this.groupUniqueId); + jsonWriter.writeIntField("orderId", this.orderId); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("preActions", this.preActions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("postActions", this.postActions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryGroupProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecoveryGroupProperties. + */ + public static RecoveryGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryGroupProperties deserializedRecoveryGroupProperties = new RecoveryGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupUniqueId".equals(fieldName)) { + deserializedRecoveryGroupProperties.groupUniqueId = reader.getString(); + } else if ("orderId".equals(fieldName)) { + deserializedRecoveryGroupProperties.orderId = reader.getInt(); + } else if ("description".equals(fieldName)) { + deserializedRecoveryGroupProperties.description = reader.getString(); + } else if ("preActions".equals(fieldName)) { + List preActions + = reader.readArray(reader1 -> RecoveryGroupBaseAction.fromJson(reader1)); + deserializedRecoveryGroupProperties.preActions = preActions; + } else if ("postActions".equals(fieldName)) { + List postActions + = reader.readArray(reader1 -> RecoveryGroupBaseAction.fromJson(reader1)); + deserializedRecoveryGroupProperties.postActions = postActions; + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryGroupProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupsSetting.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupsSetting.java new file mode 100644 index 000000000000..521410a2bdcf --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupsSetting.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Settings for the recovery orchestration groups. + */ +@Fluent +public final class RecoveryGroupsSetting implements JsonSerializable { + /* + * The default recovery orchestration group setting. Every recovery orchestration plan has a default recovery + * orchestration group. + */ + private RecoveryGroup defaultGroup; + + /* + * Additional recovery orchestration group settings. + */ + private List additionalGroups; + + /** + * Creates an instance of RecoveryGroupsSetting class. + */ + public RecoveryGroupsSetting() { + } + + /** + * Get the defaultGroup property: The default recovery orchestration group setting. Every recovery orchestration + * plan has a default recovery orchestration group. + * + * @return the defaultGroup value. + */ + public RecoveryGroup defaultGroup() { + return this.defaultGroup; + } + + /** + * Set the defaultGroup property: The default recovery orchestration group setting. Every recovery orchestration + * plan has a default recovery orchestration group. + * + * @param defaultGroup the defaultGroup value to set. + * @return the RecoveryGroupsSetting object itself. + */ + public RecoveryGroupsSetting withDefaultGroup(RecoveryGroup defaultGroup) { + this.defaultGroup = defaultGroup; + return this; + } + + /** + * Get the additionalGroups property: Additional recovery orchestration group settings. + * + * @return the additionalGroups value. + */ + public List additionalGroups() { + return this.additionalGroups; + } + + /** + * Set the additionalGroups property: Additional recovery orchestration group settings. + * + * @param additionalGroups the additionalGroups value to set. + * @return the RecoveryGroupsSetting object itself. + */ + public RecoveryGroupsSetting withAdditionalGroups(List additionalGroups) { + this.additionalGroups = additionalGroups; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("defaultGroup", this.defaultGroup); + jsonWriter.writeArrayField("additionalGroups", this.additionalGroups, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryGroupsSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryGroupsSetting if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecoveryGroupsSetting. + */ + public static RecoveryGroupsSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryGroupsSetting deserializedRecoveryGroupsSetting = new RecoveryGroupsSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("defaultGroup".equals(fieldName)) { + deserializedRecoveryGroupsSetting.defaultGroup = RecoveryGroup.fromJson(reader); + } else if ("additionalGroups".equals(fieldName)) { + List additionalGroups = reader.readArray(reader1 -> RecoveryGroup.fromJson(reader1)); + deserializedRecoveryGroupsSetting.additionalGroups = additionalGroups; + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryGroupsSetting; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJob.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJob.java new file mode 100644 index 000000000000..372c2629eaac --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJob.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryJobInner; + +/** + * An immutable client-side representation of RecoveryJob. + */ +public interface RecoveryJob { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + RecoveryJobProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryJobInner object. + * + * @return the inner object. + */ + RecoveryJobInner innerModel(); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobProperties.java new file mode 100644 index 000000000000..103b33de1980 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobProperties.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.util.List; + +/** + * Definition of recovery job associated with Recovery Orchestration Plan. + */ +@Immutable +public final class RecoveryJobProperties extends JobProperties { + /* + * The type of job. + */ + private JobType jobType = JobType.RECOVERY_PLAN; + + /* + * The provisioning state of the recovery job. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of RecoveryJobProperties class. + */ + private RecoveryJobProperties() { + } + + /** + * Get the jobType property: The type of job. + * + * @return the jobType value. + */ + @Override + public JobType jobType() { + return this.jobType; + } + + /** + * Get the provisioningState property: The provisioning state of the recovery job. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("errorDetails", errorDetails()); + jsonWriter.writeArrayField("retryDetails", retryDetails(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("jobExtendedInfo", jobExtendedInfo()); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryJobProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RecoveryJobProperties. + */ + public static RecoveryJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryJobProperties deserializedRecoveryJobProperties = new RecoveryJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedRecoveryJobProperties.withStatus(JobStatus.fromString(reader.getString())); + } else if ("startTime".equals(fieldName)) { + deserializedRecoveryJobProperties.withStartTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("endTime".equals(fieldName)) { + deserializedRecoveryJobProperties.withEndTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("duration".equals(fieldName)) { + deserializedRecoveryJobProperties + .withDuration(reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()))); + } else if ("errorDetails".equals(fieldName)) { + deserializedRecoveryJobProperties.withErrorDetails(JobErrorInfo.fromJson(reader)); + } else if ("resourceId".equals(fieldName)) { + deserializedRecoveryJobProperties.withResourceId(reader.getString()); + } else if ("operation".equals(fieldName)) { + deserializedRecoveryJobProperties.withOperation(reader.getString()); + } else if ("retryDetails".equals(fieldName)) { + List retryDetails = reader.readArray(reader1 -> JobRetryDetails.fromJson(reader1)); + deserializedRecoveryJobProperties.withRetryDetails(retryDetails); + } else if ("jobExtendedInfo".equals(fieldName)) { + deserializedRecoveryJobProperties.withJobExtendedInfo(JobExtendedInfo.fromJson(reader)); + } else if ("userComments".equals(fieldName)) { + List userComments = reader.readArray(reader1 -> JobUserComment.fromJson(reader1)); + deserializedRecoveryJobProperties.withUserComments(userComments); + } else if ("executionConfigurations".equals(fieldName)) { + deserializedRecoveryJobProperties + .withExecutionConfigurations(ExecutionConfigurations.fromJson(reader)); + } else if ("triggeredBy".equals(fieldName)) { + deserializedRecoveryJobProperties.withTriggeredBy(JobTriggeredBy.fromString(reader.getString())); + } else if ("jobType".equals(fieldName)) { + deserializedRecoveryJobProperties.jobType = JobType.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedRecoveryJobProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryJobProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobResource.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobResource.java new file mode 100644 index 000000000000..7ea1004257a7 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobResource.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryJobResourceInner; + +/** + * An immutable client-side representation of RecoveryJobResource. + */ +public interface RecoveryJobResource { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + RecoveryJobResourceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryJobResourceInner object. + * + * @return the inner object. + */ + RecoveryJobResourceInner innerModel(); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobResourceProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobResourceProperties.java new file mode 100644 index 000000000000..dfc06905f37e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobResourceProperties.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.util.List; + +/** + * Properties of a recovery orchestration job resource associated with a recovery orchestration plan. + */ +@Immutable +public final class RecoveryJobResourceProperties extends JobResourceProperties { + /* + * Discriminator for the JobResource object hierarchy. + */ + private JobResourceType jobResourceType = JobResourceType.RECOVERY_PLAN; + + /* + * The provisioning state of the recovery job resource. + */ + private ProvisioningState provisioningState; + + /* + * A setting that indicates the protection solution selected. + */ + private ResourceProtectionSolutionType protectionSolutionType; + + /* + * The recovery action settings. + */ + private RecoveryGroupActionSettings recoveryGroupActionSettings; + + /** + * Creates an instance of RecoveryJobResourceProperties class. + */ + private RecoveryJobResourceProperties() { + } + + /** + * Get the jobResourceType property: Discriminator for the JobResource object hierarchy. + * + * @return the jobResourceType value. + */ + @Override + public JobResourceType jobResourceType() { + return this.jobResourceType; + } + + /** + * Get the provisioningState property: The provisioning state of the recovery job resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the protectionSolutionType property: A setting that indicates the protection solution selected. + * + * @return the protectionSolutionType value. + */ + public ResourceProtectionSolutionType protectionSolutionType() { + return this.protectionSolutionType; + } + + /** + * Get the recoveryGroupActionSettings property: The recovery action settings. + * + * @return the recoveryGroupActionSettings value. + */ + public RecoveryGroupActionSettings recoveryGroupActionSettings() { + return this.recoveryGroupActionSettings; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("errorDetails", errorDetails()); + jsonWriter.writeArrayField("retryDetails", retryDetails(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("jobExtendedInfo", jobExtendedInfo()); + jsonWriter.writeStringField("jobResourceType", + this.jobResourceType == null ? null : this.jobResourceType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryJobResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryJobResourceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RecoveryJobResourceProperties. + */ + public static RecoveryJobResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryJobResourceProperties deserializedRecoveryJobResourceProperties + = new RecoveryJobResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedRecoveryJobResourceProperties.withStatus(JobStatus.fromString(reader.getString())); + } else if ("startTime".equals(fieldName)) { + deserializedRecoveryJobResourceProperties.withStartTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("endTime".equals(fieldName)) { + deserializedRecoveryJobResourceProperties.withEndTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("duration".equals(fieldName)) { + deserializedRecoveryJobResourceProperties + .withDuration(reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()))); + } else if ("errorDetails".equals(fieldName)) { + deserializedRecoveryJobResourceProperties.withErrorDetails(JobErrorInfo.fromJson(reader)); + } else if ("resourceId".equals(fieldName)) { + deserializedRecoveryJobResourceProperties.withResourceId(reader.getString()); + } else if ("operation".equals(fieldName)) { + deserializedRecoveryJobResourceProperties.withOperation(reader.getString()); + } else if ("retryDetails".equals(fieldName)) { + List retryDetails = reader.readArray(reader1 -> JobRetryDetails.fromJson(reader1)); + deserializedRecoveryJobResourceProperties.withRetryDetails(retryDetails); + } else if ("jobExtendedInfo".equals(fieldName)) { + deserializedRecoveryJobResourceProperties.withJobExtendedInfo(JobExtendedInfo.fromJson(reader)); + } else if ("userComments".equals(fieldName)) { + List userComments = reader.readArray(reader1 -> JobUserComment.fromJson(reader1)); + deserializedRecoveryJobResourceProperties.withUserComments(userComments); + } else if ("jobId".equals(fieldName)) { + deserializedRecoveryJobResourceProperties.withJobId(reader.getString()); + } else if ("taskId".equals(fieldName)) { + deserializedRecoveryJobResourceProperties.withTaskId(reader.getString()); + } else if ("taskName".equals(fieldName)) { + deserializedRecoveryJobResourceProperties.withTaskName(reader.getString()); + } else if ("jobResourceType".equals(fieldName)) { + deserializedRecoveryJobResourceProperties.jobResourceType + = JobResourceType.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedRecoveryJobResourceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("protectionSolutionType".equals(fieldName)) { + deserializedRecoveryJobResourceProperties.protectionSolutionType + = ResourceProtectionSolutionType.fromString(reader.getString()); + } else if ("recoveryGroupActionSettings".equals(fieldName)) { + deserializedRecoveryJobResourceProperties.recoveryGroupActionSettings + = RecoveryGroupActionSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryJobResourceProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobResources.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobResources.java new file mode 100644 index 000000000000..89d6b1f500ff --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobResources.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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 RecoveryJobResources. + */ +public interface RecoveryJobResources { + /** + * Get a RecoveryJobResource. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param recoveryJobResourceName The unique name (GUID) of the recovery job 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 a RecoveryJobResource along with {@link Response}. + */ + Response getWithResponse(String serviceGroupName, String recoveryPlanName, + String recoveryJobName, String recoveryJobResourceName, Context context); + + /** + * Get a RecoveryJobResource. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param recoveryJobResourceName The unique name (GUID) of the recovery job 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 a RecoveryJobResource. + */ + RecoveryJobResource get(String serviceGroupName, String recoveryPlanName, String recoveryJobName, + String recoveryJobResourceName); + + /** + * List RecoveryJobResource resources by RecoveryJob. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJobResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName, String recoveryPlanName, String recoveryJobName); + + /** + * List RecoveryJobResource resources by RecoveryJob. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJobResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName, String recoveryPlanName, String recoveryJobName, + Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobs.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobs.java new file mode 100644 index 000000000000..8586ac02af89 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobs.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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 RecoveryJobs. + */ +public interface RecoveryJobs { + /** + * Get a RecoveryJob. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 RecoveryJob along with {@link Response}. + */ + Response getWithResponse(String serviceGroupName, String recoveryPlanName, String recoveryJobName, + Context context); + + /** + * Get a RecoveryJob. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 RecoveryJob. + */ + RecoveryJob get(String serviceGroupName, String recoveryPlanName, String recoveryJobName); + + /** + * List RecoveryJob resources by RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJob list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName, String recoveryPlanName); + + /** + * List RecoveryJob resources by RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryJob list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName, String recoveryPlanName, Context context); + + /** + * This action attempts to cancel the ongoing recovery orchestration job. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ArmResponseErrorResponse cancel(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, RecoveryActionRequest body); + + /** + * This action attempts to cancel the ongoing recovery orchestration job. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ArmResponseErrorResponse cancel(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, RecoveryActionRequest body, Context context); + + /** + * This action resumes the ongoing recovery orchestration job that was paused for required user intervention. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ArmResponseErrorResponse resume(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, RecoveryActionRequest body); + + /** + * This action resumes the ongoing recovery orchestration job that was paused for required user intervention. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param body The content of the action 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ArmResponseErrorResponse resume(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, RecoveryActionRequest body, Context context); + + /** + * This action retries the ongoing recovery orchestration job for resources that failed in previous attempts. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ArmResponseErrorResponse retry(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName); + + /** + * This action retries the ongoing recovery orchestration job for resources that failed in previous attempts. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryJobName The unique name (GUID) of the recovery job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ArmResponseErrorResponse retry(String serviceGroupName, String operationId, String recoveryPlanName, + String recoveryJobName, Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryOperationNames.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryOperationNames.java new file mode 100644 index 000000000000..7a04a79addc5 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryOperationNames.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines the set of operations that can be executed on a Recovery Orchestration Plan. These operations are applicable + * only to resources that meet the qualification criteria. + */ +public final class RecoveryOperationNames extends ExpandableStringEnum { + /** + * Initiates a failover process to recover eligible resources to the target location. + */ + public static final RecoveryOperationNames FAILOVER = fromString("Failover"); + + /** + * Commits the failover for resources that require an explicit commit after recovery. + */ + public static final RecoveryOperationNames FAILOVER_COMMIT = fromString("FailoverCommit"); + + /** + * Performs re-protection or configuration changes for resources that have failed over, as required. + */ + public static final RecoveryOperationNames REPROTECT = fromString("Reprotect"); + + /** + * Initiates a test failover process for qualified resources and those that support test failover. + */ + public static final RecoveryOperationNames TEST_FAILOVER = fromString("TestFailover"); + + /** + * Cleans up resources and configurations created during a test failover, as required. + */ + public static final RecoveryOperationNames TEST_FAILOVER_CLEANUP = fromString("TestFailoverCleanup"); + + /** + * Creates a new instance of RecoveryOperationNames value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RecoveryOperationNames() { + } + + /** + * Creates or finds a RecoveryOperationNames from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecoveryOperationNames. + */ + public static RecoveryOperationNames fromString(String name) { + return fromString(name, RecoveryOperationNames.class); + } + + /** + * Gets known RecoveryOperationNames values. + * + * @return known RecoveryOperationNames values. + */ + public static Collection values() { + return values(RecoveryOperationNames.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryOperationStatus.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryOperationStatus.java new file mode 100644 index 000000000000..002cf6ffc2b6 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryOperationStatus.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the operation status for failover and validation. + */ +public final class RecoveryOperationStatus extends ExpandableStringEnum { + /** + * Operation has not started or ran. + */ + public static final RecoveryOperationStatus NOT_STARTED = fromString("NotStarted"); + + /** + * Operation is in the process of being validated. + */ + public static final RecoveryOperationStatus VALIDATION_IN_PROGRESS = fromString("ValidationInProgress"); + + /** + * Operation is in progress. + */ + public static final RecoveryOperationStatus IN_PROGRESS = fromString("InProgress"); + + /** + * Operation has completed successfully. + */ + public static final RecoveryOperationStatus SUCCEEDED = fromString("Succeeded"); + + /** + * Operation has completed but ran into some warning state. + */ + public static final RecoveryOperationStatus COMPLETED_WITH_WARNING = fromString("CompletedWithWarning"); + + /** + * Operation has completed but ran into some validation error state. + */ + public static final RecoveryOperationStatus VALIDATION_FAILED = fromString("ValidationFailed"); + + /** + * Operation has completed but ran into some error state. + */ + public static final RecoveryOperationStatus FAILED = fromString("Failed"); + + /** + * Operation has been canceled by the user. + */ + public static final RecoveryOperationStatus CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of RecoveryOperationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RecoveryOperationStatus() { + } + + /** + * Creates or finds a RecoveryOperationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecoveryOperationStatus. + */ + public static RecoveryOperationStatus fromString(String name) { + return fromString(name, RecoveryOperationStatus.class); + } + + /** + * Gets known RecoveryOperationStatus values. + * + * @return known RecoveryOperationStatus values. + */ + public static Collection values() { + return values(RecoveryOperationStatus.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlan.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlan.java new file mode 100644 index 000000000000..697def8de1bc --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlan.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryPlanInner; + +/** + * An immutable client-side representation of RecoveryPlan. + */ +public interface RecoveryPlan { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + RecoveryPlanProperties properties(); + + /** + * Gets the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryPlanInner object. + * + * @return the inner object. + */ + RecoveryPlanInner innerModel(); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanActionBaseResponse.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanActionBaseResponse.java new file mode 100644 index 000000000000..a02eb76882d7 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanActionBaseResponse.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryPlanActionBaseResponseInner; + +/** + * An immutable client-side representation of RecoveryPlanActionBaseResponse. + */ +public interface RecoveryPlanActionBaseResponse { + /** + * Gets the jobId property: JobId of the job triggered for Recovery Orchestration Plan. + * + * @return the jobId value. + */ + String jobId(); + + /** + * Gets the inner com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryPlanActionBaseResponseInner + * object. + * + * @return the inner object. + */ + RecoveryPlanActionBaseResponseInner innerModel(); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanActions.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanActions.java new file mode 100644 index 000000000000..9e644c3c4f06 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanActions.java @@ -0,0 +1,453 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.Context; + +/** + * Resource collection API of RecoveryPlanActions. + */ +public interface RecoveryPlanActions { + /** + * This action finalizes the recovery orchestration plan, ensuring all necessary configurations are in place. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ArmResponseErrorResponse finalize(String serviceGroupName, String operationId, String recoveryPlanName); + + /** + * This action finalizes the recovery orchestration plan, ensuring all necessary configurations are in place. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ArmResponseErrorResponse finalize(String serviceGroupName, String operationId, String recoveryPlanName, + Context context); + + /** + * This action adds or updates the resources to be included in the recovery orchestration plan. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recoveryResources post action request to update in batch. + */ + UpdateRecoveryResourcesResponse updateResources(String serviceGroupName, String operationId, + String recoveryPlanName, UpdateRecoveryResourcesRequest body); + + /** + * This action adds or updates the resources to be included in the recovery orchestration plan. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recoveryResources post action request to update in batch. + */ + UpdateRecoveryResourcesResponse updateResources(String serviceGroupName, String operationId, + String recoveryPlanName, UpdateRecoveryResourcesRequest body, Context context); + + /** + * This action checks if the recovery orchestration plan is eligible for operations like failover and reprotect, + * ensuring it meets the necessary criteria. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ArmResponseErrorResponse validateForOperation(String serviceGroupName, String operationId, String recoveryPlanName, + ValidateForOperationRequest body); + + /** + * This action checks if the recovery orchestration plan is eligible for operations like failover and reprotect, + * ensuring it meets the necessary criteria. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 200. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ArmResponseErrorResponse validateForOperation(String serviceGroupName, String operationId, String recoveryPlanName, + ValidateForOperationRequest body, Context context); + + /** + * This action checks if the recovery orchestration plan is eligible for failover operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response. + */ + ValidateForRecoveryOperationBaseResponse validateForFailover(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body); + + /** + * This action checks if the recovery orchestration plan is eligible for failover operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response. + */ + ValidateForRecoveryOperationBaseResponse validateForFailover(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body, Context context); + + /** + * This action checks if the recovery orchestration plan is eligible for failover commit operation, ensuring it + * meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response. + */ + ValidateForRecoveryOperationBaseResponse validateForFailoverCommit(String serviceGroupName, String operationId, + String recoveryPlanName); + + /** + * This action checks if the recovery orchestration plan is eligible for failover commit operation, ensuring it + * meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response. + */ + ValidateForRecoveryOperationBaseResponse validateForFailoverCommit(String serviceGroupName, String operationId, + String recoveryPlanName, Context context); + + /** + * This action checks if the recovery orchestration plan is eligible for test failover operation, ensuring it meets + * the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response. + */ + ValidateForRecoveryOperationBaseResponse validateForTestFailover(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body); + + /** + * This action checks if the recovery orchestration plan is eligible for test failover operation, ensuring it meets + * the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response. + */ + ValidateForRecoveryOperationBaseResponse validateForTestFailover(String serviceGroupName, String operationId, + String recoveryPlanName, FailoverRequest body, Context context); + + /** + * This action checks if the recovery orchestration plan is eligible for test failover cleanup operation, ensuring + * it meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response. + */ + ValidateForRecoveryOperationBaseResponse validateForTestFailoverCleanup(String serviceGroupName, String operationId, + String recoveryPlanName); + + /** + * This action checks if the recovery orchestration plan is eligible for test failover cleanup operation, ensuring + * it meets the necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response. + */ + ValidateForRecoveryOperationBaseResponse validateForTestFailoverCleanup(String serviceGroupName, String operationId, + String recoveryPlanName, Context context); + + /** + * This action checks if the recovery orchestration plan is eligible for reprotect operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validateForRecoveryOperation post action response. + */ + ValidateForRecoveryOperationBaseResponse validateForReprotect(String serviceGroupName, String operationId, + String recoveryPlanName); + + /** + * This action checks if the recovery orchestration plan is eligible for reprotect operation, ensuring it meets the + * necessary criteria and provides a list of qualified and unqualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 validateForRecoveryOperation post action response. + */ + ValidateForRecoveryOperationBaseResponse validateForReprotect(String serviceGroupName, String operationId, + String recoveryPlanName, ReprotectRequest body, Context context); + + /** + * This action performs the necessary readiness check on the recovery orchestration plan to ensure it is in the + * desired state and eligible for all recovery actions, including all protected resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 checkReadiness(String serviceGroupName, String operationId, String recoveryPlanName); + + /** + * This action performs the necessary readiness check on the recovery orchestration plan to ensure it is in the + * desired state and eligible for all recovery actions, including all protected resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 checkReadiness(String serviceGroupName, String operationId, String recoveryPlanName, Context context); + + /** + * This action triggers the failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + RecoveryPlanActionBaseResponse failover(String serviceGroupName, String operationId, String recoveryPlanName, + FailoverRequest body); + + /** + * This action triggers the failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + RecoveryPlanActionBaseResponse failover(String serviceGroupName, String operationId, String recoveryPlanName, + FailoverRequest body, Context context); + + /** + * This action triggers the failover commit operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recovery Orchestration Plan post action response. + */ + RecoveryPlanActionBaseResponse failoverCommit(String serviceGroupName, String operationId, String recoveryPlanName); + + /** + * This action triggers the failover commit operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recovery Orchestration Plan post action response. + */ + RecoveryPlanActionBaseResponse failoverCommit(String serviceGroupName, String operationId, String recoveryPlanName, + Context context); + + /** + * This action triggers the reprotect operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recovery Orchestration Plan post action response. + */ + RecoveryPlanActionBaseResponse reprotect(String serviceGroupName, String operationId, String recoveryPlanName); + + /** + * This action triggers the reprotect operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + RecoveryPlanActionBaseResponse reprotect(String serviceGroupName, String operationId, String recoveryPlanName, + ReprotectRequest body, Context context); + + /** + * This action triggers the test failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + RecoveryPlanActionBaseResponse testFailover(String serviceGroupName, String operationId, String recoveryPlanName, + FailoverRequest body); + + /** + * This action triggers the test failover operation on the recovery orchestration plan for the qualified resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + RecoveryPlanActionBaseResponse testFailover(String serviceGroupName, String operationId, String recoveryPlanName, + FailoverRequest body, Context context); + + /** + * This action triggers the test failover cleanup operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + RecoveryPlanActionBaseResponse testFailoverCleanup(String serviceGroupName, String operationId, + String recoveryPlanName, TestFailoverCleanupRequest body); + + /** + * This action triggers the test failover cleanup operation on the recovery orchestration plan for the qualified + * resources. + * + * @param serviceGroupName The name of the service group. + * @param operationId A GUID that represents the Long Running OperationId. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param body The content of the action 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 recovery Orchestration Plan post action response. + */ + RecoveryPlanActionBaseResponse testFailoverCleanup(String serviceGroupName, String operationId, + String recoveryPlanName, TestFailoverCleanupRequest body, Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanExclusionReason.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanExclusionReason.java new file mode 100644 index 000000000000..61de23e735a5 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanExclusionReason.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum for RecoveryPlan Exclusion reason. + */ +public final class RecoveryPlanExclusionReason extends ExpandableStringEnum { + /** + * Excluded From RecoveryPlan by user. + */ + public static final RecoveryPlanExclusionReason EXCLUDED_FROM_RECOVERY_PLAN + = fromString("ExcludedFromRecoveryPlan"); + + /** + * Protection not configured. + */ + public static final RecoveryPlanExclusionReason PROTECTION_STATUS = fromString("ProtectionStatus"); + + /** + * Creates a new instance of RecoveryPlanExclusionReason value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RecoveryPlanExclusionReason() { + } + + /** + * Creates or finds a RecoveryPlanExclusionReason from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecoveryPlanExclusionReason. + */ + public static RecoveryPlanExclusionReason fromString(String name) { + return fromString(name, RecoveryPlanExclusionReason.class); + } + + /** + * Gets known RecoveryPlanExclusionReason values. + * + * @return known RecoveryPlanExclusionReason values. + */ + public static Collection values() { + return values(RecoveryPlanExclusionReason.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanFailoverOperationStatus.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanFailoverOperationStatus.java new file mode 100644 index 000000000000..aa0c5a8903bc --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanFailoverOperationStatus.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** + * Details of the recovery orchestration plan failover operation execution. + */ +@Immutable +public final class RecoveryPlanFailoverOperationStatus + implements JsonSerializable { + /* + * The most recent execution time of the recovery orchestration plan in UTC. + */ + private OffsetDateTime lastExecutedAt; + + /* + * The status of the most recent execution of the recovery orchestration plan. + */ + private RecoveryOperationStatus operationStatus; + + /* + * Error details for the most recent execution of the recovery orchestration plan. + */ + private ManagementError errorDetails; + + /* + * The actual recovery time of the most recent recovery orchestration plan. + */ + private Duration recoveryTimeActual; + + /** + * Creates an instance of RecoveryPlanFailoverOperationStatus class. + */ + private RecoveryPlanFailoverOperationStatus() { + } + + /** + * Get the lastExecutedAt property: The most recent execution time of the recovery orchestration plan in UTC. + * + * @return the lastExecutedAt value. + */ + public OffsetDateTime lastExecutedAt() { + return this.lastExecutedAt; + } + + /** + * Get the operationStatus property: The status of the most recent execution of the recovery orchestration plan. + * + * @return the operationStatus value. + */ + public RecoveryOperationStatus operationStatus() { + return this.operationStatus; + } + + /** + * Get the errorDetails property: Error details for the most recent execution of the recovery orchestration plan. + * + * @return the errorDetails value. + */ + public ManagementError errorDetails() { + return this.errorDetails; + } + + /** + * Get the recoveryTimeActual property: The actual recovery time of the most recent recovery orchestration plan. + * + * @return the recoveryTimeActual value. + */ + public Duration recoveryTimeActual() { + return this.recoveryTimeActual; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryPlanFailoverOperationStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryPlanFailoverOperationStatus if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RecoveryPlanFailoverOperationStatus. + */ + public static RecoveryPlanFailoverOperationStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryPlanFailoverOperationStatus deserializedRecoveryPlanFailoverOperationStatus + = new RecoveryPlanFailoverOperationStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("lastExecutedAt".equals(fieldName)) { + deserializedRecoveryPlanFailoverOperationStatus.lastExecutedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("operationStatus".equals(fieldName)) { + deserializedRecoveryPlanFailoverOperationStatus.operationStatus + = RecoveryOperationStatus.fromString(reader.getString()); + } else if ("errorDetails".equals(fieldName)) { + deserializedRecoveryPlanFailoverOperationStatus.errorDetails = ManagementError.fromJson(reader); + } else if ("recoveryTimeActual".equals(fieldName)) { + deserializedRecoveryPlanFailoverOperationStatus.recoveryTimeActual + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryPlanFailoverOperationStatus; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanOperationStatus.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanOperationStatus.java new file mode 100644 index 000000000000..ae0e2dc8745e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanOperationStatus.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Details of the recovery orchestration plan operation execution. + */ +@Immutable +public final class RecoveryPlanOperationStatus implements JsonSerializable { + /* + * The most recent execution time of the recovery orchestration plan in UTC. + */ + private OffsetDateTime lastExecutedAt; + + /* + * The status of the most recent execution of the recovery orchestration plan. + */ + private RecoveryOperationStatus operationStatus; + + /* + * Error details for the most recent execution of the recovery orchestration plan. + */ + private ManagementError errorDetails; + + /** + * Creates an instance of RecoveryPlanOperationStatus class. + */ + private RecoveryPlanOperationStatus() { + } + + /** + * Get the lastExecutedAt property: The most recent execution time of the recovery orchestration plan in UTC. + * + * @return the lastExecutedAt value. + */ + public OffsetDateTime lastExecutedAt() { + return this.lastExecutedAt; + } + + /** + * Get the operationStatus property: The status of the most recent execution of the recovery orchestration plan. + * + * @return the operationStatus value. + */ + public RecoveryOperationStatus operationStatus() { + return this.operationStatus; + } + + /** + * Get the errorDetails property: Error details for the most recent execution of the recovery orchestration plan. + * + * @return the errorDetails value. + */ + public ManagementError errorDetails() { + return this.errorDetails; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryPlanOperationStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryPlanOperationStatus if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RecoveryPlanOperationStatus. + */ + public static RecoveryPlanOperationStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryPlanOperationStatus deserializedRecoveryPlanOperationStatus = new RecoveryPlanOperationStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("lastExecutedAt".equals(fieldName)) { + deserializedRecoveryPlanOperationStatus.lastExecutedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("operationStatus".equals(fieldName)) { + deserializedRecoveryPlanOperationStatus.operationStatus + = RecoveryOperationStatus.fromString(reader.getString()); + } else if ("errorDetails".equals(fieldName)) { + deserializedRecoveryPlanOperationStatus.errorDetails = ManagementError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryPlanOperationStatus; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanProperties.java new file mode 100644 index 000000000000..3c1b01a2c8e9 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanProperties.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of the recovery orchestration plan. + */ +@Fluent +public final class RecoveryPlanProperties implements JsonSerializable { + /* + * The provisioning state of the recovery orchestration plan. + */ + private ProvisioningState provisioningState; + + /* + * The type of the recovery orchestration plan, which can be set during creation but cannot be changed afterward. + */ + private RecoveryPlanType planType; + + /* + * The current state of the recovery orchestration plan. + */ + private RecoveryPlanState planState; + + /* + * A description of the recovery orchestration plan. + */ + private String planDescription; + + /* + * Settings for the recovery orchestration groups associated with the recovery orchestration plan. + */ + private RecoveryGroupsSetting recoveryGroupsSetting; + + /* + * The status of the most recent failover operation executed. + */ + private RecoveryPlanFailoverOperationStatus latestFailoverStatus; + + /* + * The status of the most recent validation performed. + */ + private RecoveryPlanOperationStatus latestValidationStatus; + + /* + * Error details associated with the resource. + */ + private ManagementError errorDetails; + + /** + * Creates an instance of RecoveryPlanProperties class. + */ + public RecoveryPlanProperties() { + } + + /** + * Get the provisioningState property: The provisioning state of the recovery orchestration plan. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the planType property: The type of the recovery orchestration plan, which can be set during creation but + * cannot be changed afterward. + * + * @return the planType value. + */ + public RecoveryPlanType planType() { + return this.planType; + } + + /** + * Set the planType property: The type of the recovery orchestration plan, which can be set during creation but + * cannot be changed afterward. + * + * @param planType the planType value to set. + * @return the RecoveryPlanProperties object itself. + */ + public RecoveryPlanProperties withPlanType(RecoveryPlanType planType) { + this.planType = planType; + return this; + } + + /** + * Get the planState property: The current state of the recovery orchestration plan. + * + * @return the planState value. + */ + public RecoveryPlanState planState() { + return this.planState; + } + + /** + * Get the planDescription property: A description of the recovery orchestration plan. + * + * @return the planDescription value. + */ + public String planDescription() { + return this.planDescription; + } + + /** + * Set the planDescription property: A description of the recovery orchestration plan. + * + * @param planDescription the planDescription value to set. + * @return the RecoveryPlanProperties object itself. + */ + public RecoveryPlanProperties withPlanDescription(String planDescription) { + this.planDescription = planDescription; + return this; + } + + /** + * Get the recoveryGroupsSetting property: Settings for the recovery orchestration groups associated with the + * recovery orchestration plan. + * + * @return the recoveryGroupsSetting value. + */ + public RecoveryGroupsSetting recoveryGroupsSetting() { + return this.recoveryGroupsSetting; + } + + /** + * Set the recoveryGroupsSetting property: Settings for the recovery orchestration groups associated with the + * recovery orchestration plan. + * + * @param recoveryGroupsSetting the recoveryGroupsSetting value to set. + * @return the RecoveryPlanProperties object itself. + */ + public RecoveryPlanProperties withRecoveryGroupsSetting(RecoveryGroupsSetting recoveryGroupsSetting) { + this.recoveryGroupsSetting = recoveryGroupsSetting; + return this; + } + + /** + * Get the latestFailoverStatus property: The status of the most recent failover operation executed. + * + * @return the latestFailoverStatus value. + */ + public RecoveryPlanFailoverOperationStatus latestFailoverStatus() { + return this.latestFailoverStatus; + } + + /** + * Get the latestValidationStatus property: The status of the most recent validation performed. + * + * @return the latestValidationStatus value. + */ + public RecoveryPlanOperationStatus latestValidationStatus() { + return this.latestValidationStatus; + } + + /** + * Get the errorDetails property: Error details associated with the resource. + * + * @return the errorDetails value. + */ + public ManagementError errorDetails() { + return this.errorDetails; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("planType", this.planType == null ? null : this.planType.toString()); + jsonWriter.writeStringField("planDescription", this.planDescription); + jsonWriter.writeJsonField("recoveryGroupsSetting", this.recoveryGroupsSetting); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryPlanProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryPlanProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecoveryPlanProperties. + */ + public static RecoveryPlanProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryPlanProperties deserializedRecoveryPlanProperties = new RecoveryPlanProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("planType".equals(fieldName)) { + deserializedRecoveryPlanProperties.planType = RecoveryPlanType.fromString(reader.getString()); + } else if ("planDescription".equals(fieldName)) { + deserializedRecoveryPlanProperties.planDescription = reader.getString(); + } else if ("recoveryGroupsSetting".equals(fieldName)) { + deserializedRecoveryPlanProperties.recoveryGroupsSetting = RecoveryGroupsSetting.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedRecoveryPlanProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("planState".equals(fieldName)) { + deserializedRecoveryPlanProperties.planState = RecoveryPlanState.fromString(reader.getString()); + } else if ("latestFailoverStatus".equals(fieldName)) { + deserializedRecoveryPlanProperties.latestFailoverStatus + = RecoveryPlanFailoverOperationStatus.fromJson(reader); + } else if ("latestValidationStatus".equals(fieldName)) { + deserializedRecoveryPlanProperties.latestValidationStatus + = RecoveryPlanOperationStatus.fromJson(reader); + } else if ("errorDetails".equals(fieldName)) { + deserializedRecoveryPlanProperties.errorDetails = ManagementError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryPlanProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanPropertiesOfDrill.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanPropertiesOfDrill.java new file mode 100644 index 000000000000..b43bd4493c20 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanPropertiesOfDrill.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * RecoveryPlan properties. + */ +@Fluent +public final class RecoveryPlanPropertiesOfDrill implements JsonSerializable { + /* + * Identity to use for RecoveryPlan operations. + */ + private AssociatedIdentity identity; + + /* + * Recovery Orchestration plan associated with this Drill. + */ + private String recoveryPlanId; + + /* + * Excluded resource count in RecoveryPlan. + */ + private Integer recoveryPlanResourceExcludedCount; + + /** + * Creates an instance of RecoveryPlanPropertiesOfDrill class. + */ + public RecoveryPlanPropertiesOfDrill() { + } + + /** + * Get the identity property: Identity to use for RecoveryPlan operations. + * + * @return the identity value. + */ + public AssociatedIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Identity to use for RecoveryPlan operations. + * + * @param identity the identity value to set. + * @return the RecoveryPlanPropertiesOfDrill object itself. + */ + public RecoveryPlanPropertiesOfDrill withIdentity(AssociatedIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the recoveryPlanId property: Recovery Orchestration plan associated with this Drill. + * + * @return the recoveryPlanId value. + */ + public String recoveryPlanId() { + return this.recoveryPlanId; + } + + /** + * Get the recoveryPlanResourceExcludedCount property: Excluded resource count in RecoveryPlan. + * + * @return the recoveryPlanResourceExcludedCount value. + */ + public Integer recoveryPlanResourceExcludedCount() { + return this.recoveryPlanResourceExcludedCount; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryPlanPropertiesOfDrill from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryPlanPropertiesOfDrill if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecoveryPlanPropertiesOfDrill. + */ + public static RecoveryPlanPropertiesOfDrill fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryPlanPropertiesOfDrill deserializedRecoveryPlanPropertiesOfDrill + = new RecoveryPlanPropertiesOfDrill(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedRecoveryPlanPropertiesOfDrill.identity = AssociatedIdentity.fromJson(reader); + } else if ("recoveryPlanId".equals(fieldName)) { + deserializedRecoveryPlanPropertiesOfDrill.recoveryPlanId = reader.getString(); + } else if ("recoveryPlanResourceExcludedCount".equals(fieldName)) { + deserializedRecoveryPlanPropertiesOfDrill.recoveryPlanResourceExcludedCount + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryPlanPropertiesOfDrill; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanState.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanState.java new file mode 100644 index 000000000000..002774ad660b --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the state of the recovery orchestration plan. + */ +public final class RecoveryPlanState extends ExpandableStringEnum { + /** + * The recovery orchestration plan is currently being edited. + */ + public static final RecoveryPlanState UNDER_EDIT = fromString("UnderEdit"); + + /** + * The recovery orchestration plan is in a warning state. + */ + public static final RecoveryPlanState WARNING = fromString("Warning"); + + /** + * The recovery orchestration plan is ready. + */ + public static final RecoveryPlanState READY = fromString("Ready"); + + /** + * Creates a new instance of RecoveryPlanState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RecoveryPlanState() { + } + + /** + * Creates or finds a RecoveryPlanState from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecoveryPlanState. + */ + public static RecoveryPlanState fromString(String name) { + return fromString(name, RecoveryPlanState.class); + } + + /** + * Gets known RecoveryPlanState values. + * + * @return known RecoveryPlanState values. + */ + public static Collection values() { + return values(RecoveryPlanState.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanType.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanType.java new file mode 100644 index 000000000000..a2a077a96a81 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the type of recovery orchestration plan. + */ +public final class RecoveryPlanType extends ExpandableStringEnum { + /** + * A recovery orchestration plan for regional resiliency. + */ + public static final RecoveryPlanType REGIONAL = fromString("Regional"); + + /** + * A recovery orchestration plan for zonal resiliency. + */ + public static final RecoveryPlanType ZONAL = fromString("Zonal"); + + /** + * Creates a new instance of RecoveryPlanType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RecoveryPlanType() { + } + + /** + * Creates or finds a RecoveryPlanType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecoveryPlanType. + */ + public static RecoveryPlanType fromString(String name) { + return fromString(name, RecoveryPlanType.class); + } + + /** + * Gets known RecoveryPlanType values. + * + * @return known RecoveryPlanType values. + */ + public static Collection values() { + return values(RecoveryPlanType.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlans.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlans.java new file mode 100644 index 000000000000..a766fc760e86 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlans.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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.resiliencemanagement.fluent.models.RecoveryPlanInner; + +/** + * Resource collection API of RecoveryPlans. + */ +public interface RecoveryPlans { + /** + * Get a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 RecoveryPlan along with {@link Response}. + */ + Response getWithResponse(String serviceGroupName, String recoveryPlanName, Context context); + + /** + * Get a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 RecoveryPlan. + */ + RecoveryPlan get(String serviceGroupName, String recoveryPlanName); + + /** + * Create a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace. + */ + RecoveryPlan createOrUpdate(String serviceGroupName, String recoveryPlanName, RecoveryPlanInner resource); + + /** + * Create a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace. + */ + RecoveryPlan createOrUpdate(String serviceGroupName, String recoveryPlanName, RecoveryPlanInner resource, + Context context); + + /** + * Update a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace. + */ + RecoveryPlan update(String serviceGroupName, String recoveryPlanName, RecoveryPlanInner properties); + + /** + * Update a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a recovery orchestration plan resource in the Azure Resilience Management provider namespace. + */ + RecoveryPlan update(String serviceGroupName, String recoveryPlanName, RecoveryPlanInner properties, + Context context); + + /** + * Delete a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceGroupName, String recoveryPlanName); + + /** + * Delete a RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 delete(String serviceGroupName, String recoveryPlanName, Context context); + + /** + * List RecoveryPlan resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryPlan list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName); + + /** + * List RecoveryPlan resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryPlan list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName, String skipToken, Integer top, Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryResource.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryResource.java new file mode 100644 index 000000000000..067ef5b26b9b --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryResource.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryResourceInner; + +/** + * An immutable client-side representation of RecoveryResource. + */ +public interface RecoveryResource { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + RecoveryResourceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryResourceInner object. + * + * @return the inner object. + */ + RecoveryResourceInner innerModel(); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryResourceProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryResourceProperties.java new file mode 100644 index 000000000000..1d40b2eb2cc1 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryResourceProperties.java @@ -0,0 +1,402 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of recovery orchestration resource property associated with recovery orchestration plan. + */ +@Fluent +public final class RecoveryResourceProperties implements JsonSerializable { + /* + * A unique id for the recovery resource, which is a GUID. + */ + private String recoveryResourceUniqueId; + + /* + * Provisioning state + */ + private ProvisioningState provisioningState; + + /* + * Resource ID of the Azure resource associated with the recovery orchestration plan and linked to the recovery + * resource. + */ + private String resourceId; + + /* + * Original location of the Azure resource associated with the recovery orchestration plan and linked to the + * recovery resource. + */ + private String resourceLocation; + + /* + * Physical zones of the Azure resource associated with the recovery orchestration plan and linked to the recovery + * resource. + */ + private List resourcePhysicalZones; + + /* + * A state that indicates the resource status with respect to the recovery orchestration plan. + */ + private ResourceInclusionState inclusionState; + + /* + * Indicating if resource needs user attention and action, details will be found in attentionReasons + */ + private Boolean needsAttention; + + /* + * Reason for the resource to be in need of attention + */ + private List attentionReasons; + + /* + * A status that indicates the protection status of a resource with an Azure solution for regional or zonal + * recovery. + */ + private ResourceProtectionStatus protectionStatus; + + /* + * A list of ResourceProtectionSolutions with which the recovery orchestration resource is protected. + */ + private List resourceProtectionSolutions; + + /* + * A setting that indicates the protection solution selected. + */ + private ResourceProtectionSolutionType selectedProtectionSolutionType; + + /* + * Resource protection solution settings of the protection solutions recovery orchestration resource is protected + * with. + */ + private ResourceBaseProtectionSolutionSetting selectedProtectionSolutionSetting; + + /* + * The recovery orchestration group id associated with the recovery resources. + */ + private String recoveryGroupId; + + /* + * Identity details associated to the resource, which will be used for performing any operations on it + */ + private AssociatedIdentity associatedIdentity; + + /* + * Error details associated with the resource. + */ + private ManagementError errorDetails; + + /** + * Creates an instance of RecoveryResourceProperties class. + */ + public RecoveryResourceProperties() { + } + + /** + * Get the recoveryResourceUniqueId property: A unique id for the recovery resource, which is a GUID. + * + * @return the recoveryResourceUniqueId value. + */ + public String recoveryResourceUniqueId() { + return this.recoveryResourceUniqueId; + } + + /** + * Set the recoveryResourceUniqueId property: A unique id for the recovery resource, which is a GUID. + * + * @param recoveryResourceUniqueId the recoveryResourceUniqueId value to set. + * @return the RecoveryResourceProperties object itself. + */ + public RecoveryResourceProperties withRecoveryResourceUniqueId(String recoveryResourceUniqueId) { + this.recoveryResourceUniqueId = recoveryResourceUniqueId; + return this; + } + + /** + * Get the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceId property: Resource ID of the Azure resource associated with the recovery orchestration plan + * and linked to the recovery resource. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the resourceLocation property: Original location of the Azure resource associated with the recovery + * orchestration plan and linked to the recovery resource. + * + * @return the resourceLocation value. + */ + public String resourceLocation() { + return this.resourceLocation; + } + + /** + * Get the resourcePhysicalZones property: Physical zones of the Azure resource associated with the recovery + * orchestration plan and linked to the recovery resource. + * + * @return the resourcePhysicalZones value. + */ + public List resourcePhysicalZones() { + return this.resourcePhysicalZones; + } + + /** + * Get the inclusionState property: A state that indicates the resource status with respect to the recovery + * orchestration plan. + * + * @return the inclusionState value. + */ + public ResourceInclusionState inclusionState() { + return this.inclusionState; + } + + /** + * Set the inclusionState property: A state that indicates the resource status with respect to the recovery + * orchestration plan. + * + * @param inclusionState the inclusionState value to set. + * @return the RecoveryResourceProperties object itself. + */ + public RecoveryResourceProperties withInclusionState(ResourceInclusionState inclusionState) { + this.inclusionState = inclusionState; + return this; + } + + /** + * Get the needsAttention property: Indicating if resource needs user attention and action, details will be found in + * attentionReasons. + * + * @return the needsAttention value. + */ + public Boolean needsAttention() { + return this.needsAttention; + } + + /** + * Get the attentionReasons property: Reason for the resource to be in need of attention. + * + * @return the attentionReasons value. + */ + public List attentionReasons() { + return this.attentionReasons; + } + + /** + * Get the protectionStatus property: A status that indicates the protection status of a resource with an Azure + * solution for regional or zonal recovery. + * + * @return the protectionStatus value. + */ + public ResourceProtectionStatus protectionStatus() { + return this.protectionStatus; + } + + /** + * Get the resourceProtectionSolutions property: A list of ResourceProtectionSolutions with which the recovery + * orchestration resource is protected. + * + * @return the resourceProtectionSolutions value. + */ + public List resourceProtectionSolutions() { + return this.resourceProtectionSolutions; + } + + /** + * Get the selectedProtectionSolutionType property: A setting that indicates the protection solution selected. + * + * @return the selectedProtectionSolutionType value. + */ + public ResourceProtectionSolutionType selectedProtectionSolutionType() { + return this.selectedProtectionSolutionType; + } + + /** + * Set the selectedProtectionSolutionType property: A setting that indicates the protection solution selected. + * + * @param selectedProtectionSolutionType the selectedProtectionSolutionType value to set. + * @return the RecoveryResourceProperties object itself. + */ + public RecoveryResourceProperties + withSelectedProtectionSolutionType(ResourceProtectionSolutionType selectedProtectionSolutionType) { + this.selectedProtectionSolutionType = selectedProtectionSolutionType; + return this; + } + + /** + * Get the selectedProtectionSolutionSetting property: Resource protection solution settings of the protection + * solutions recovery orchestration resource is protected with. + * + * @return the selectedProtectionSolutionSetting value. + */ + public ResourceBaseProtectionSolutionSetting selectedProtectionSolutionSetting() { + return this.selectedProtectionSolutionSetting; + } + + /** + * Set the selectedProtectionSolutionSetting property: Resource protection solution settings of the protection + * solutions recovery orchestration resource is protected with. + * + * @param selectedProtectionSolutionSetting the selectedProtectionSolutionSetting value to set. + * @return the RecoveryResourceProperties object itself. + */ + public RecoveryResourceProperties + withSelectedProtectionSolutionSetting(ResourceBaseProtectionSolutionSetting selectedProtectionSolutionSetting) { + this.selectedProtectionSolutionSetting = selectedProtectionSolutionSetting; + return this; + } + + /** + * Get the recoveryGroupId property: The recovery orchestration group id associated with the recovery resources. + * + * @return the recoveryGroupId value. + */ + public String recoveryGroupId() { + return this.recoveryGroupId; + } + + /** + * Set the recoveryGroupId property: The recovery orchestration group id associated with the recovery resources. + * + * @param recoveryGroupId the recoveryGroupId value to set. + * @return the RecoveryResourceProperties object itself. + */ + public RecoveryResourceProperties withRecoveryGroupId(String recoveryGroupId) { + this.recoveryGroupId = recoveryGroupId; + return this; + } + + /** + * Get the associatedIdentity property: Identity details associated to the resource, which will be used for + * performing any operations on it. + * + * @return the associatedIdentity value. + */ + public AssociatedIdentity associatedIdentity() { + return this.associatedIdentity; + } + + /** + * Set the associatedIdentity property: Identity details associated to the resource, which will be used for + * performing any operations on it. + * + * @param associatedIdentity the associatedIdentity value to set. + * @return the RecoveryResourceProperties object itself. + */ + public RecoveryResourceProperties withAssociatedIdentity(AssociatedIdentity associatedIdentity) { + this.associatedIdentity = associatedIdentity; + return this; + } + + /** + * Get the errorDetails property: Error details associated with the resource. + * + * @return the errorDetails value. + */ + public ManagementError errorDetails() { + return this.errorDetails; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("recoveryResourceUniqueId", this.recoveryResourceUniqueId); + jsonWriter.writeStringField("inclusionState", + this.inclusionState == null ? null : this.inclusionState.toString()); + jsonWriter.writeStringField("selectedProtectionSolutionType", + this.selectedProtectionSolutionType == null ? null : this.selectedProtectionSolutionType.toString()); + jsonWriter.writeJsonField("selectedProtectionSolutionSetting", this.selectedProtectionSolutionSetting); + jsonWriter.writeStringField("recoveryGroupId", this.recoveryGroupId); + jsonWriter.writeJsonField("associatedIdentity", this.associatedIdentity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryResourceProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecoveryResourceProperties. + */ + public static RecoveryResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryResourceProperties deserializedRecoveryResourceProperties = new RecoveryResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recoveryResourceUniqueId".equals(fieldName)) { + deserializedRecoveryResourceProperties.recoveryResourceUniqueId = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedRecoveryResourceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("resourceId".equals(fieldName)) { + deserializedRecoveryResourceProperties.resourceId = reader.getString(); + } else if ("resourceLocation".equals(fieldName)) { + deserializedRecoveryResourceProperties.resourceLocation = reader.getString(); + } else if ("resourcePhysicalZones".equals(fieldName)) { + List resourcePhysicalZones = reader.readArray(reader1 -> reader1.getString()); + deserializedRecoveryResourceProperties.resourcePhysicalZones = resourcePhysicalZones; + } else if ("inclusionState".equals(fieldName)) { + deserializedRecoveryResourceProperties.inclusionState + = ResourceInclusionState.fromString(reader.getString()); + } else if ("needsAttention".equals(fieldName)) { + deserializedRecoveryResourceProperties.needsAttention = reader.getNullable(JsonReader::getBoolean); + } else if ("attentionReasons".equals(fieldName)) { + List attentionReasons = reader.readArray(reader1 -> reader1.getString()); + deserializedRecoveryResourceProperties.attentionReasons = attentionReasons; + } else if ("protectionStatus".equals(fieldName)) { + deserializedRecoveryResourceProperties.protectionStatus + = ResourceProtectionStatus.fromString(reader.getString()); + } else if ("resourceProtectionSolutions".equals(fieldName)) { + List resourceProtectionSolutions + = reader.readArray(reader1 -> ResourceProtectionSolutionSettings.fromJson(reader1)); + deserializedRecoveryResourceProperties.resourceProtectionSolutions = resourceProtectionSolutions; + } else if ("selectedProtectionSolutionType".equals(fieldName)) { + deserializedRecoveryResourceProperties.selectedProtectionSolutionType + = ResourceProtectionSolutionType.fromString(reader.getString()); + } else if ("selectedProtectionSolutionSetting".equals(fieldName)) { + deserializedRecoveryResourceProperties.selectedProtectionSolutionSetting + = ResourceBaseProtectionSolutionSetting.fromJson(reader); + } else if ("recoveryGroupId".equals(fieldName)) { + deserializedRecoveryResourceProperties.recoveryGroupId = reader.getString(); + } else if ("associatedIdentity".equals(fieldName)) { + deserializedRecoveryResourceProperties.associatedIdentity = AssociatedIdentity.fromJson(reader); + } else if ("errorDetails".equals(fieldName)) { + deserializedRecoveryResourceProperties.errorDetails = ManagementError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryResourceProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryResourceQualification.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryResourceQualification.java new file mode 100644 index 000000000000..0addd09a42d4 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryResourceQualification.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryResourceQualificationInner; + +/** + * An immutable client-side representation of RecoveryResourceQualification. + */ +public interface RecoveryResourceQualification { + /** + * Gets the recoveryResource property: Recovery orchestration resource. + * + * @return the recoveryResource value. + */ + RecoveryResource recoveryResource(); + + /** + * Gets the operationQualificationDetails property: Details of qualification for the operation. + * + * @return the operationQualificationDetails value. + */ + OperationQualificationDetails operationQualificationDetails(); + + /** + * Gets the inner com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryResourceQualificationInner + * object. + * + * @return the inner object. + */ + RecoveryResourceQualificationInner innerModel(); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryResources.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryResources.java new file mode 100644 index 000000000000..ffc19161a3ca --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryResources.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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 RecoveryResources. + */ +public interface RecoveryResources { + /** + * Get a RecoveryResource. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryResourceName The unique name (Guid) of the recovery 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 a RecoveryResource along with {@link Response}. + */ + Response getWithResponse(String serviceGroupName, String recoveryPlanName, + String recoveryResourceName, Context context); + + /** + * Get a RecoveryResource. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param recoveryResourceName The unique name (Guid) of the recovery 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 a RecoveryResource. + */ + RecoveryResource get(String serviceGroupName, String recoveryPlanName, String recoveryResourceName); + + /** + * List RecoveryResource resources by RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName, String recoveryPlanName); + + /** + * List RecoveryResource resources by RecoveryPlan. + * + * @param serviceGroupName The name of the service group. + * @param recoveryPlanName The name of the recovery orchestration plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RecoveryResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName, String recoveryPlanName, Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RegionalDrillProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RegionalDrillProperties.java new file mode 100644 index 000000000000..549b4fb2999d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RegionalDrillProperties.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Regional Drill properties. + */ +@Fluent +public final class RegionalDrillProperties extends DrillProperties { + /* + * The discriminator for the Drill object hierarchy. + */ + private DrillType drillType = DrillType.REGIONAL; + + /** + * Creates an instance of RegionalDrillProperties class. + */ + public RegionalDrillProperties() { + } + + /** + * Get the drillType property: The discriminator for the Drill object hierarchy. + * + * @return the drillType value. + */ + @Override + public DrillType drillType() { + return this.drillType; + } + + /** + * {@inheritDoc} + */ + @Override + public RegionalDrillProperties withRecoveryPlanProperties(RecoveryPlanPropertiesOfDrill recoveryPlanProperties) { + super.withRecoveryPlanProperties(recoveryPlanProperties); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RegionalDrillProperties withDrillAssetProperties(AssetPropertiesOfDrill drillAssetProperties) { + super.withDrillAssetProperties(drillAssetProperties); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RegionalDrillProperties withChaosResourceProperties(ChaosResourcePropertiesOfDrill chaosResourceProperties) { + super.withChaosResourceProperties(chaosResourceProperties); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RegionalDrillProperties withRbacSetupMode(RBACSetupMode rbacSetupMode) { + super.withRbacSetupMode(rbacSetupMode); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RegionalDrillProperties withMonitoringProperties(MonitoringPropertiesOfDrill monitoringProperties) { + super.withMonitoringProperties(monitoringProperties); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("recoveryPlanProperties", recoveryPlanProperties()); + jsonWriter.writeJsonField("drillAssetProperties", drillAssetProperties()); + jsonWriter.writeJsonField("chaosResourceProperties", chaosResourceProperties()); + jsonWriter.writeStringField("rbacSetupMode", rbacSetupMode() == null ? null : rbacSetupMode().toString()); + jsonWriter.writeJsonField("monitoringProperties", monitoringProperties()); + jsonWriter.writeStringField("drillType", this.drillType == null ? null : this.drillType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegionalDrillProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegionalDrillProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RegionalDrillProperties. + */ + public static RegionalDrillProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegionalDrillProperties deserializedRegionalDrillProperties = new RegionalDrillProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedRegionalDrillProperties + .withProvisioningState(ProvisioningState.fromString(reader.getString())); + } else if ("serviceGroupId".equals(fieldName)) { + deserializedRegionalDrillProperties.withServiceGroupId(reader.getString()); + } else if ("recoveryPlanProperties".equals(fieldName)) { + deserializedRegionalDrillProperties + .withRecoveryPlanProperties(RecoveryPlanPropertiesOfDrill.fromJson(reader)); + } else if ("drillAssetProperties".equals(fieldName)) { + deserializedRegionalDrillProperties + .withDrillAssetProperties(AssetPropertiesOfDrill.fromJson(reader)); + } else if ("chaosResourceProperties".equals(fieldName)) { + deserializedRegionalDrillProperties + .withChaosResourceProperties(ChaosResourcePropertiesOfDrill.fromJson(reader)); + } else if ("executionState".equals(fieldName)) { + deserializedRegionalDrillProperties + .withExecutionState(ExecutionState.fromString(reader.getString())); + } else if ("executionReadinessState".equals(fieldName)) { + deserializedRegionalDrillProperties + .withExecutionReadinessState(ExecutionReadinessState.fromString(reader.getString())); + } else if ("rbacSetupMode".equals(fieldName)) { + deserializedRegionalDrillProperties.withRbacSetupMode(RBACSetupMode.fromString(reader.getString())); + } else if ("attentionReason".equals(fieldName)) { + deserializedRegionalDrillProperties.withAttentionReason(AttentionReason.fromJson(reader)); + } else if ("systemMetadata".equals(fieldName)) { + deserializedRegionalDrillProperties.withSystemMetadata(SystemMetadata.fromJson(reader)); + } else if ("lastRunProperties".equals(fieldName)) { + deserializedRegionalDrillProperties.withLastRunProperties(LastRunProperties.fromJson(reader)); + } else if ("lastSyncTime".equals(fieldName)) { + deserializedRegionalDrillProperties.withLastSyncTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("lastResyncReadinessCheckTime".equals(fieldName)) { + deserializedRegionalDrillProperties.withLastResyncReadinessCheckTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("managedOnBehalfOfConfiguration".equals(fieldName)) { + deserializedRegionalDrillProperties + .withManagedOnBehalfOfConfiguration(ManagedOnBehalfOfConfiguration.fromJson(reader)); + } else if ("monitoringProperties".equals(fieldName)) { + deserializedRegionalDrillProperties + .withMonitoringProperties(MonitoringPropertiesOfDrill.fromJson(reader)); + } else if ("errorDetails".equals(fieldName)) { + deserializedRegionalDrillProperties.withErrorDetails(ManagementError.fromJson(reader)); + } else if ("drillType".equals(fieldName)) { + deserializedRegionalDrillProperties.drillType = DrillType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRegionalDrillProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RelativeResourceCompositionState.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RelativeResourceCompositionState.java new file mode 100644 index 000000000000..7b22b538114a --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RelativeResourceCompositionState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum for AttentionReason - Resource state sync between two objects. + */ +public final class RelativeResourceCompositionState extends ExpandableStringEnum { + /** + * Resources in sync. + */ + public static final RelativeResourceCompositionState IN_SYNC = fromString("InSync"); + + /** + * Resources out of sync. + */ + public static final RelativeResourceCompositionState OUT_OF_SYNC = fromString("OutOfSync"); + + /** + * Creates a new instance of RelativeResourceCompositionState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RelativeResourceCompositionState() { + } + + /** + * Creates or finds a RelativeResourceCompositionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding RelativeResourceCompositionState. + */ + public static RelativeResourceCompositionState fromString(String name) { + return fromString(name, RelativeResourceCompositionState.class); + } + + /** + * Gets known RelativeResourceCompositionState values. + * + * @return known RelativeResourceCompositionState values. + */ + public static Collection values() { + return values(RelativeResourceCompositionState.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ReprotectRequest.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ReprotectRequest.java new file mode 100644 index 000000000000..98ee9f650721 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ReprotectRequest.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Reprotect post action request. + */ +@Fluent +public final class ReprotectRequest implements JsonSerializable { + /* + * Additional properties for Reprotect. + */ + private ReprotectRequestProperties reprotectRequestProperties; + + /** + * Creates an instance of ReprotectRequest class. + */ + public ReprotectRequest() { + } + + /** + * Get the reprotectRequestProperties property: Additional properties for Reprotect. + * + * @return the reprotectRequestProperties value. + */ + public ReprotectRequestProperties reprotectRequestProperties() { + return this.reprotectRequestProperties; + } + + /** + * Set the reprotectRequestProperties property: Additional properties for Reprotect. + * + * @param reprotectRequestProperties the reprotectRequestProperties value to set. + * @return the ReprotectRequest object itself. + */ + public ReprotectRequest withReprotectRequestProperties(ReprotectRequestProperties reprotectRequestProperties) { + this.reprotectRequestProperties = reprotectRequestProperties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("reprotectRequestProperties", this.reprotectRequestProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReprotectRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReprotectRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ReprotectRequest. + */ + public static ReprotectRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReprotectRequest deserializedReprotectRequest = new ReprotectRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("reprotectRequestProperties".equals(fieldName)) { + deserializedReprotectRequest.reprotectRequestProperties + = ReprotectRequestProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedReprotectRequest; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ReprotectRequestProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ReprotectRequestProperties.java new file mode 100644 index 000000000000..a5847c4894c2 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ReprotectRequestProperties.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Additional properties for Reprotect. + */ +@Fluent +public final class ReprotectRequestProperties implements JsonSerializable { + /* + * Selected recovery resource Ids to be processed. If not provided, all qualified resources will be processed. + */ + private List selectedResourceIds; + + /** + * Creates an instance of ReprotectRequestProperties class. + */ + public ReprotectRequestProperties() { + } + + /** + * Get the selectedResourceIds property: Selected recovery resource Ids to be processed. If not provided, all + * qualified resources will be processed. + * + * @return the selectedResourceIds value. + */ + public List selectedResourceIds() { + return this.selectedResourceIds; + } + + /** + * Set the selectedResourceIds property: Selected recovery resource Ids to be processed. If not provided, all + * qualified resources will be processed. + * + * @param selectedResourceIds the selectedResourceIds value to set. + * @return the ReprotectRequestProperties object itself. + */ + public ReprotectRequestProperties withSelectedResourceIds(List selectedResourceIds) { + this.selectedResourceIds = selectedResourceIds; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("selectedResourceIds", this.selectedResourceIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReprotectRequestProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReprotectRequestProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReprotectRequestProperties. + */ + public static ReprotectRequestProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReprotectRequestProperties deserializedReprotectRequestProperties = new ReprotectRequestProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("selectedResourceIds".equals(fieldName)) { + List selectedResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedReprotectRequestProperties.selectedResourceIds = selectedResourceIds; + } else { + reader.skipChildren(); + } + } + + return deserializedReprotectRequestProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RequirementSelected.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RequirementSelected.java new file mode 100644 index 000000000000..e0b35d1c2d5c --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RequirementSelected.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum for the requirement status of the resource in the goal. + */ +public final class RequirementSelected extends ExpandableStringEnum { + /** + * The resource is not required for the specified goal. + */ + public static final RequirementSelected NOT_REQUIRED = fromString("NotRequired"); + + /** + * The resource is required for the specified goal. + */ + public static final RequirementSelected REQUIRED = fromString("Required"); + + /** + * Creates a new instance of RequirementSelected value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RequirementSelected() { + } + + /** + * Creates or finds a RequirementSelected from its string representation. + * + * @param name a name to look for. + * @return the corresponding RequirementSelected. + */ + public static RequirementSelected fromString(String name) { + return fromString(name, RequirementSelected.class); + } + + /** + * Gets known RequirementSelected values. + * + * @return known RequirementSelected values. + */ + public static Collection values() { + return values(RequirementSelected.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResilienceHealthStatus.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResilienceHealthStatus.java new file mode 100644 index 000000000000..53ea5878f186 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResilienceHealthStatus.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * enum for Resilience health status. + */ +public final class ResilienceHealthStatus extends ExpandableStringEnum { + /** + * Resource is not evaluated. + */ + public static final ResilienceHealthStatus NOT_EVALUATED = fromString("NotEvaluated"); + + /** + * Resource is Unhealthy. + */ + public static final ResilienceHealthStatus UNHEALTHY = fromString("Unhealthy"); + + /** + * Resource is Healthy. + */ + public static final ResilienceHealthStatus HEALTHY = fromString("Healthy"); + + /** + * Creates a new instance of ResilienceHealthStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResilienceHealthStatus() { + } + + /** + * Creates or finds a ResilienceHealthStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResilienceHealthStatus. + */ + public static ResilienceHealthStatus fromString(String name) { + return fromString(name, ResilienceHealthStatus.class); + } + + /** + * Gets known ResilienceHealthStatus values. + * + * @return known ResilienceHealthStatus values. + */ + public static Collection values() { + return values(ResilienceHealthStatus.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceBaseProtectionSolutionSetting.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceBaseProtectionSolutionSetting.java new file mode 100644 index 000000000000..88923815f9f2 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceBaseProtectionSolutionSetting.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of recovery orchestration resource protection solution setting with recovery orchestration plan. + */ +@Immutable +public class ResourceBaseProtectionSolutionSetting implements JsonSerializable { + /* + * A setting that indicates the resource protected with which recovery solution. + */ + private ResourceProtectionSolutionType protectionSolutionType + = ResourceProtectionSolutionType.fromString("ResourceBaseProtectionSolutionSetting"); + + /** + * Creates an instance of ResourceBaseProtectionSolutionSetting class. + */ + public ResourceBaseProtectionSolutionSetting() { + } + + /** + * Get the protectionSolutionType property: A setting that indicates the resource protected with which recovery + * solution. + * + * @return the protectionSolutionType value. + */ + public ResourceProtectionSolutionType protectionSolutionType() { + return this.protectionSolutionType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protectionSolutionType", + this.protectionSolutionType == null ? null : this.protectionSolutionType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceBaseProtectionSolutionSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceBaseProtectionSolutionSetting if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceBaseProtectionSolutionSetting. + */ + public static ResourceBaseProtectionSolutionSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("protectionSolutionType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("AzureNative".equals(discriminatorValue)) { + return ResourceNativeProtectionSolutionSetting.fromJson(readerToUse.reset()); + } else if ("CustomRunbook".equals(discriminatorValue)) { + return ResourceCustomProtectionSetting.fromJson(readerToUse.reset()); + } else if ("AzureSiteRecovery".equals(discriminatorValue)) { + return ResourceSiteRecoveryProtectionSetting.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ResourceBaseProtectionSolutionSetting fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceBaseProtectionSolutionSetting deserializedResourceBaseProtectionSolutionSetting + = new ResourceBaseProtectionSolutionSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protectionSolutionType".equals(fieldName)) { + deserializedResourceBaseProtectionSolutionSetting.protectionSolutionType + = ResourceProtectionSolutionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceBaseProtectionSolutionSetting; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceCustomProtectionAction.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceCustomProtectionAction.java new file mode 100644 index 000000000000..a51299a27ec6 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceCustomProtectionAction.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of recovery resource custom action setting with Recovery Orchestration Plan. + */ +@Fluent +public final class ResourceCustomProtectionAction implements JsonSerializable { + /* + * The Azure resource ID hosting the custom action automation script. + */ + private String resourceId; + + /** + * Creates an instance of ResourceCustomProtectionAction class. + */ + public ResourceCustomProtectionAction() { + } + + /** + * Get the resourceId property: The Azure resource ID hosting the custom action automation script. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The Azure resource ID hosting the custom action automation script. + * + * @param resourceId the resourceId value to set. + * @return the ResourceCustomProtectionAction object itself. + */ + public ResourceCustomProtectionAction withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceCustomProtectionAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceCustomProtectionAction if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceCustomProtectionAction. + */ + public static ResourceCustomProtectionAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceCustomProtectionAction deserializedResourceCustomProtectionAction + = new ResourceCustomProtectionAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedResourceCustomProtectionAction.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceCustomProtectionAction; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceCustomProtectionSetting.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceCustomProtectionSetting.java new file mode 100644 index 000000000000..0c7a61396fce --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceCustomProtectionSetting.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of recovery orchestration resource custom protection setting with recovery orchestration plan. + */ +@Fluent +public final class ResourceCustomProtectionSetting extends ResourceBaseProtectionSolutionSetting { + /* + * A setting that indicates the resource protected with which recovery solution. + */ + private ResourceProtectionSolutionType protectionSolutionType = ResourceProtectionSolutionType.CUSTOM_RUNBOOK; + + /* + * The Azure resource ID hosting the failover automation script. + */ + private ResourceCustomProtectionAction failoverAction; + + /* + * The Azure resource ID hosting the failover commit automation script. + */ + private ResourceCustomProtectionAction failoverCommitAction; + + /* + * The Azure resource ID hosting the test failover automation script. + */ + private ResourceCustomProtectionAction testFailoverAction; + + /* + * The Azure resource ID hosting the test failover cleanup automation script. + */ + private ResourceCustomProtectionAction testFailoverCleanupAction; + + /* + * The Azure resource ID hosting the reprotect automation script. + */ + private ResourceCustomProtectionAction reprotectAction; + + /** + * Creates an instance of ResourceCustomProtectionSetting class. + */ + public ResourceCustomProtectionSetting() { + } + + /** + * Get the protectionSolutionType property: A setting that indicates the resource protected with which recovery + * solution. + * + * @return the protectionSolutionType value. + */ + @Override + public ResourceProtectionSolutionType protectionSolutionType() { + return this.protectionSolutionType; + } + + /** + * Get the failoverAction property: The Azure resource ID hosting the failover automation script. + * + * @return the failoverAction value. + */ + public ResourceCustomProtectionAction failoverAction() { + return this.failoverAction; + } + + /** + * Set the failoverAction property: The Azure resource ID hosting the failover automation script. + * + * @param failoverAction the failoverAction value to set. + * @return the ResourceCustomProtectionSetting object itself. + */ + public ResourceCustomProtectionSetting withFailoverAction(ResourceCustomProtectionAction failoverAction) { + this.failoverAction = failoverAction; + return this; + } + + /** + * Get the failoverCommitAction property: The Azure resource ID hosting the failover commit automation script. + * + * @return the failoverCommitAction value. + */ + public ResourceCustomProtectionAction failoverCommitAction() { + return this.failoverCommitAction; + } + + /** + * Set the failoverCommitAction property: The Azure resource ID hosting the failover commit automation script. + * + * @param failoverCommitAction the failoverCommitAction value to set. + * @return the ResourceCustomProtectionSetting object itself. + */ + public ResourceCustomProtectionSetting + withFailoverCommitAction(ResourceCustomProtectionAction failoverCommitAction) { + this.failoverCommitAction = failoverCommitAction; + return this; + } + + /** + * Get the testFailoverAction property: The Azure resource ID hosting the test failover automation script. + * + * @return the testFailoverAction value. + */ + public ResourceCustomProtectionAction testFailoverAction() { + return this.testFailoverAction; + } + + /** + * Set the testFailoverAction property: The Azure resource ID hosting the test failover automation script. + * + * @param testFailoverAction the testFailoverAction value to set. + * @return the ResourceCustomProtectionSetting object itself. + */ + public ResourceCustomProtectionSetting withTestFailoverAction(ResourceCustomProtectionAction testFailoverAction) { + this.testFailoverAction = testFailoverAction; + return this; + } + + /** + * Get the testFailoverCleanupAction property: The Azure resource ID hosting the test failover cleanup automation + * script. + * + * @return the testFailoverCleanupAction value. + */ + public ResourceCustomProtectionAction testFailoverCleanupAction() { + return this.testFailoverCleanupAction; + } + + /** + * Set the testFailoverCleanupAction property: The Azure resource ID hosting the test failover cleanup automation + * script. + * + * @param testFailoverCleanupAction the testFailoverCleanupAction value to set. + * @return the ResourceCustomProtectionSetting object itself. + */ + public ResourceCustomProtectionSetting + withTestFailoverCleanupAction(ResourceCustomProtectionAction testFailoverCleanupAction) { + this.testFailoverCleanupAction = testFailoverCleanupAction; + return this; + } + + /** + * Get the reprotectAction property: The Azure resource ID hosting the reprotect automation script. + * + * @return the reprotectAction value. + */ + public ResourceCustomProtectionAction reprotectAction() { + return this.reprotectAction; + } + + /** + * Set the reprotectAction property: The Azure resource ID hosting the reprotect automation script. + * + * @param reprotectAction the reprotectAction value to set. + * @return the ResourceCustomProtectionSetting object itself. + */ + public ResourceCustomProtectionSetting withReprotectAction(ResourceCustomProtectionAction reprotectAction) { + this.reprotectAction = reprotectAction; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protectionSolutionType", + this.protectionSolutionType == null ? null : this.protectionSolutionType.toString()); + jsonWriter.writeJsonField("failoverAction", this.failoverAction); + jsonWriter.writeJsonField("failoverCommitAction", this.failoverCommitAction); + jsonWriter.writeJsonField("testFailoverAction", this.testFailoverAction); + jsonWriter.writeJsonField("testFailoverCleanupAction", this.testFailoverCleanupAction); + jsonWriter.writeJsonField("reprotectAction", this.reprotectAction); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceCustomProtectionSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceCustomProtectionSetting if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceCustomProtectionSetting. + */ + public static ResourceCustomProtectionSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceCustomProtectionSetting deserializedResourceCustomProtectionSetting + = new ResourceCustomProtectionSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protectionSolutionType".equals(fieldName)) { + deserializedResourceCustomProtectionSetting.protectionSolutionType + = ResourceProtectionSolutionType.fromString(reader.getString()); + } else if ("failoverAction".equals(fieldName)) { + deserializedResourceCustomProtectionSetting.failoverAction + = ResourceCustomProtectionAction.fromJson(reader); + } else if ("failoverCommitAction".equals(fieldName)) { + deserializedResourceCustomProtectionSetting.failoverCommitAction + = ResourceCustomProtectionAction.fromJson(reader); + } else if ("testFailoverAction".equals(fieldName)) { + deserializedResourceCustomProtectionSetting.testFailoverAction + = ResourceCustomProtectionAction.fromJson(reader); + } else if ("testFailoverCleanupAction".equals(fieldName)) { + deserializedResourceCustomProtectionSetting.testFailoverCleanupAction + = ResourceCustomProtectionAction.fromJson(reader); + } else if ("reprotectAction".equals(fieldName)) { + deserializedResourceCustomProtectionSetting.reprotectAction + = ResourceCustomProtectionAction.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceCustomProtectionSetting; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceInclusionState.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceInclusionState.java new file mode 100644 index 000000000000..d8806cab69a9 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceInclusionState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * A state type that indicates inclusion of the resource with respect to the resiliency support. + */ +public final class ResourceInclusionState extends ExpandableStringEnum { + /** + * A state that indicates the resource is included. + */ + public static final ResourceInclusionState INCLUDED = fromString("Included"); + + /** + * A state that indicates the resource is excluded. + */ + public static final ResourceInclusionState EXCLUDED = fromString("Excluded"); + + /** + * Creates a new instance of ResourceInclusionState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceInclusionState() { + } + + /** + * Creates or finds a ResourceInclusionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceInclusionState. + */ + public static ResourceInclusionState fromString(String name) { + return fromString(name, ResourceInclusionState.class); + } + + /** + * Gets known ResourceInclusionState values. + * + * @return known ResourceInclusionState values. + */ + public static Collection values() { + return values(ResourceInclusionState.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceLists.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceLists.java new file mode 100644 index 000000000000..b803c62a2103 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceLists.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Add, Update, Delete resource lists. + */ +@Fluent +public final class ResourceLists implements JsonSerializable { + /* + * Include resource + */ + private List includeResources; + + /* + * Excluded resource + */ + private List excludeResources; + + /* + * Update resource + */ + private List updateResources; + + /** + * Creates an instance of ResourceLists class. + */ + public ResourceLists() { + } + + /** + * Get the includeResources property: Include resource. + * + * @return the includeResources value. + */ + public List includeResources() { + return this.includeResources; + } + + /** + * Set the includeResources property: Include resource. + * + * @param includeResources the includeResources value to set. + * @return the ResourceLists object itself. + */ + public ResourceLists withIncludeResources(List includeResources) { + this.includeResources = includeResources; + return this; + } + + /** + * Get the excludeResources property: Excluded resource. + * + * @return the excludeResources value. + */ + public List excludeResources() { + return this.excludeResources; + } + + /** + * Set the excludeResources property: Excluded resource. + * + * @param excludeResources the excludeResources value to set. + * @return the ResourceLists object itself. + */ + public ResourceLists withExcludeResources(List excludeResources) { + this.excludeResources = excludeResources; + return this; + } + + /** + * Get the updateResources property: Update resource. + * + * @return the updateResources value. + */ + public List updateResources() { + return this.updateResources; + } + + /** + * Set the updateResources property: Update resource. + * + * @param updateResources the updateResources value to set. + * @return the ResourceLists object itself. + */ + public ResourceLists withUpdateResources(List updateResources) { + this.updateResources = updateResources; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("includeResources", this.includeResources, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("excludeResources", this.excludeResources, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("updateResources", this.updateResources, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceLists from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceLists if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceLists. + */ + public static ResourceLists fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceLists deserializedResourceLists = new ResourceLists(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("includeResources".equals(fieldName)) { + List includeResources + = reader.readArray(reader1 -> IncludeOrUpdateResource.fromJson(reader1)); + deserializedResourceLists.includeResources = includeResources; + } else if ("excludeResources".equals(fieldName)) { + List excludeResources = reader.readArray(reader1 -> reader1.getString()); + deserializedResourceLists.excludeResources = excludeResources; + } else if ("updateResources".equals(fieldName)) { + List updateResources + = reader.readArray(reader1 -> IncludeOrUpdateResource.fromJson(reader1)); + deserializedResourceLists.updateResources = updateResources; + } else { + reader.skipChildren(); + } + } + + return deserializedResourceLists; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceNativeProtectionSolutionSetting.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceNativeProtectionSolutionSetting.java new file mode 100644 index 000000000000..3b3d9aa6388e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceNativeProtectionSolutionSetting.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of recovery orchestration resource native protection solution setting with recovery orchestration plan. + */ +@Immutable +public final class ResourceNativeProtectionSolutionSetting extends ResourceBaseProtectionSolutionSetting { + /* + * A setting that indicates the resource protected with which recovery solution. + */ + private ResourceProtectionSolutionType protectionSolutionType = ResourceProtectionSolutionType.AZURE_NATIVE; + + /** + * Creates an instance of ResourceNativeProtectionSolutionSetting class. + */ + public ResourceNativeProtectionSolutionSetting() { + } + + /** + * Get the protectionSolutionType property: A setting that indicates the resource protected with which recovery + * solution. + * + * @return the protectionSolutionType value. + */ + @Override + public ResourceProtectionSolutionType protectionSolutionType() { + return this.protectionSolutionType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protectionSolutionType", + this.protectionSolutionType == null ? null : this.protectionSolutionType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceNativeProtectionSolutionSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceNativeProtectionSolutionSetting if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceNativeProtectionSolutionSetting. + */ + public static ResourceNativeProtectionSolutionSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceNativeProtectionSolutionSetting deserializedResourceNativeProtectionSolutionSetting + = new ResourceNativeProtectionSolutionSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protectionSolutionType".equals(fieldName)) { + deserializedResourceNativeProtectionSolutionSetting.protectionSolutionType + = ResourceProtectionSolutionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceNativeProtectionSolutionSetting; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceProtectionSolutionSettings.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceProtectionSolutionSettings.java new file mode 100644 index 000000000000..14a3f22f2bb4 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceProtectionSolutionSettings.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of recovery resource resource protection solution settings. + */ +@Immutable +public final class ResourceProtectionSolutionSettings implements JsonSerializable { + /* + * A setting that indicates the resource protected with which recovery solution. + */ + private ResourceProtectionSolutionType protectionSolutionType; + + /* + * A status that indicates the protection status of a resource with an Azure solution for regional or zonal + * recovery. + */ + private ResourceProtectionStatus protectionStatus; + + /* + * Resource ID of the Azure resource associated with the recovery orchestration plan and linked to the recovery + * resource. + */ + private String resourceId; + + /* + * Active location of the Azure resource associated with the recovery orchestration plan and linked to the recovery + * resource. + */ + private String activeLocation; + + /* + * Active locations of the Azure resource associated with the recovery orchestration plan and linked to the recovery + * resource. + */ + private List activeLocations; + + /* + * Active Resource location and physical zones of Azure Resource. + */ + private List activePhysicalZones; + + /* + * List of recovery locations of the Azure resource associated with the recovery orchestration plan and linked to + * the recovery resource. + */ + private List recoveryLocations; + + /* + * Specifies the role of the resource in the replication process. + */ + private ResourceReplicationRole replicationRole; + + /* + * Primary resource which is getting replicated. + */ + private String primaryResource; + + /* + * List of Replica resources to which replication is happening. + */ + private List replicaResources; + + /* + * Is AutoFailover configured for the resource replication. + */ + private boolean isAutoFailover; + + /* + * Failover state of the recovery orchestration resource. + */ + private FailoverState failoverState; + + /* + * TestFailover state of the recovery orchestration resource. + */ + private TestFailoverState testFailoverState; + + /** + * Creates an instance of ResourceProtectionSolutionSettings class. + */ + private ResourceProtectionSolutionSettings() { + } + + /** + * Get the protectionSolutionType property: A setting that indicates the resource protected with which recovery + * solution. + * + * @return the protectionSolutionType value. + */ + public ResourceProtectionSolutionType protectionSolutionType() { + return this.protectionSolutionType; + } + + /** + * Get the protectionStatus property: A status that indicates the protection status of a resource with an Azure + * solution for regional or zonal recovery. + * + * @return the protectionStatus value. + */ + public ResourceProtectionStatus protectionStatus() { + return this.protectionStatus; + } + + /** + * Get the resourceId property: Resource ID of the Azure resource associated with the recovery orchestration plan + * and linked to the recovery resource. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the activeLocation property: Active location of the Azure resource associated with the recovery orchestration + * plan and linked to the recovery resource. + * + * @return the activeLocation value. + */ + public String activeLocation() { + return this.activeLocation; + } + + /** + * Get the activeLocations property: Active locations of the Azure resource associated with the recovery + * orchestration plan and linked to the recovery resource. + * + * @return the activeLocations value. + */ + public List activeLocations() { + return this.activeLocations; + } + + /** + * Get the activePhysicalZones property: Active Resource location and physical zones of Azure Resource. + * + * @return the activePhysicalZones value. + */ + public List activePhysicalZones() { + return this.activePhysicalZones; + } + + /** + * Get the recoveryLocations property: List of recovery locations of the Azure resource associated with the recovery + * orchestration plan and linked to the recovery resource. + * + * @return the recoveryLocations value. + */ + public List recoveryLocations() { + return this.recoveryLocations; + } + + /** + * Get the replicationRole property: Specifies the role of the resource in the replication process. + * + * @return the replicationRole value. + */ + public ResourceReplicationRole replicationRole() { + return this.replicationRole; + } + + /** + * Get the primaryResource property: Primary resource which is getting replicated. + * + * @return the primaryResource value. + */ + public String primaryResource() { + return this.primaryResource; + } + + /** + * Get the replicaResources property: List of Replica resources to which replication is happening. + * + * @return the replicaResources value. + */ + public List replicaResources() { + return this.replicaResources; + } + + /** + * Get the isAutoFailover property: Is AutoFailover configured for the resource replication. + * + * @return the isAutoFailover value. + */ + public boolean isAutoFailover() { + return this.isAutoFailover; + } + + /** + * Get the failoverState property: Failover state of the recovery orchestration resource. + * + * @return the failoverState value. + */ + public FailoverState failoverState() { + return this.failoverState; + } + + /** + * Get the testFailoverState property: TestFailover state of the recovery orchestration resource. + * + * @return the testFailoverState value. + */ + public TestFailoverState testFailoverState() { + return this.testFailoverState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceProtectionSolutionSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceProtectionSolutionSettings if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceProtectionSolutionSettings. + */ + public static ResourceProtectionSolutionSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceProtectionSolutionSettings deserializedResourceProtectionSolutionSettings + = new ResourceProtectionSolutionSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isAutoFailover".equals(fieldName)) { + deserializedResourceProtectionSolutionSettings.isAutoFailover = reader.getBoolean(); + } else if ("protectionSolutionType".equals(fieldName)) { + deserializedResourceProtectionSolutionSettings.protectionSolutionType + = ResourceProtectionSolutionType.fromString(reader.getString()); + } else if ("protectionStatus".equals(fieldName)) { + deserializedResourceProtectionSolutionSettings.protectionStatus + = ResourceProtectionStatus.fromString(reader.getString()); + } else if ("resourceId".equals(fieldName)) { + deserializedResourceProtectionSolutionSettings.resourceId = reader.getString(); + } else if ("activeLocation".equals(fieldName)) { + deserializedResourceProtectionSolutionSettings.activeLocation = reader.getString(); + } else if ("activeLocations".equals(fieldName)) { + List activeLocations = reader.readArray(reader1 -> reader1.getString()); + deserializedResourceProtectionSolutionSettings.activeLocations = activeLocations; + } else if ("activePhysicalZones".equals(fieldName)) { + List activePhysicalZones = reader.readArray(reader1 -> reader1.getString()); + deserializedResourceProtectionSolutionSettings.activePhysicalZones = activePhysicalZones; + } else if ("recoveryLocations".equals(fieldName)) { + List recoveryLocations = reader.readArray(reader1 -> reader1.getString()); + deserializedResourceProtectionSolutionSettings.recoveryLocations = recoveryLocations; + } else if ("replicationRole".equals(fieldName)) { + deserializedResourceProtectionSolutionSettings.replicationRole + = ResourceReplicationRole.fromString(reader.getString()); + } else if ("primaryResource".equals(fieldName)) { + deserializedResourceProtectionSolutionSettings.primaryResource = reader.getString(); + } else if ("replicaResources".equals(fieldName)) { + List replicaResources = reader.readArray(reader1 -> reader1.getString()); + deserializedResourceProtectionSolutionSettings.replicaResources = replicaResources; + } else if ("failoverState".equals(fieldName)) { + deserializedResourceProtectionSolutionSettings.failoverState + = FailoverState.fromString(reader.getString()); + } else if ("testFailoverState".equals(fieldName)) { + deserializedResourceProtectionSolutionSettings.testFailoverState + = TestFailoverState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceProtectionSolutionSettings; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceProtectionSolutionType.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceProtectionSolutionType.java new file mode 100644 index 000000000000..ec1731175060 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceProtectionSolutionType.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Protection solution type for the resources by which recovery takes place. + */ +public final class ResourceProtectionSolutionType extends ExpandableStringEnum { + /** + * Resource is not protected with any protection solution. + */ + public static final ResourceProtectionSolutionType NONE = fromString("None"); + + /** + * Resource is protected with the Azure native solution provided by the native Azure service. + */ + public static final ResourceProtectionSolutionType AZURE_NATIVE = fromString("AzureNative"); + + /** + * Resource protected with the Azure solution provided by the native Azure Site Service for Azure VMs. + */ + public static final ResourceProtectionSolutionType AZURE_SITE_RECOVERY = fromString("AzureSiteRecovery"); + + /** + * Cross zone recovery enabled Azure VMs. + */ + public static final ResourceProtectionSolutionType CROSS_ZONE_VMRECOVERY = fromString("CrossZoneVMRecovery"); + + /** + * Resource is not protected with native solution and using custom runbook automation scripts for recovery verbs. + */ + public static final ResourceProtectionSolutionType CUSTOM_RUNBOOK = fromString("CustomRunbook"); + + /** + * Creates a new instance of ResourceProtectionSolutionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceProtectionSolutionType() { + } + + /** + * Creates or finds a ResourceProtectionSolutionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceProtectionSolutionType. + */ + public static ResourceProtectionSolutionType fromString(String name) { + return fromString(name, ResourceProtectionSolutionType.class); + } + + /** + * Gets known ResourceProtectionSolutionType values. + * + * @return known ResourceProtectionSolutionType values. + */ + public static Collection values() { + return values(ResourceProtectionSolutionType.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceProtectionStatus.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceProtectionStatus.java new file mode 100644 index 000000000000..fe00eb903f00 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceProtectionStatus.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * A state type that indicates the protection status of a resource with an Azure solution for regional or zonal + * recovery. + */ +public final class ResourceProtectionStatus extends ExpandableStringEnum { + /** + * The protection status of the resource is unknown. + */ + public static final ResourceProtectionStatus UNKNOWN = fromString("Unknown"); + + /** + * A state indicating that the resource is protected by the recovery solution. + */ + public static final ResourceProtectionStatus PROTECTED = fromString("Protected"); + + /** + * A state indicating that the resource is not protected by any recovery solution. + */ + public static final ResourceProtectionStatus NOT_PROTECTED = fromString("NotProtected"); + + /** + * A state indicating that the resource is protected by the highly available recovery solution. + */ + public static final ResourceProtectionStatus HIGHLY_AVAILABLE = fromString("HighlyAvailable"); + + /** + * Creates a new instance of ResourceProtectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceProtectionStatus() { + } + + /** + * Creates or finds a ResourceProtectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceProtectionStatus. + */ + public static ResourceProtectionStatus fromString(String name) { + return fromString(name, ResourceProtectionStatus.class); + } + + /** + * Gets known ResourceProtectionStatus values. + * + * @return known ResourceProtectionStatus values. + */ + public static Collection values() { + return values(ResourceProtectionStatus.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceReplicationRole.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceReplicationRole.java new file mode 100644 index 000000000000..5b68077ad2ac --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceReplicationRole.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * A state specific to the resource that helps identify its role in replication. + */ +public final class ResourceReplicationRole extends ExpandableStringEnum { + /** + * The role of the resource is unknown. + */ + public static final ResourceReplicationRole UNKNOWN = fromString("Unknown"); + + /** + * A state indicating that the resource is primary and actively replicating data to other replicas. + */ + public static final ResourceReplicationRole PRIMARY = fromString("Primary"); + + /** + * A state indicating that the resource is a replica, receiving data from the primary. + */ + public static final ResourceReplicationRole REPLICA = fromString("Replica"); + + /** + * Creates a new instance of ResourceReplicationRole value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceReplicationRole() { + } + + /** + * Creates or finds a ResourceReplicationRole from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceReplicationRole. + */ + public static ResourceReplicationRole fromString(String name) { + return fromString(name, ResourceReplicationRole.class); + } + + /** + * Gets known ResourceReplicationRole values. + * + * @return known ResourceReplicationRole values. + */ + public static Collection values() { + return values(ResourceReplicationRole.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceSiteRecoveryProtectionSetting.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceSiteRecoveryProtectionSetting.java new file mode 100644 index 000000000000..3676e6f81ea4 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceSiteRecoveryProtectionSetting.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of recovery orchestration resource protection with azure site recovery. + */ +@Fluent +public final class ResourceSiteRecoveryProtectionSetting extends ResourceBaseProtectionSolutionSetting { + /* + * A setting that indicates the resource protected with which recovery solution. + */ + private ResourceProtectionSolutionType protectionSolutionType = ResourceProtectionSolutionType.AZURE_SITE_RECOVERY; + + /* + * Test failover params for azure site recovery solution. + */ + private ResourceSiteRecoveryTestFailoverParams testFailoverParams; + + /* + * Test failover params for azure site recovery solution. + */ + private ResourceSiteRecoveryTestFailoverCleanupParams testFailoverCleanupParams; + + /* + * Reprotect params for azure site recovery solution. + */ + private ResourceSiteRecoveryReprotectParams reprotectParams; + + /** + * Creates an instance of ResourceSiteRecoveryProtectionSetting class. + */ + public ResourceSiteRecoveryProtectionSetting() { + } + + /** + * Get the protectionSolutionType property: A setting that indicates the resource protected with which recovery + * solution. + * + * @return the protectionSolutionType value. + */ + @Override + public ResourceProtectionSolutionType protectionSolutionType() { + return this.protectionSolutionType; + } + + /** + * Get the testFailoverParams property: Test failover params for azure site recovery solution. + * + * @return the testFailoverParams value. + */ + public ResourceSiteRecoveryTestFailoverParams testFailoverParams() { + return this.testFailoverParams; + } + + /** + * Set the testFailoverParams property: Test failover params for azure site recovery solution. + * + * @param testFailoverParams the testFailoverParams value to set. + * @return the ResourceSiteRecoveryProtectionSetting object itself. + */ + public ResourceSiteRecoveryProtectionSetting + withTestFailoverParams(ResourceSiteRecoveryTestFailoverParams testFailoverParams) { + this.testFailoverParams = testFailoverParams; + return this; + } + + /** + * Get the testFailoverCleanupParams property: Test failover params for azure site recovery solution. + * + * @return the testFailoverCleanupParams value. + */ + public ResourceSiteRecoveryTestFailoverCleanupParams testFailoverCleanupParams() { + return this.testFailoverCleanupParams; + } + + /** + * Set the testFailoverCleanupParams property: Test failover params for azure site recovery solution. + * + * @param testFailoverCleanupParams the testFailoverCleanupParams value to set. + * @return the ResourceSiteRecoveryProtectionSetting object itself. + */ + public ResourceSiteRecoveryProtectionSetting + withTestFailoverCleanupParams(ResourceSiteRecoveryTestFailoverCleanupParams testFailoverCleanupParams) { + this.testFailoverCleanupParams = testFailoverCleanupParams; + return this; + } + + /** + * Get the reprotectParams property: Reprotect params for azure site recovery solution. + * + * @return the reprotectParams value. + */ + public ResourceSiteRecoveryReprotectParams reprotectParams() { + return this.reprotectParams; + } + + /** + * Set the reprotectParams property: Reprotect params for azure site recovery solution. + * + * @param reprotectParams the reprotectParams value to set. + * @return the ResourceSiteRecoveryProtectionSetting object itself. + */ + public ResourceSiteRecoveryProtectionSetting + withReprotectParams(ResourceSiteRecoveryReprotectParams reprotectParams) { + this.reprotectParams = reprotectParams; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protectionSolutionType", + this.protectionSolutionType == null ? null : this.protectionSolutionType.toString()); + jsonWriter.writeJsonField("testFailoverParams", this.testFailoverParams); + jsonWriter.writeJsonField("testFailoverCleanupParams", this.testFailoverCleanupParams); + jsonWriter.writeJsonField("reprotectParams", this.reprotectParams); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceSiteRecoveryProtectionSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceSiteRecoveryProtectionSetting if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceSiteRecoveryProtectionSetting. + */ + public static ResourceSiteRecoveryProtectionSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceSiteRecoveryProtectionSetting deserializedResourceSiteRecoveryProtectionSetting + = new ResourceSiteRecoveryProtectionSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protectionSolutionType".equals(fieldName)) { + deserializedResourceSiteRecoveryProtectionSetting.protectionSolutionType + = ResourceProtectionSolutionType.fromString(reader.getString()); + } else if ("testFailoverParams".equals(fieldName)) { + deserializedResourceSiteRecoveryProtectionSetting.testFailoverParams + = ResourceSiteRecoveryTestFailoverParams.fromJson(reader); + } else if ("testFailoverCleanupParams".equals(fieldName)) { + deserializedResourceSiteRecoveryProtectionSetting.testFailoverCleanupParams + = ResourceSiteRecoveryTestFailoverCleanupParams.fromJson(reader); + } else if ("reprotectParams".equals(fieldName)) { + deserializedResourceSiteRecoveryProtectionSetting.reprotectParams + = ResourceSiteRecoveryReprotectParams.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceSiteRecoveryProtectionSetting; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceSiteRecoveryReprotectParams.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceSiteRecoveryReprotectParams.java new file mode 100644 index 000000000000..24b9887a5802 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceSiteRecoveryReprotectParams.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of recovery resource reprotect params for site recovery solution. + */ +@Fluent +public final class ResourceSiteRecoveryReprotectParams + implements JsonSerializable { + /* + * Disk Reprotect Input Details + */ + private List diskReprotectInputDetails; + + /** + * Creates an instance of ResourceSiteRecoveryReprotectParams class. + */ + public ResourceSiteRecoveryReprotectParams() { + } + + /** + * Get the diskReprotectInputDetails property: Disk Reprotect Input Details. + * + * @return the diskReprotectInputDetails value. + */ + public List diskReprotectInputDetails() { + return this.diskReprotectInputDetails; + } + + /** + * Set the diskReprotectInputDetails property: Disk Reprotect Input Details. + * + * @param diskReprotectInputDetails the diskReprotectInputDetails value to set. + * @return the ResourceSiteRecoveryReprotectParams object itself. + */ + public ResourceSiteRecoveryReprotectParams + withDiskReprotectInputDetails(List diskReprotectInputDetails) { + this.diskReprotectInputDetails = diskReprotectInputDetails; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("diskReprotectInputDetails", this.diskReprotectInputDetails, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceSiteRecoveryReprotectParams from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceSiteRecoveryReprotectParams if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceSiteRecoveryReprotectParams. + */ + public static ResourceSiteRecoveryReprotectParams fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceSiteRecoveryReprotectParams deserializedResourceSiteRecoveryReprotectParams + = new ResourceSiteRecoveryReprotectParams(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("diskReprotectInputDetails".equals(fieldName)) { + List diskReprotectInputDetails + = reader.readArray(reader1 -> DiskReprotectInputDetails.fromJson(reader1)); + deserializedResourceSiteRecoveryReprotectParams.diskReprotectInputDetails + = diskReprotectInputDetails; + } else { + reader.skipChildren(); + } + } + + return deserializedResourceSiteRecoveryReprotectParams; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceSiteRecoveryTestFailoverCleanupParams.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceSiteRecoveryTestFailoverCleanupParams.java new file mode 100644 index 000000000000..e4efcf4bee9c --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceSiteRecoveryTestFailoverCleanupParams.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of recovery resource reprotect params for site recovery solution. + */ +@Fluent +public final class ResourceSiteRecoveryTestFailoverCleanupParams + implements JsonSerializable { + /* + * Comments for testfailover cleanup + */ + private String comments; + + /** + * Creates an instance of ResourceSiteRecoveryTestFailoverCleanupParams class. + */ + public ResourceSiteRecoveryTestFailoverCleanupParams() { + } + + /** + * Get the comments property: Comments for testfailover cleanup. + * + * @return the comments value. + */ + public String comments() { + return this.comments; + } + + /** + * Set the comments property: Comments for testfailover cleanup. + * + * @param comments the comments value to set. + * @return the ResourceSiteRecoveryTestFailoverCleanupParams object itself. + */ + public ResourceSiteRecoveryTestFailoverCleanupParams withComments(String comments) { + this.comments = comments; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("comments", this.comments); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceSiteRecoveryTestFailoverCleanupParams from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceSiteRecoveryTestFailoverCleanupParams if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceSiteRecoveryTestFailoverCleanupParams. + */ + public static ResourceSiteRecoveryTestFailoverCleanupParams fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceSiteRecoveryTestFailoverCleanupParams deserializedResourceSiteRecoveryTestFailoverCleanupParams + = new ResourceSiteRecoveryTestFailoverCleanupParams(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("comments".equals(fieldName)) { + deserializedResourceSiteRecoveryTestFailoverCleanupParams.comments = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceSiteRecoveryTestFailoverCleanupParams; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceSiteRecoveryTestFailoverParams.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceSiteRecoveryTestFailoverParams.java new file mode 100644 index 000000000000..a83a849be4ab --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceSiteRecoveryTestFailoverParams.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of recovery resource failover params for site recovery solution. + */ +@Fluent +public final class ResourceSiteRecoveryTestFailoverParams + implements JsonSerializable { + /* + * The Azure network resource is which will be used for test failover virtual machine. + */ + private String networkResourceId; + + /** + * Creates an instance of ResourceSiteRecoveryTestFailoverParams class. + */ + public ResourceSiteRecoveryTestFailoverParams() { + } + + /** + * Get the networkResourceId property: The Azure network resource is which will be used for test failover virtual + * machine. + * + * @return the networkResourceId value. + */ + public String networkResourceId() { + return this.networkResourceId; + } + + /** + * Set the networkResourceId property: The Azure network resource is which will be used for test failover virtual + * machine. + * + * @param networkResourceId the networkResourceId value to set. + * @return the ResourceSiteRecoveryTestFailoverParams object itself. + */ + public ResourceSiteRecoveryTestFailoverParams withNetworkResourceId(String networkResourceId) { + this.networkResourceId = networkResourceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("networkResourceId", this.networkResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceSiteRecoveryTestFailoverParams from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceSiteRecoveryTestFailoverParams if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceSiteRecoveryTestFailoverParams. + */ + public static ResourceSiteRecoveryTestFailoverParams fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceSiteRecoveryTestFailoverParams deserializedResourceSiteRecoveryTestFailoverParams + = new ResourceSiteRecoveryTestFailoverParams(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkResourceId".equals(fieldName)) { + deserializedResourceSiteRecoveryTestFailoverParams.networkResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceSiteRecoveryTestFailoverParams; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceTypeCategories.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceTypeCategories.java new file mode 100644 index 000000000000..73ea32f95494 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceTypeCategories.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * A state type that indicates qualification of a resource for an operation. + */ +public final class ResourceTypeCategories extends ExpandableStringEnum { + /** + * Indicates that alteast one Azure Site Recovery VMs are present. + */ + public static final ResourceTypeCategories AZURE_SITE_RECOVERY_VMS_PRESENT + = fromString("AzureSiteRecoveryVMsPresent"); + + /** + * Creates a new instance of ResourceTypeCategories value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceTypeCategories() { + } + + /** + * Creates or finds a ResourceTypeCategories from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceTypeCategories. + */ + public static ResourceTypeCategories fromString(String name) { + return fromString(name, ResourceTypeCategories.class); + } + + /** + * Gets known ResourceTypeCategories values. + * + * @return known ResourceTypeCategories values. + */ + public static Collection values() { + return values(ResourceTypeCategories.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ServiceGroupMembership.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ServiceGroupMembership.java new file mode 100644 index 000000000000..53b08d2b704a --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ServiceGroupMembership.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Model for service group membership. + */ +@Immutable +public final class ServiceGroupMembership implements JsonSerializable { + /* + * Arm Id of the service group. + */ + private String serviceGroupId; + + /* + * Membership type of the service group to resource. + */ + private MembershipType membershipType; + + /** + * Creates an instance of ServiceGroupMembership class. + */ + private ServiceGroupMembership() { + } + + /** + * Get the serviceGroupId property: Arm Id of the service group. + * + * @return the serviceGroupId value. + */ + public String serviceGroupId() { + return this.serviceGroupId; + } + + /** + * Get the membershipType property: Membership type of the service group to resource. + * + * @return the membershipType value. + */ + public MembershipType membershipType() { + return this.membershipType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serviceGroupId", this.serviceGroupId); + jsonWriter.writeStringField("membershipType", + this.membershipType == null ? null : this.membershipType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceGroupMembership from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceGroupMembership if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ServiceGroupMembership. + */ + public static ServiceGroupMembership fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceGroupMembership deserializedServiceGroupMembership = new ServiceGroupMembership(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceGroupId".equals(fieldName)) { + deserializedServiceGroupMembership.serviceGroupId = reader.getString(); + } else if ("membershipType".equals(fieldName)) { + deserializedServiceGroupMembership.membershipType = MembershipType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceGroupMembership; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ServiceLevelResource.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ServiceLevelResource.java new file mode 100644 index 000000000000..b36c8d2c0310 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ServiceLevelResource.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Service level resource model. + */ +@Fluent +public final class ServiceLevelResource implements JsonSerializable { + /* + * The arm id of the service level indicator resource + */ + private String serviceLevelIndicatorResourceId; + + /* + * The arm id of the service level object resource + */ + private String serviceLevelObjectiveResourceId; + + /** + * Creates an instance of ServiceLevelResource class. + */ + public ServiceLevelResource() { + } + + /** + * Get the serviceLevelIndicatorResourceId property: The arm id of the service level indicator resource. + * + * @return the serviceLevelIndicatorResourceId value. + */ + public String serviceLevelIndicatorResourceId() { + return this.serviceLevelIndicatorResourceId; + } + + /** + * Set the serviceLevelIndicatorResourceId property: The arm id of the service level indicator resource. + * + * @param serviceLevelIndicatorResourceId the serviceLevelIndicatorResourceId value to set. + * @return the ServiceLevelResource object itself. + */ + public ServiceLevelResource withServiceLevelIndicatorResourceId(String serviceLevelIndicatorResourceId) { + this.serviceLevelIndicatorResourceId = serviceLevelIndicatorResourceId; + return this; + } + + /** + * Get the serviceLevelObjectiveResourceId property: The arm id of the service level object resource. + * + * @return the serviceLevelObjectiveResourceId value. + */ + public String serviceLevelObjectiveResourceId() { + return this.serviceLevelObjectiveResourceId; + } + + /** + * Set the serviceLevelObjectiveResourceId property: The arm id of the service level object resource. + * + * @param serviceLevelObjectiveResourceId the serviceLevelObjectiveResourceId value to set. + * @return the ServiceLevelResource object itself. + */ + public ServiceLevelResource withServiceLevelObjectiveResourceId(String serviceLevelObjectiveResourceId) { + this.serviceLevelObjectiveResourceId = serviceLevelObjectiveResourceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serviceLevelIndicatorResourceId", this.serviceLevelIndicatorResourceId); + jsonWriter.writeStringField("serviceLevelObjectiveResourceId", this.serviceLevelObjectiveResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceLevelResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceLevelResource if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ServiceLevelResource. + */ + public static ServiceLevelResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceLevelResource deserializedServiceLevelResource = new ServiceLevelResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceLevelIndicatorResourceId".equals(fieldName)) { + deserializedServiceLevelResource.serviceLevelIndicatorResourceId = reader.getString(); + } else if ("serviceLevelObjectiveResourceId".equals(fieldName)) { + deserializedServiceLevelResource.serviceLevelObjectiveResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceLevelResource; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/SolutionDisplayName.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/SolutionDisplayName.java new file mode 100644 index 000000000000..920545edc31b --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/SolutionDisplayName.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Identifies a high-availability solution that can be applied to a resource (for example, zone-pinned VM with ZRS + * disk). + */ +public final class SolutionDisplayName extends ExpandableStringEnum { + /** + * Zone pinned VM with ZRS disk. + */ + public static final SolutionDisplayName ZONE_PINNED_VM_WITH_ZRS_DISK = fromString("ZonePinnedVmWithZrsDisk"); + + /** + * VM in multi-zone VMSS. + */ + public static final SolutionDisplayName VM_IN_MULTI_ZONE_VMSS = fromString("VmInMultiZoneVmss"); + + /** + * Creates a new instance of SolutionDisplayName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SolutionDisplayName() { + } + + /** + * Creates or finds a SolutionDisplayName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SolutionDisplayName. + */ + public static SolutionDisplayName fromString(String name) { + return fromString(name, SolutionDisplayName.class); + } + + /** + * Gets known SolutionDisplayName values. + * + * @return known SolutionDisplayName values. + */ + public static Collection values() { + return values(SolutionDisplayName.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/SupportedVerbsForStage.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/SupportedVerbsForStage.java new file mode 100644 index 000000000000..f989073fb63d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/SupportedVerbsForStage.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Model for supported verbs for stage. + */ +@Immutable +public final class SupportedVerbsForStage implements JsonSerializable { + /* + * Name of stage. + */ + private DrillRunSubtasks drillRunStage; + + /* + * Supported Verbs for stage. + */ + private List supportedVerbs; + + /** + * Creates an instance of SupportedVerbsForStage class. + */ + private SupportedVerbsForStage() { + } + + /** + * Get the drillRunStage property: Name of stage. + * + * @return the drillRunStage value. + */ + public DrillRunSubtasks drillRunStage() { + return this.drillRunStage; + } + + /** + * Get the supportedVerbs property: Supported Verbs for stage. + * + * @return the supportedVerbs value. + */ + public List supportedVerbs() { + return this.supportedVerbs; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("drillRunStage", this.drillRunStage == null ? null : this.drillRunStage.toString()); + jsonWriter.writeArrayField("supportedVerbs", this.supportedVerbs, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SupportedVerbsForStage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SupportedVerbsForStage if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SupportedVerbsForStage. + */ + public static SupportedVerbsForStage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SupportedVerbsForStage deserializedSupportedVerbsForStage = new SupportedVerbsForStage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("drillRunStage".equals(fieldName)) { + deserializedSupportedVerbsForStage.drillRunStage = DrillRunSubtasks.fromString(reader.getString()); + } else if ("supportedVerbs".equals(fieldName)) { + List supportedVerbs + = reader.readArray(reader1 -> DrillRunOperationVerbs.fromString(reader1.getString())); + deserializedSupportedVerbsForStage.supportedVerbs = supportedVerbs; + } else { + reader.skipChildren(); + } + } + + return deserializedSupportedVerbsForStage; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/SystemMetadata.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/SystemMetadata.java new file mode 100644 index 000000000000..350e6d4bbe15 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/SystemMetadata.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Internal System Metadata, to be used by internal components only. + */ +@Immutable +public final class SystemMetadata implements JsonSerializable { + /* + * Indicates if the Initial system configuration of the Drill is complete or not. + */ + private InitialConfig initialConfig; + + /* + * An indication whether a intrested resource type is present in drill resource. + */ + private List resourceTypeCategories; + + /** + * Creates an instance of SystemMetadata class. + */ + private SystemMetadata() { + } + + /** + * Get the initialConfig property: Indicates if the Initial system configuration of the Drill is complete or not. + * + * @return the initialConfig value. + */ + public InitialConfig initialConfig() { + return this.initialConfig; + } + + /** + * Get the resourceTypeCategories property: An indication whether a intrested resource type is present in drill + * resource. + * + * @return the resourceTypeCategories value. + */ + public List resourceTypeCategories() { + return this.resourceTypeCategories; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("initialConfig", this.initialConfig == null ? null : this.initialConfig.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SystemMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SystemMetadata if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SystemMetadata. + */ + public static SystemMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SystemMetadata deserializedSystemMetadata = new SystemMetadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("initialConfig".equals(fieldName)) { + deserializedSystemMetadata.initialConfig = InitialConfig.fromString(reader.getString()); + } else if ("resourceTypeCategories".equals(fieldName)) { + List resourceTypeCategories + = reader.readArray(reader1 -> ResourceTypeCategories.fromString(reader1.getString())); + deserializedSystemMetadata.resourceTypeCategories = resourceTypeCategories; + } else { + reader.skipChildren(); + } + } + + return deserializedSystemMetadata; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/TestFailoverCleanupRequest.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/TestFailoverCleanupRequest.java new file mode 100644 index 000000000000..b28c99de8164 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/TestFailoverCleanupRequest.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * TestFailoverCleanup post action request. + */ +@Fluent +public final class TestFailoverCleanupRequest implements JsonSerializable { + /* + * Comments for test failover cleanup. + */ + private String comments; + + /** + * Creates an instance of TestFailoverCleanupRequest class. + */ + public TestFailoverCleanupRequest() { + } + + /** + * Get the comments property: Comments for test failover cleanup. + * + * @return the comments value. + */ + public String comments() { + return this.comments; + } + + /** + * Set the comments property: Comments for test failover cleanup. + * + * @param comments the comments value to set. + * @return the TestFailoverCleanupRequest object itself. + */ + public TestFailoverCleanupRequest withComments(String comments) { + this.comments = comments; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("comments", this.comments); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestFailoverCleanupRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestFailoverCleanupRequest if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TestFailoverCleanupRequest. + */ + public static TestFailoverCleanupRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestFailoverCleanupRequest deserializedTestFailoverCleanupRequest = new TestFailoverCleanupRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("comments".equals(fieldName)) { + deserializedTestFailoverCleanupRequest.comments = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTestFailoverCleanupRequest; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/TestFailoverState.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/TestFailoverState.java new file mode 100644 index 000000000000..b99aeff1e198 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/TestFailoverState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * A state specific to the resource that helps identify its TestFailover state. + */ +public final class TestFailoverState extends ExpandableStringEnum { + /** + * The resource is Not in TestFailedOver state (No test failover cleanup pending). + */ + public static final TestFailoverState NONE = fromString("None"); + + /** + * he resource is in test failover cleanup pending state. + */ + public static final TestFailoverState TEST_FAILOVER_CLEANUP_PENDING = fromString("TestFailoverCleanupPending"); + + /** + * Creates a new instance of TestFailoverState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TestFailoverState() { + } + + /** + * Creates or finds a TestFailoverState from its string representation. + * + * @param name a name to look for. + * @return the corresponding TestFailoverState. + */ + public static TestFailoverState fromString(String name) { + return fromString(name, TestFailoverState.class); + } + + /** + * Gets known TestFailoverState values. + * + * @return known TestFailoverState values. + */ + public static Collection values() { + return values(TestFailoverState.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UnifiedResilienceItem.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UnifiedResilienceItem.java new file mode 100644 index 000000000000..cd49f393a06a --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UnifiedResilienceItem.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.UnifiedResilienceItemInner; + +/** + * An immutable client-side representation of UnifiedResilienceItem. + */ +public interface UnifiedResilienceItem { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + UnifiedResilienceItemProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.resiliencemanagement.fluent.models.UnifiedResilienceItemInner object. + * + * @return the inner object. + */ + UnifiedResilienceItemInner innerModel(); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UnifiedResilienceItemProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UnifiedResilienceItemProperties.java new file mode 100644 index 000000000000..e90fa04ba7e3 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UnifiedResilienceItemProperties.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of unified resilience item property. + */ +@Immutable +public final class UnifiedResilienceItemProperties implements JsonSerializable { + /* + * Provisioning state + */ + private ProvisioningState provisioningState; + + /* + * Computed and copied data of resilience goals. + */ + private GoalsData goals; + + /* + * Computed and copied data of Azure recommendations. + */ + private RecommendationsData recommendations; + + /* + * Last modified time of the unified resilience item. + */ + private OffsetDateTime lastModifiedTime; + + /** + * Creates an instance of UnifiedResilienceItemProperties class. + */ + private UnifiedResilienceItemProperties() { + } + + /** + * Get the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the goals property: Computed and copied data of resilience goals. + * + * @return the goals value. + */ + public GoalsData goals() { + return this.goals; + } + + /** + * Get the recommendations property: Computed and copied data of Azure recommendations. + * + * @return the recommendations value. + */ + public RecommendationsData recommendations() { + return this.recommendations; + } + + /** + * Get the lastModifiedTime property: Last modified time of the unified resilience item. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("goals", this.goals); + jsonWriter.writeJsonField("recommendations", this.recommendations); + jsonWriter.writeStringField("lastModifiedTime", + this.lastModifiedTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UnifiedResilienceItemProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UnifiedResilienceItemProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UnifiedResilienceItemProperties. + */ + public static UnifiedResilienceItemProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UnifiedResilienceItemProperties deserializedUnifiedResilienceItemProperties + = new UnifiedResilienceItemProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("goals".equals(fieldName)) { + deserializedUnifiedResilienceItemProperties.goals = GoalsData.fromJson(reader); + } else if ("recommendations".equals(fieldName)) { + deserializedUnifiedResilienceItemProperties.recommendations = RecommendationsData.fromJson(reader); + } else if ("lastModifiedTime".equals(fieldName)) { + deserializedUnifiedResilienceItemProperties.lastModifiedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("provisioningState".equals(fieldName)) { + deserializedUnifiedResilienceItemProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedUnifiedResilienceItemProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UnifiedResilienceItemRequirementSelected.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UnifiedResilienceItemRequirementSelected.java new file mode 100644 index 000000000000..f31a82e638a4 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UnifiedResilienceItemRequirementSelected.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum for the requirement status of the resource in the goal. + */ +public final class UnifiedResilienceItemRequirementSelected + extends ExpandableStringEnum { + /** + * The resource is not required for the specified goal. + */ + public static final UnifiedResilienceItemRequirementSelected NOT_REQUIRED = fromString("NotRequired"); + + /** + * The resource is required for the specified goal. + */ + public static final UnifiedResilienceItemRequirementSelected REQUIRED = fromString("Required"); + + /** + * The resource is not selected for the specified goal. + */ + public static final UnifiedResilienceItemRequirementSelected NOT_SELECTED = fromString("NotSelected"); + + /** + * Creates a new instance of UnifiedResilienceItemRequirementSelected value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UnifiedResilienceItemRequirementSelected() { + } + + /** + * Creates or finds a UnifiedResilienceItemRequirementSelected from its string representation. + * + * @param name a name to look for. + * @return the corresponding UnifiedResilienceItemRequirementSelected. + */ + public static UnifiedResilienceItemRequirementSelected fromString(String name) { + return fromString(name, UnifiedResilienceItemRequirementSelected.class); + } + + /** + * Gets known UnifiedResilienceItemRequirementSelected values. + * + * @return known UnifiedResilienceItemRequirementSelected values. + */ + public static Collection values() { + return values(UnifiedResilienceItemRequirementSelected.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UnifiedResilienceItems.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UnifiedResilienceItems.java new file mode 100644 index 000000000000..9a2e6988a5ca --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UnifiedResilienceItems.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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 UnifiedResilienceItems. + */ +public interface UnifiedResilienceItems { + /** + * Get a UnifiedResilienceItem. + * + * @param serviceGroupName The name of the service group. + * @param unifiedResilienceItemName The name of the unified resilience item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 UnifiedResilienceItem along with {@link Response}. + */ + Response getWithResponse(String serviceGroupName, String unifiedResilienceItemName, + Context context); + + /** + * Get a UnifiedResilienceItem. + * + * @param serviceGroupName The name of the service group. + * @param unifiedResilienceItemName The name of the unified resilience item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 UnifiedResilienceItem. + */ + UnifiedResilienceItem get(String serviceGroupName, String unifiedResilienceItemName); + + /** + * List UnifiedResilienceItem resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UnifiedResilienceItem list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName); + + /** + * List UnifiedResilienceItem resources by tenant. + * + * @param serviceGroupName The name of the service group. + * @param skipToken Skip over when retrieving results. + * @param top Number of elements to return when retrieving results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UnifiedResilienceItem list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String serviceGroupName, String skipToken, Integer top, Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UpdateGoalResourceRequest.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UpdateGoalResourceRequest.java new file mode 100644 index 000000000000..581e2a411d97 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UpdateGoalResourceRequest.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * Request model for update goal resource. + */ +@Fluent +public final class UpdateGoalResourceRequest implements JsonSerializable { + /* + * List of update goal resource. + */ + private List resources; + + /** + * Creates an instance of UpdateGoalResourceRequest class. + */ + public UpdateGoalResourceRequest() { + } + + /** + * Get the resources property: List of update goal resource. + * + * @return the resources value. + */ + public List resources() { + return this.resources; + } + + /** + * Set the resources property: List of update goal resource. + * + * @param resources the resources value to set. + * @return the UpdateGoalResourceRequest object itself. + */ + public UpdateGoalResourceRequest withResources(List resources) { + this.resources = resources; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("resources", this.resources, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateGoalResourceRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateGoalResourceRequest if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UpdateGoalResourceRequest. + */ + public static UpdateGoalResourceRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateGoalResourceRequest deserializedUpdateGoalResourceRequest = new UpdateGoalResourceRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resources".equals(fieldName)) { + List resources + = reader.readArray(reader1 -> GoalResourceInner.fromJson(reader1)); + deserializedUpdateGoalResourceRequest.resources = resources; + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateGoalResourceRequest; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UpdateRecoveryResourcesRequest.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UpdateRecoveryResourcesRequest.java new file mode 100644 index 000000000000..276831e70863 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UpdateRecoveryResourcesRequest.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * RecoveryResources post action request to update in batch. + */ +@Fluent +public final class UpdateRecoveryResourcesRequest implements JsonSerializable { + /* + * A list of recovery orchestration resources whose properties need to be updated. + */ + private List resourcesToUpdate; + + /* + * A list of recovery orchestration resources that need to be removed from the recovery orchestration plan. + */ + private List resourcesToRemove; + + /** + * Creates an instance of UpdateRecoveryResourcesRequest class. + */ + public UpdateRecoveryResourcesRequest() { + } + + /** + * Get the resourcesToUpdate property: A list of recovery orchestration resources whose properties need to be + * updated. + * + * @return the resourcesToUpdate value. + */ + public List resourcesToUpdate() { + return this.resourcesToUpdate; + } + + /** + * Set the resourcesToUpdate property: A list of recovery orchestration resources whose properties need to be + * updated. + * + * @param resourcesToUpdate the resourcesToUpdate value to set. + * @return the UpdateRecoveryResourcesRequest object itself. + */ + public UpdateRecoveryResourcesRequest withResourcesToUpdate(List resourcesToUpdate) { + this.resourcesToUpdate = resourcesToUpdate; + return this; + } + + /** + * Get the resourcesToRemove property: A list of recovery orchestration resources that need to be removed from the + * recovery orchestration plan. + * + * @return the resourcesToRemove value. + */ + public List resourcesToRemove() { + return this.resourcesToRemove; + } + + /** + * Set the resourcesToRemove property: A list of recovery orchestration resources that need to be removed from the + * recovery orchestration plan. + * + * @param resourcesToRemove the resourcesToRemove value to set. + * @return the UpdateRecoveryResourcesRequest object itself. + */ + public UpdateRecoveryResourcesRequest withResourcesToRemove(List resourcesToRemove) { + this.resourcesToRemove = resourcesToRemove; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("resourcesToUpdate", this.resourcesToUpdate, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("resourcesToRemove", this.resourcesToRemove, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateRecoveryResourcesRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateRecoveryResourcesRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UpdateRecoveryResourcesRequest. + */ + public static UpdateRecoveryResourcesRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateRecoveryResourcesRequest deserializedUpdateRecoveryResourcesRequest + = new UpdateRecoveryResourcesRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourcesToUpdate".equals(fieldName)) { + List resourcesToUpdate + = reader.readArray(reader1 -> RecoveryResourceInner.fromJson(reader1)); + deserializedUpdateRecoveryResourcesRequest.resourcesToUpdate = resourcesToUpdate; + } else if ("resourcesToRemove".equals(fieldName)) { + List resourcesToRemove = reader.readArray(reader1 -> reader1.getString()); + deserializedUpdateRecoveryResourcesRequest.resourcesToRemove = resourcesToRemove; + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateRecoveryResourcesRequest; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UpdateRecoveryResourcesResponse.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UpdateRecoveryResourcesResponse.java new file mode 100644 index 000000000000..dec4f3fc50dc --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UpdateRecoveryResourcesResponse.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.resourcemanager.resiliencemanagement.fluent.models.UpdateRecoveryResourcesResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of UpdateRecoveryResourcesResponse. + */ +public interface UpdateRecoveryResourcesResponse { + /** + * Gets the failedResources property: A list of error details associated with resources for which the update has + * failed. + * + * @return the failedResources value. + */ + List failedResources(); + + /** + * Gets the inner com.azure.resourcemanager.resiliencemanagement.fluent.models.UpdateRecoveryResourcesResponseInner + * object. + * + * @return the inner object. + */ + UpdateRecoveryResourcesResponseInner innerModel(); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlan.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlan.java new file mode 100644 index 000000000000..a52e7c909d91 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlan.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.UsagePlanInner; +import java.util.Map; + +/** + * An immutable client-side representation of UsagePlan. + */ +public interface UsagePlan { + /** + * 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 location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + UsagePlanProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.resiliencemanagement.fluent.models.UsagePlanInner object. + * + * @return the inner object. + */ + UsagePlanInner innerModel(); + + /** + * The entirety of the UsagePlan definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The UsagePlan definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the UsagePlan definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the UsagePlan definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the UsagePlan definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the UsagePlan 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.WithTags, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + UsagePlan create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + UsagePlan create(Context context); + } + + /** + * The stage of the UsagePlan definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the UsagePlan definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(UsagePlanProperties properties); + } + } + + /** + * Begins update for the UsagePlan resource. + * + * @return the stage of resource update. + */ + UsagePlan.Update update(); + + /** + * The template for UsagePlan update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + UsagePlan apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + UsagePlan apply(Context context); + } + + /** + * The UsagePlan update stages. + */ + interface UpdateStages { + /** + * The stage of the UsagePlan update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + UsagePlan refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + UsagePlan refresh(Context context); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlanProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlanProperties.java new file mode 100644 index 000000000000..7ae7be1fb230 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlanProperties.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of usage plan properties. + */ +@Fluent +public final class UsagePlanProperties implements JsonSerializable { + /* + * The type of the usage plan. + */ + private UsagePlanType planType; + + /* + * Provisioning state of the usage plan. + */ + private ProvisioningState provisioningState; + + /* + * Details of any errors encountered during Usage Plan create or update. + */ + private ManagementError errorDetails; + + /** + * Creates an instance of UsagePlanProperties class. + */ + public UsagePlanProperties() { + } + + /** + * Get the planType property: The type of the usage plan. + * + * @return the planType value. + */ + public UsagePlanType planType() { + return this.planType; + } + + /** + * Set the planType property: The type of the usage plan. + * + * @param planType the planType value to set. + * @return the UsagePlanProperties object itself. + */ + public UsagePlanProperties withPlanType(UsagePlanType planType) { + this.planType = planType; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the usage plan. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the errorDetails property: Details of any errors encountered during Usage Plan create or update. + * + * @return the errorDetails value. + */ + public ManagementError errorDetails() { + return this.errorDetails; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("planType", this.planType == null ? null : this.planType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsagePlanProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsagePlanProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UsagePlanProperties. + */ + public static UsagePlanProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsagePlanProperties deserializedUsagePlanProperties = new UsagePlanProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("planType".equals(fieldName)) { + deserializedUsagePlanProperties.planType = UsagePlanType.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedUsagePlanProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("errorDetails".equals(fieldName)) { + deserializedUsagePlanProperties.errorDetails = ManagementError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUsagePlanProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlanTagsUpdate.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlanTagsUpdate.java new file mode 100644 index 000000000000..ce530b2310d4 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlanTagsUpdate.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in UsagePlan resources. + */ +@Fluent +public final class UsagePlanTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of UsagePlanTagsUpdate class. + */ + public UsagePlanTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the UsagePlanTagsUpdate object itself. + */ + public UsagePlanTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsagePlanTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsagePlanTagsUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UsagePlanTagsUpdate. + */ + public static UsagePlanTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsagePlanTagsUpdate deserializedUsagePlanTagsUpdate = new UsagePlanTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedUsagePlanTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedUsagePlanTagsUpdate; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlanType.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlanType.java new file mode 100644 index 000000000000..d5244f256158 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlanType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of usage plan. + */ +public final class UsagePlanType extends ExpandableStringEnum { + /** + * Basic usage plan with restricted functionality without any charges. + */ + public static final UsagePlanType BASIC = fromString("Basic"); + + /** + * Standard usage plan with comprehensive functionality and usage based charges. + */ + public static final UsagePlanType STANDARD = fromString("Standard"); + + /** + * Creates a new instance of UsagePlanType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UsagePlanType() { + } + + /** + * Creates or finds a UsagePlanType from its string representation. + * + * @param name a name to look for. + * @return the corresponding UsagePlanType. + */ + public static UsagePlanType fromString(String name) { + return fromString(name, UsagePlanType.class); + } + + /** + * Gets known UsagePlanType values. + * + * @return known UsagePlanType values. + */ + public static Collection values() { + return values(UsagePlanType.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlans.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlans.java new file mode 100644 index 000000000000..c966c4fea86d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlans.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.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 UsagePlans. + */ +public interface UsagePlans { + /** + * Get a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 UsagePlan along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String usagePlanName, Context context); + + /** + * Get a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 UsagePlan. + */ + UsagePlan getByResourceGroup(String resourceGroupName, String usagePlanName); + + /** + * Delete a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceGroupName, String usagePlanName); + + /** + * Delete a UsagePlan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param usagePlanName The name of the usage plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 delete(String resourceGroupName, String usagePlanName, Context context); + + /** + * List UsagePlan resources by 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 the response of a UsagePlan list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List UsagePlan resources by 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 the response of a UsagePlan list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List UsagePlan resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a UsagePlan list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List UsagePlan resources by subscription 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 response of a UsagePlan list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Get a UsagePlan. + * + * @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 a UsagePlan along with {@link Response}. + */ + UsagePlan getById(String id); + + /** + * Get a UsagePlan. + * + * @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 a UsagePlan along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a UsagePlan. + * + * @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 UsagePlan. + * + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new UsagePlan resource. + * + * @param name resource name. + * @return the first stage of the new UsagePlan definition. + */ + UsagePlan.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UserAssignedIdentity.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..1a540b74369d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UserAssignedIdentity.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * User assigned identity properties. + */ +@Immutable +public final class UserAssignedIdentity implements JsonSerializable { + /* + * The principal ID of the assigned identity. + */ + private String principalId; + + /* + * The client ID of the assigned identity. + */ + private String clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UserConfirmationForHighAvailabilityItem.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UserConfirmationForHighAvailabilityItem.java new file mode 100644 index 000000000000..27a082e1ca07 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UserConfirmationForHighAvailabilityItem.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a user confirmation for a high availability solution. + */ +@Fluent +public final class UserConfirmationForHighAvailabilityItem + implements JsonSerializable { + /* + * The solution display name of the high availability solution. + */ + private SolutionDisplayName solutionDisplayName; + + /* + * The confirmation status of the high availability solution. + */ + private ConfirmationStatus confirmationStatus; + + /* + * The reason for requesting user confirmation for the high availability solution. + */ + private ReasonForRequestingConfirmation reasonForRequestingConfirmation; + + /** + * Creates an instance of UserConfirmationForHighAvailabilityItem class. + */ + public UserConfirmationForHighAvailabilityItem() { + } + + /** + * Get the solutionDisplayName property: The solution display name of the high availability solution. + * + * @return the solutionDisplayName value. + */ + public SolutionDisplayName solutionDisplayName() { + return this.solutionDisplayName; + } + + /** + * Set the solutionDisplayName property: The solution display name of the high availability solution. + * + * @param solutionDisplayName the solutionDisplayName value to set. + * @return the UserConfirmationForHighAvailabilityItem object itself. + */ + public UserConfirmationForHighAvailabilityItem withSolutionDisplayName(SolutionDisplayName solutionDisplayName) { + this.solutionDisplayName = solutionDisplayName; + return this; + } + + /** + * Get the confirmationStatus property: The confirmation status of the high availability solution. + * + * @return the confirmationStatus value. + */ + public ConfirmationStatus confirmationStatus() { + return this.confirmationStatus; + } + + /** + * Set the confirmationStatus property: The confirmation status of the high availability solution. + * + * @param confirmationStatus the confirmationStatus value to set. + * @return the UserConfirmationForHighAvailabilityItem object itself. + */ + public UserConfirmationForHighAvailabilityItem withConfirmationStatus(ConfirmationStatus confirmationStatus) { + this.confirmationStatus = confirmationStatus; + return this; + } + + /** + * Get the reasonForRequestingConfirmation property: The reason for requesting user confirmation for the high + * availability solution. + * + * @return the reasonForRequestingConfirmation value. + */ + public ReasonForRequestingConfirmation reasonForRequestingConfirmation() { + return this.reasonForRequestingConfirmation; + } + + /** + * Set the reasonForRequestingConfirmation property: The reason for requesting user confirmation for the high + * availability solution. + * + * @param reasonForRequestingConfirmation the reasonForRequestingConfirmation value to set. + * @return the UserConfirmationForHighAvailabilityItem object itself. + */ + public UserConfirmationForHighAvailabilityItem + withReasonForRequestingConfirmation(ReasonForRequestingConfirmation reasonForRequestingConfirmation) { + this.reasonForRequestingConfirmation = reasonForRequestingConfirmation; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("solutionDisplayName", + this.solutionDisplayName == null ? null : this.solutionDisplayName.toString()); + jsonWriter.writeStringField("confirmationStatus", + this.confirmationStatus == null ? null : this.confirmationStatus.toString()); + jsonWriter.writeStringField("reasonForRequestingConfirmation", + this.reasonForRequestingConfirmation == null ? null : this.reasonForRequestingConfirmation.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserConfirmationForHighAvailabilityItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserConfirmationForHighAvailabilityItem if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UserConfirmationForHighAvailabilityItem. + */ + public static UserConfirmationForHighAvailabilityItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserConfirmationForHighAvailabilityItem deserializedUserConfirmationForHighAvailabilityItem + = new UserConfirmationForHighAvailabilityItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("solutionDisplayName".equals(fieldName)) { + deserializedUserConfirmationForHighAvailabilityItem.solutionDisplayName + = SolutionDisplayName.fromString(reader.getString()); + } else if ("confirmationStatus".equals(fieldName)) { + deserializedUserConfirmationForHighAvailabilityItem.confirmationStatus + = ConfirmationStatus.fromString(reader.getString()); + } else if ("reasonForRequestingConfirmation".equals(fieldName)) { + deserializedUserConfirmationForHighAvailabilityItem.reasonForRequestingConfirmation + = ReasonForRequestingConfirmation.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedUserConfirmationForHighAvailabilityItem; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UserConsent.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UserConsent.java new file mode 100644 index 000000000000..3cb6c754eb39 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UserConsent.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * User consent for performing recovery action. + */ +public final class UserConsent extends ExpandableStringEnum { + /** + * User consent is not specified for the operation. + */ + public static final UserConsent UNSPECIFIED = fromString("Unspecified"); + + /** + * Action is allowed with user consent. + */ + public static final UserConsent ALLOWED = fromString("Allowed"); + + /** + * Creates a new instance of UserConsent value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UserConsent() { + } + + /** + * Creates or finds a UserConsent from its string representation. + * + * @param name a name to look for. + * @return the corresponding UserConsent. + */ + public static UserConsent fromString(String name) { + return fromString(name, UserConsent.class); + } + + /** + * Gets known UserConsent values. + * + * @return known UserConsent values. + */ + public static Collection values() { + return values(UserConsent.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/VMPresent.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/VMPresent.java new file mode 100644 index 000000000000..ff3dd959022d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/VMPresent.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum for VM presence. + */ +public final class VMPresent extends ExpandableStringEnum { + /** + * Atleast one VM Present. + */ + public static final VMPresent PRESENT = fromString("Present"); + + /** + * No VM present. + */ + public static final VMPresent ABSENT = fromString("Absent"); + + /** + * Creates a new instance of VMPresent value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VMPresent() { + } + + /** + * Creates or finds a VMPresent from its string representation. + * + * @param name a name to look for. + * @return the corresponding VMPresent. + */ + public static VMPresent fromString(String name) { + return fromString(name, VMPresent.class); + } + + /** + * Gets known VMPresent values. + * + * @return known VMPresent values. + */ + public static Collection values() { + return values(VMPresent.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ValidateForExecutionProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ValidateForExecutionProperties.java new file mode 100644 index 000000000000..6c0c2d23a47d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ValidateForExecutionProperties.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Additional properties for Failover. + */ +@Fluent +public final class ValidateForExecutionProperties implements JsonSerializable { + /* + * Physiscal Source locations from where resources to be failed-over or faulted. + */ + private List sourceLocations; + + /** + * Creates an instance of ValidateForExecutionProperties class. + */ + public ValidateForExecutionProperties() { + } + + /** + * Get the sourceLocations property: Physiscal Source locations from where resources to be failed-over or faulted. + * + * @return the sourceLocations value. + */ + public List sourceLocations() { + return this.sourceLocations; + } + + /** + * Set the sourceLocations property: Physiscal Source locations from where resources to be failed-over or faulted. + * + * @param sourceLocations the sourceLocations value to set. + * @return the ValidateForExecutionProperties object itself. + */ + public ValidateForExecutionProperties withSourceLocations(List sourceLocations) { + this.sourceLocations = sourceLocations; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("sourceLocations", this.sourceLocations, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidateForExecutionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidateForExecutionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ValidateForExecutionProperties. + */ + public static ValidateForExecutionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidateForExecutionProperties deserializedValidateForExecutionProperties + = new ValidateForExecutionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceLocations".equals(fieldName)) { + List sourceLocations = reader.readArray(reader1 -> reader1.getString()); + deserializedValidateForExecutionProperties.sourceLocations = sourceLocations; + } else { + reader.skipChildren(); + } + } + + return deserializedValidateForExecutionProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ValidateForExecutionRequest.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ValidateForExecutionRequest.java new file mode 100644 index 000000000000..11b2af924065 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ValidateForExecutionRequest.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Request body of the Validate For Execute Action of Drill. + */ +@Fluent +public final class ValidateForExecutionRequest implements JsonSerializable { + /* + * Additional properties for Validate for execute. + */ + private ValidateForExecutionProperties validateForExecutionProperties; + + /** + * Creates an instance of ValidateForExecutionRequest class. + */ + public ValidateForExecutionRequest() { + } + + /** + * Get the validateForExecutionProperties property: Additional properties for Validate for execute. + * + * @return the validateForExecutionProperties value. + */ + public ValidateForExecutionProperties validateForExecutionProperties() { + return this.validateForExecutionProperties; + } + + /** + * Set the validateForExecutionProperties property: Additional properties for Validate for execute. + * + * @param validateForExecutionProperties the validateForExecutionProperties value to set. + * @return the ValidateForExecutionRequest object itself. + */ + public ValidateForExecutionRequest + withValidateForExecutionProperties(ValidateForExecutionProperties validateForExecutionProperties) { + this.validateForExecutionProperties = validateForExecutionProperties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("validateForExecutionProperties", this.validateForExecutionProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidateForExecutionRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidateForExecutionRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidateForExecutionRequest. + */ + public static ValidateForExecutionRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidateForExecutionRequest deserializedValidateForExecutionRequest = new ValidateForExecutionRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("validateForExecutionProperties".equals(fieldName)) { + deserializedValidateForExecutionRequest.validateForExecutionProperties + = ValidateForExecutionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedValidateForExecutionRequest; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ValidateForOperationRequest.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ValidateForOperationRequest.java new file mode 100644 index 000000000000..013b4e2dec32 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ValidateForOperationRequest.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * ValidateForOperation post action request to check if operation can be performed. + */ +@Fluent +public final class ValidateForOperationRequest implements JsonSerializable { + /* + * Operation Name to validate. + */ + private RecoveryOperationNames operationName; + + /** + * Creates an instance of ValidateForOperationRequest class. + */ + public ValidateForOperationRequest() { + } + + /** + * Get the operationName property: Operation Name to validate. + * + * @return the operationName value. + */ + public RecoveryOperationNames operationName() { + return this.operationName; + } + + /** + * Set the operationName property: Operation Name to validate. + * + * @param operationName the operationName value to set. + * @return the ValidateForOperationRequest object itself. + */ + public ValidateForOperationRequest withOperationName(RecoveryOperationNames operationName) { + this.operationName = operationName; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operationName", this.operationName == null ? null : this.operationName.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidateForOperationRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidateForOperationRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ValidateForOperationRequest. + */ + public static ValidateForOperationRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidateForOperationRequest deserializedValidateForOperationRequest = new ValidateForOperationRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationName".equals(fieldName)) { + deserializedValidateForOperationRequest.operationName + = RecoveryOperationNames.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedValidateForOperationRequest; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ValidateForRecoveryOperationBaseResponse.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ValidateForRecoveryOperationBaseResponse.java new file mode 100644 index 000000000000..e88085d17950 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ValidateForRecoveryOperationBaseResponse.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.resourcemanager.resiliencemanagement.fluent.models.ValidateForRecoveryOperationBaseResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of ValidateForRecoveryOperationBaseResponse. + */ +public interface ValidateForRecoveryOperationBaseResponse { + /** + * Gets the recoveryResourceQualifications property: Qualification details of resources for the operation. + * + * @return the recoveryResourceQualifications value. + */ + List recoveryResourceQualifications(); + + /** + * Gets the inner + * com.azure.resourcemanager.resiliencemanagement.fluent.models.ValidateForRecoveryOperationBaseResponseInner + * object. + * + * @return the inner object. + */ + ValidateForRecoveryOperationBaseResponseInner innerModel(); +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ZonalDrillProperties.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ZonalDrillProperties.java new file mode 100644 index 000000000000..25bad6951c2d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ZonalDrillProperties.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Zonal Drill properties. + */ +@Fluent +public final class ZonalDrillProperties extends DrillProperties { + /* + * The discriminator for the Drill object hierarchy. + */ + private DrillType drillType = DrillType.ZONAL; + + /* + * An indication whether a VM is included in this Zonal Drill. If not, RO is not needed. + */ + private VMPresent vmsPresent; + + /** + * Creates an instance of ZonalDrillProperties class. + */ + public ZonalDrillProperties() { + } + + /** + * Get the drillType property: The discriminator for the Drill object hierarchy. + * + * @return the drillType value. + */ + @Override + public DrillType drillType() { + return this.drillType; + } + + /** + * Get the vmsPresent property: An indication whether a VM is included in this Zonal Drill. If not, RO is not + * needed. + * + * @return the vmsPresent value. + */ + public VMPresent vmsPresent() { + return this.vmsPresent; + } + + /** + * {@inheritDoc} + */ + @Override + public ZonalDrillProperties withRecoveryPlanProperties(RecoveryPlanPropertiesOfDrill recoveryPlanProperties) { + super.withRecoveryPlanProperties(recoveryPlanProperties); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ZonalDrillProperties withDrillAssetProperties(AssetPropertiesOfDrill drillAssetProperties) { + super.withDrillAssetProperties(drillAssetProperties); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ZonalDrillProperties withChaosResourceProperties(ChaosResourcePropertiesOfDrill chaosResourceProperties) { + super.withChaosResourceProperties(chaosResourceProperties); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ZonalDrillProperties withRbacSetupMode(RBACSetupMode rbacSetupMode) { + super.withRbacSetupMode(rbacSetupMode); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ZonalDrillProperties withMonitoringProperties(MonitoringPropertiesOfDrill monitoringProperties) { + super.withMonitoringProperties(monitoringProperties); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("recoveryPlanProperties", recoveryPlanProperties()); + jsonWriter.writeJsonField("drillAssetProperties", drillAssetProperties()); + jsonWriter.writeJsonField("chaosResourceProperties", chaosResourceProperties()); + jsonWriter.writeStringField("rbacSetupMode", rbacSetupMode() == null ? null : rbacSetupMode().toString()); + jsonWriter.writeJsonField("monitoringProperties", monitoringProperties()); + jsonWriter.writeStringField("drillType", this.drillType == null ? null : this.drillType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ZonalDrillProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ZonalDrillProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ZonalDrillProperties. + */ + public static ZonalDrillProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ZonalDrillProperties deserializedZonalDrillProperties = new ZonalDrillProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedZonalDrillProperties + .withProvisioningState(ProvisioningState.fromString(reader.getString())); + } else if ("serviceGroupId".equals(fieldName)) { + deserializedZonalDrillProperties.withServiceGroupId(reader.getString()); + } else if ("recoveryPlanProperties".equals(fieldName)) { + deserializedZonalDrillProperties + .withRecoveryPlanProperties(RecoveryPlanPropertiesOfDrill.fromJson(reader)); + } else if ("drillAssetProperties".equals(fieldName)) { + deserializedZonalDrillProperties.withDrillAssetProperties(AssetPropertiesOfDrill.fromJson(reader)); + } else if ("chaosResourceProperties".equals(fieldName)) { + deserializedZonalDrillProperties + .withChaosResourceProperties(ChaosResourcePropertiesOfDrill.fromJson(reader)); + } else if ("executionState".equals(fieldName)) { + deserializedZonalDrillProperties.withExecutionState(ExecutionState.fromString(reader.getString())); + } else if ("executionReadinessState".equals(fieldName)) { + deserializedZonalDrillProperties + .withExecutionReadinessState(ExecutionReadinessState.fromString(reader.getString())); + } else if ("rbacSetupMode".equals(fieldName)) { + deserializedZonalDrillProperties.withRbacSetupMode(RBACSetupMode.fromString(reader.getString())); + } else if ("attentionReason".equals(fieldName)) { + deserializedZonalDrillProperties.withAttentionReason(AttentionReason.fromJson(reader)); + } else if ("systemMetadata".equals(fieldName)) { + deserializedZonalDrillProperties.withSystemMetadata(SystemMetadata.fromJson(reader)); + } else if ("lastRunProperties".equals(fieldName)) { + deserializedZonalDrillProperties.withLastRunProperties(LastRunProperties.fromJson(reader)); + } else if ("lastSyncTime".equals(fieldName)) { + deserializedZonalDrillProperties.withLastSyncTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("lastResyncReadinessCheckTime".equals(fieldName)) { + deserializedZonalDrillProperties.withLastResyncReadinessCheckTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("managedOnBehalfOfConfiguration".equals(fieldName)) { + deserializedZonalDrillProperties + .withManagedOnBehalfOfConfiguration(ManagedOnBehalfOfConfiguration.fromJson(reader)); + } else if ("monitoringProperties".equals(fieldName)) { + deserializedZonalDrillProperties + .withMonitoringProperties(MonitoringPropertiesOfDrill.fromJson(reader)); + } else if ("errorDetails".equals(fieldName)) { + deserializedZonalDrillProperties.withErrorDetails(ManagementError.fromJson(reader)); + } else if ("drillType".equals(fieldName)) { + deserializedZonalDrillProperties.drillType = DrillType.fromString(reader.getString()); + } else if ("vmsPresent".equals(fieldName)) { + deserializedZonalDrillProperties.vmsPresent = VMPresent.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedZonalDrillProperties; + }); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/package-info.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/package-info.java new file mode 100644 index 000000000000..81e00dd0c2cc --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/models/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the data models for ResilienceManagement. + */ +package com.azure.resourcemanager.resiliencemanagement.models; diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/package-info.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/package-info.java new file mode 100644 index 000000000000..5b45ef3d71d3 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/com/azure/resourcemanager/resiliencemanagement/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the classes for ResilienceManagement. + */ +package com.azure.resourcemanager.resiliencemanagement; diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/module-info.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/module-info.java new file mode 100644 index 000000000000..993ba3691f3e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/java/module-info.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +module com.azure.resourcemanager.resiliencemanagement { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.resiliencemanagement; + exports com.azure.resourcemanager.resiliencemanagement.fluent; + exports com.azure.resourcemanager.resiliencemanagement.fluent.models; + exports com.azure.resourcemanager.resiliencemanagement.models; + + opens com.azure.resourcemanager.resiliencemanagement.fluent.models to com.azure.core; + opens com.azure.resourcemanager.resiliencemanagement.models to com.azure.core; + opens com.azure.resourcemanager.resiliencemanagement.implementation.models to com.azure.core; +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/resources/META-INF/azure-resourcemanager-resiliencemanagement_metadata.json b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/resources/META-INF/azure-resourcemanager-resiliencemanagement_metadata.json new file mode 100644 index 000000000000..4ee0f2e0bbcc --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/resources/META-INF/azure-resourcemanager-resiliencemanagement_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.AzureResilienceManagement":"2026-04-01-preview"},"crossLanguagePackageId":"Microsoft.AzureResilienceManagement","crossLanguageVersion":"28a9468b3b3d","crossLanguageDefinitions":{"com.azure.resourcemanager.resiliencemanagement.fluent.DrillResourcesClient":"Microsoft.AzureResilienceManagement.DrillResources","com.azure.resourcemanager.resiliencemanagement.fluent.DrillResourcesClient.get":"Microsoft.AzureResilienceManagement.DrillResources.get","com.azure.resourcemanager.resiliencemanagement.fluent.DrillResourcesClient.getWithResponse":"Microsoft.AzureResilienceManagement.DrillResources.get","com.azure.resourcemanager.resiliencemanagement.fluent.DrillResourcesClient.list":"Microsoft.AzureResilienceManagement.DrillResources.list","com.azure.resourcemanager.resiliencemanagement.fluent.DrillRunResourcesClient":"Microsoft.AzureResilienceManagement.DrillRunResources","com.azure.resourcemanager.resiliencemanagement.fluent.DrillRunResourcesClient.get":"Microsoft.AzureResilienceManagement.DrillRunResources.get","com.azure.resourcemanager.resiliencemanagement.fluent.DrillRunResourcesClient.getWithResponse":"Microsoft.AzureResilienceManagement.DrillRunResources.get","com.azure.resourcemanager.resiliencemanagement.fluent.DrillRunResourcesClient.list":"Microsoft.AzureResilienceManagement.DrillRunResources.list","com.azure.resourcemanager.resiliencemanagement.fluent.DrillRunsClient":"Microsoft.AzureResilienceManagement.DrillRuns","com.azure.resourcemanager.resiliencemanagement.fluent.DrillRunsClient.addNotes":"Microsoft.AzureResilienceManagement.DrillRuns.addNotes","com.azure.resourcemanager.resiliencemanagement.fluent.DrillRunsClient.beginAddNotes":"Microsoft.AzureResilienceManagement.DrillRuns.addNotes","com.azure.resourcemanager.resiliencemanagement.fluent.DrillRunsClient.beginFailOver":"Microsoft.AzureResilienceManagement.DrillRuns.failOver","com.azure.resourcemanager.resiliencemanagement.fluent.DrillRunsClient.beginMarkAsComplete":"Microsoft.AzureResilienceManagement.DrillRuns.markAsComplete","com.azure.resourcemanager.resiliencemanagement.fluent.DrillRunsClient.beginReprotect":"Microsoft.AzureResilienceManagement.DrillRuns.reprotect","com.azure.resourcemanager.resiliencemanagement.fluent.DrillRunsClient.beginResume":"Microsoft.AzureResilienceManagement.DrillRuns.resume","com.azure.resourcemanager.resiliencemanagement.fluent.DrillRunsClient.failOver":"Microsoft.AzureResilienceManagement.DrillRuns.failOver","com.azure.resourcemanager.resiliencemanagement.fluent.DrillRunsClient.get":"Microsoft.AzureResilienceManagement.DrillRuns.get","com.azure.resourcemanager.resiliencemanagement.fluent.DrillRunsClient.getWithResponse":"Microsoft.AzureResilienceManagement.DrillRuns.get","com.azure.resourcemanager.resiliencemanagement.fluent.DrillRunsClient.list":"Microsoft.AzureResilienceManagement.DrillRuns.list","com.azure.resourcemanager.resiliencemanagement.fluent.DrillRunsClient.markAsComplete":"Microsoft.AzureResilienceManagement.DrillRuns.markAsComplete","com.azure.resourcemanager.resiliencemanagement.fluent.DrillRunsClient.reprotect":"Microsoft.AzureResilienceManagement.DrillRuns.reprotect","com.azure.resourcemanager.resiliencemanagement.fluent.DrillRunsClient.resume":"Microsoft.AzureResilienceManagement.DrillRuns.resume","com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient":"Microsoft.AzureResilienceManagement.Drills","com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient.addOrUpdateResources":"Microsoft.AzureResilienceManagement.Drills.addOrUpdateResources","com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient.beginAddOrUpdateResources":"Microsoft.AzureResilienceManagement.Drills.addOrUpdateResources","com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient.beginCreate":"Microsoft.AzureResilienceManagement.Drills.create","com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient.beginDelete":"Microsoft.AzureResilienceManagement.Drills.delete","com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient.beginEnd":"Microsoft.AzureResilienceManagement.Drills.end","com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient.beginResyncReadinessCheck":"Microsoft.AzureResilienceManagement.Drills.resyncReadinessCheck","com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient.beginStart":"Microsoft.AzureResilienceManagement.Drills.start","com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient.beginUpdate":"Microsoft.AzureResilienceManagement.Drills.update","com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient.beginValidateForExecution":"Microsoft.AzureResilienceManagement.Drills.validateForExecution","com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient.create":"Microsoft.AzureResilienceManagement.Drills.create","com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient.delete":"Microsoft.AzureResilienceManagement.Drills.delete","com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient.end":"Microsoft.AzureResilienceManagement.Drills.end","com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient.get":"Microsoft.AzureResilienceManagement.Drills.get","com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient.getWithResponse":"Microsoft.AzureResilienceManagement.Drills.get","com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient.list":"Microsoft.AzureResilienceManagement.Drills.list","com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient.resyncReadinessCheck":"Microsoft.AzureResilienceManagement.Drills.resyncReadinessCheck","com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient.start":"Microsoft.AzureResilienceManagement.Drills.start","com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient.update":"Microsoft.AzureResilienceManagement.Drills.update","com.azure.resourcemanager.resiliencemanagement.fluent.DrillsClient.validateForExecution":"Microsoft.AzureResilienceManagement.Drills.validateForExecution","com.azure.resourcemanager.resiliencemanagement.fluent.EnrollmentsClient":"Microsoft.AzureResilienceManagement.Enrollments","com.azure.resourcemanager.resiliencemanagement.fluent.EnrollmentsClient.beginCreateOrUpdate":"Microsoft.AzureResilienceManagement.Enrollments.createOrUpdate","com.azure.resourcemanager.resiliencemanagement.fluent.EnrollmentsClient.beginDelete":"Microsoft.AzureResilienceManagement.Enrollments.delete","com.azure.resourcemanager.resiliencemanagement.fluent.EnrollmentsClient.createOrUpdate":"Microsoft.AzureResilienceManagement.Enrollments.createOrUpdate","com.azure.resourcemanager.resiliencemanagement.fluent.EnrollmentsClient.delete":"Microsoft.AzureResilienceManagement.Enrollments.delete","com.azure.resourcemanager.resiliencemanagement.fluent.EnrollmentsClient.get":"Microsoft.AzureResilienceManagement.Enrollments.get","com.azure.resourcemanager.resiliencemanagement.fluent.EnrollmentsClient.getWithResponse":"Microsoft.AzureResilienceManagement.Enrollments.get","com.azure.resourcemanager.resiliencemanagement.fluent.EnrollmentsClient.list":"Microsoft.AzureResilienceManagement.Enrollments.list","com.azure.resourcemanager.resiliencemanagement.fluent.GoalAssignmentsClient":"Microsoft.AzureResilienceManagement.GoalAssignments","com.azure.resourcemanager.resiliencemanagement.fluent.GoalAssignmentsClient.beginCreateOrUpdate":"Microsoft.AzureResilienceManagement.GoalAssignments.createOrUpdate","com.azure.resourcemanager.resiliencemanagement.fluent.GoalAssignmentsClient.beginDelete":"Microsoft.AzureResilienceManagement.GoalAssignments.delete","com.azure.resourcemanager.resiliencemanagement.fluent.GoalAssignmentsClient.beginRecommendCapacity":"Microsoft.AzureResilienceManagement.GoalAssignments.recommendCapacity","com.azure.resourcemanager.resiliencemanagement.fluent.GoalAssignmentsClient.beginRefreshGoalResources":"Microsoft.AzureResilienceManagement.GoalAssignments.refreshGoalResources","com.azure.resourcemanager.resiliencemanagement.fluent.GoalAssignmentsClient.beginUpdate":"Microsoft.AzureResilienceManagement.GoalAssignments.update","com.azure.resourcemanager.resiliencemanagement.fluent.GoalAssignmentsClient.beginUpdateGoalResources":"Microsoft.AzureResilienceManagement.GoalAssignments.updateGoalResources","com.azure.resourcemanager.resiliencemanagement.fluent.GoalAssignmentsClient.createOrUpdate":"Microsoft.AzureResilienceManagement.GoalAssignments.createOrUpdate","com.azure.resourcemanager.resiliencemanagement.fluent.GoalAssignmentsClient.delete":"Microsoft.AzureResilienceManagement.GoalAssignments.delete","com.azure.resourcemanager.resiliencemanagement.fluent.GoalAssignmentsClient.get":"Microsoft.AzureResilienceManagement.GoalAssignments.get","com.azure.resourcemanager.resiliencemanagement.fluent.GoalAssignmentsClient.getWithResponse":"Microsoft.AzureResilienceManagement.GoalAssignments.get","com.azure.resourcemanager.resiliencemanagement.fluent.GoalAssignmentsClient.list":"Microsoft.AzureResilienceManagement.GoalAssignments.list","com.azure.resourcemanager.resiliencemanagement.fluent.GoalAssignmentsClient.recommendCapacity":"Microsoft.AzureResilienceManagement.GoalAssignments.recommendCapacity","com.azure.resourcemanager.resiliencemanagement.fluent.GoalAssignmentsClient.refreshGoalResources":"Microsoft.AzureResilienceManagement.GoalAssignments.refreshGoalResources","com.azure.resourcemanager.resiliencemanagement.fluent.GoalAssignmentsClient.update":"Microsoft.AzureResilienceManagement.GoalAssignments.update","com.azure.resourcemanager.resiliencemanagement.fluent.GoalAssignmentsClient.updateGoalResources":"Microsoft.AzureResilienceManagement.GoalAssignments.updateGoalResources","com.azure.resourcemanager.resiliencemanagement.fluent.GoalResourcesClient":"Microsoft.AzureResilienceManagement.GoalResources","com.azure.resourcemanager.resiliencemanagement.fluent.GoalResourcesClient.get":"Microsoft.AzureResilienceManagement.GoalResources.get","com.azure.resourcemanager.resiliencemanagement.fluent.GoalResourcesClient.getWithResponse":"Microsoft.AzureResilienceManagement.GoalResources.get","com.azure.resourcemanager.resiliencemanagement.fluent.GoalResourcesClient.list":"Microsoft.AzureResilienceManagement.GoalResources.list","com.azure.resourcemanager.resiliencemanagement.fluent.GoalTemplatesClient":"Microsoft.AzureResilienceManagement.GoalTemplates","com.azure.resourcemanager.resiliencemanagement.fluent.GoalTemplatesClient.beginCreateOrUpdate":"Microsoft.AzureResilienceManagement.GoalTemplates.createOrUpdate","com.azure.resourcemanager.resiliencemanagement.fluent.GoalTemplatesClient.beginDelete":"Microsoft.AzureResilienceManagement.GoalTemplates.delete","com.azure.resourcemanager.resiliencemanagement.fluent.GoalTemplatesClient.beginUpdate":"Microsoft.AzureResilienceManagement.GoalTemplates.update","com.azure.resourcemanager.resiliencemanagement.fluent.GoalTemplatesClient.createOrUpdate":"Microsoft.AzureResilienceManagement.GoalTemplates.createOrUpdate","com.azure.resourcemanager.resiliencemanagement.fluent.GoalTemplatesClient.delete":"Microsoft.AzureResilienceManagement.GoalTemplates.delete","com.azure.resourcemanager.resiliencemanagement.fluent.GoalTemplatesClient.get":"Microsoft.AzureResilienceManagement.GoalTemplates.get","com.azure.resourcemanager.resiliencemanagement.fluent.GoalTemplatesClient.getWithResponse":"Microsoft.AzureResilienceManagement.GoalTemplates.get","com.azure.resourcemanager.resiliencemanagement.fluent.GoalTemplatesClient.list":"Microsoft.AzureResilienceManagement.GoalTemplates.list","com.azure.resourcemanager.resiliencemanagement.fluent.GoalTemplatesClient.update":"Microsoft.AzureResilienceManagement.GoalTemplates.update","com.azure.resourcemanager.resiliencemanagement.fluent.OperationStatusClient":"Microsoft.AzureResilienceManagement.OperationStatus","com.azure.resourcemanager.resiliencemanagement.fluent.OperationStatusClient.get":"Microsoft.AzureResilienceManagement.OperationStatus.get","com.azure.resourcemanager.resiliencemanagement.fluent.OperationStatusClient.getWithResponse":"Microsoft.AzureResilienceManagement.OperationStatus.get","com.azure.resourcemanager.resiliencemanagement.fluent.OperationsClient":"Microsoft.AzureResilienceManagement.Operations","com.azure.resourcemanager.resiliencemanagement.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryJobResourcesClient":"Microsoft.AzureResilienceManagement.RecoveryJobResources","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryJobResourcesClient.get":"Microsoft.AzureResilienceManagement.RecoveryJobResources.get","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryJobResourcesClient.getWithResponse":"Microsoft.AzureResilienceManagement.RecoveryJobResources.get","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryJobResourcesClient.list":"Microsoft.AzureResilienceManagement.RecoveryJobResources.list","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryJobsClient":"Microsoft.AzureResilienceManagement.RecoveryJobs","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryJobsClient.beginCancel":"Microsoft.AzureResilienceManagement.RecoveryJobs.cancel","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryJobsClient.beginResume":"Microsoft.AzureResilienceManagement.RecoveryJobs.resume","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryJobsClient.beginRetry":"Microsoft.AzureResilienceManagement.RecoveryJobs.retry","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryJobsClient.cancel":"Microsoft.AzureResilienceManagement.RecoveryJobs.cancel","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryJobsClient.get":"Microsoft.AzureResilienceManagement.RecoveryJobs.get","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryJobsClient.getWithResponse":"Microsoft.AzureResilienceManagement.RecoveryJobs.get","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryJobsClient.list":"Microsoft.AzureResilienceManagement.RecoveryJobs.list","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryJobsClient.resume":"Microsoft.AzureResilienceManagement.RecoveryJobs.resume","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryJobsClient.retry":"Microsoft.AzureResilienceManagement.RecoveryJobs.retry","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient":"Microsoft.AzureResilienceManagement.RecoveryPlanActions","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.beginCheckReadiness":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.checkReadiness","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.beginFailover":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.failover","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.beginFailoverCommit":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.failoverCommit","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.beginFinalize":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.finalize","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.beginReprotect":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.reprotect","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.beginTestFailover":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.testFailover","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.beginTestFailoverCleanup":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.testFailoverCleanup","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.beginUpdateResources":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.updateResources","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.beginValidateForFailover":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.validateForFailover","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.beginValidateForFailoverCommit":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.validateForFailoverCommit","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.beginValidateForOperation":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.validateForOperation","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.beginValidateForReprotect":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.validateForReprotect","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.beginValidateForTestFailover":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.validateForTestFailover","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.beginValidateForTestFailoverCleanup":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.validateForTestFailoverCleanup","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.checkReadiness":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.checkReadiness","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.failover":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.failover","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.failoverCommit":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.failoverCommit","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.finalize":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.finalize","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.reprotect":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.reprotect","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.testFailover":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.testFailover","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.testFailoverCleanup":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.testFailoverCleanup","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.updateResources":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.updateResources","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.validateForFailover":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.validateForFailover","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.validateForFailoverCommit":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.validateForFailoverCommit","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.validateForOperation":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.validateForOperation","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.validateForReprotect":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.validateForReprotect","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.validateForTestFailover":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.validateForTestFailover","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlanActionsClient.validateForTestFailoverCleanup":"Microsoft.AzureResilienceManagement.RecoveryPlanActions.validateForTestFailoverCleanup","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlansClient":"Microsoft.AzureResilienceManagement.RecoveryPlans","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlansClient.beginCreateOrUpdate":"Microsoft.AzureResilienceManagement.RecoveryPlans.createOrUpdate","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlansClient.beginDelete":"Microsoft.AzureResilienceManagement.RecoveryPlans.delete","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlansClient.beginUpdate":"Microsoft.AzureResilienceManagement.RecoveryPlans.update","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlansClient.createOrUpdate":"Microsoft.AzureResilienceManagement.RecoveryPlans.createOrUpdate","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlansClient.delete":"Microsoft.AzureResilienceManagement.RecoveryPlans.delete","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlansClient.get":"Microsoft.AzureResilienceManagement.RecoveryPlans.get","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlansClient.getWithResponse":"Microsoft.AzureResilienceManagement.RecoveryPlans.get","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlansClient.list":"Microsoft.AzureResilienceManagement.RecoveryPlans.list","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryPlansClient.update":"Microsoft.AzureResilienceManagement.RecoveryPlans.update","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryResourcesClient":"Microsoft.AzureResilienceManagement.RecoveryResources","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryResourcesClient.get":"Microsoft.AzureResilienceManagement.RecoveryResources.get","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryResourcesClient.getWithResponse":"Microsoft.AzureResilienceManagement.RecoveryResources.get","com.azure.resourcemanager.resiliencemanagement.fluent.RecoveryResourcesClient.list":"Microsoft.AzureResilienceManagement.RecoveryResources.list","com.azure.resourcemanager.resiliencemanagement.fluent.ResilienceManagementManagementClient":"Microsoft.AzureResilienceManagement","com.azure.resourcemanager.resiliencemanagement.fluent.UnifiedResilienceItemsClient":"Microsoft.AzureResilienceManagement.UnifiedResilienceItems","com.azure.resourcemanager.resiliencemanagement.fluent.UnifiedResilienceItemsClient.get":"Microsoft.AzureResilienceManagement.UnifiedResilienceItems.get","com.azure.resourcemanager.resiliencemanagement.fluent.UnifiedResilienceItemsClient.getWithResponse":"Microsoft.AzureResilienceManagement.UnifiedResilienceItems.get","com.azure.resourcemanager.resiliencemanagement.fluent.UnifiedResilienceItemsClient.list":"Microsoft.AzureResilienceManagement.UnifiedResilienceItems.list","com.azure.resourcemanager.resiliencemanagement.fluent.UsagePlansClient":"Microsoft.AzureResilienceManagement.UsagePlans","com.azure.resourcemanager.resiliencemanagement.fluent.UsagePlansClient.beginCreateOrUpdate":"Microsoft.AzureResilienceManagement.UsagePlans.createOrUpdate","com.azure.resourcemanager.resiliencemanagement.fluent.UsagePlansClient.beginDelete":"Microsoft.AzureResilienceManagement.UsagePlans.delete","com.azure.resourcemanager.resiliencemanagement.fluent.UsagePlansClient.beginUpdate":"Microsoft.AzureResilienceManagement.UsagePlans.update","com.azure.resourcemanager.resiliencemanagement.fluent.UsagePlansClient.createOrUpdate":"Microsoft.AzureResilienceManagement.UsagePlans.createOrUpdate","com.azure.resourcemanager.resiliencemanagement.fluent.UsagePlansClient.delete":"Microsoft.AzureResilienceManagement.UsagePlans.delete","com.azure.resourcemanager.resiliencemanagement.fluent.UsagePlansClient.getByResourceGroup":"Microsoft.AzureResilienceManagement.UsagePlans.get","com.azure.resourcemanager.resiliencemanagement.fluent.UsagePlansClient.getByResourceGroupWithResponse":"Microsoft.AzureResilienceManagement.UsagePlans.get","com.azure.resourcemanager.resiliencemanagement.fluent.UsagePlansClient.list":"Microsoft.AzureResilienceManagement.UsagePlans.listBySubscription","com.azure.resourcemanager.resiliencemanagement.fluent.UsagePlansClient.listByResourceGroup":"Microsoft.AzureResilienceManagement.UsagePlans.listByResourceGroup","com.azure.resourcemanager.resiliencemanagement.fluent.UsagePlansClient.update":"Microsoft.AzureResilienceManagement.UsagePlans.update","com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillInner":"Microsoft.AzureResilienceManagement.Drill","com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillResourceInner":"Microsoft.AzureResilienceManagement.DrillResource","com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillRunInner":"Microsoft.AzureResilienceManagement.DrillRun","com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillRunResourceInner":"Microsoft.AzureResilienceManagement.DrillRunResource","com.azure.resourcemanager.resiliencemanagement.fluent.models.EnrollmentInner":"Microsoft.AzureResilienceManagement.Enrollment","com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalAssignmentInner":"Microsoft.AzureResilienceManagement.GoalAssignment","com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalResourceInner":"Microsoft.AzureResilienceManagement.GoalResource","com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalTemplateInner":"Microsoft.AzureResilienceManagement.GoalTemplate","com.azure.resourcemanager.resiliencemanagement.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.resiliencemanagement.fluent.models.OperationStatusResultInner":"Azure.ResourceManager.CommonTypes.OperationStatusResult","com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryJobInner":"Microsoft.AzureResilienceManagement.RecoveryJob","com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryJobResourceInner":"Microsoft.AzureResilienceManagement.RecoveryJobResource","com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryPlanActionBaseResponseInner":"Microsoft.AzureResilienceManagement.RecoveryPlanActionBaseResponse","com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryPlanInner":"Microsoft.AzureResilienceManagement.RecoveryPlan","com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryResourceInner":"Microsoft.AzureResilienceManagement.RecoveryResource","com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryResourceQualificationInner":"Microsoft.AzureResilienceManagement.RecoveryResourceQualification","com.azure.resourcemanager.resiliencemanagement.fluent.models.UnifiedResilienceItemInner":"Microsoft.AzureResilienceManagement.UnifiedResilienceItem","com.azure.resourcemanager.resiliencemanagement.fluent.models.UpdateRecoveryResourcesResponseInner":"Microsoft.AzureResilienceManagement.UpdateRecoveryResourcesResponse","com.azure.resourcemanager.resiliencemanagement.fluent.models.UsagePlanInner":"Microsoft.AzureResilienceManagement.UsagePlan","com.azure.resourcemanager.resiliencemanagement.fluent.models.ValidateForRecoveryOperationBaseResponseInner":"Microsoft.AzureResilienceManagement.ValidateForRecoveryOperationBaseResponse","com.azure.resourcemanager.resiliencemanagement.implementation.ResilienceManagementManagementClientBuilder":"Microsoft.AzureResilienceManagement","com.azure.resourcemanager.resiliencemanagement.implementation.models.DrillListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.resiliencemanagement.implementation.models.DrillResourceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.resiliencemanagement.implementation.models.DrillRunListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.resiliencemanagement.implementation.models.DrillRunResourceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.resiliencemanagement.implementation.models.EnrollmentListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.resiliencemanagement.implementation.models.GoalAssignmentListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.resiliencemanagement.implementation.models.GoalResourceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.resiliencemanagement.implementation.models.GoalTemplateListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.resiliencemanagement.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.resiliencemanagement.implementation.models.RecoveryJobListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.resiliencemanagement.implementation.models.RecoveryJobResourceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.resiliencemanagement.implementation.models.RecoveryPlanListResult":"Microsoft.AzureResilienceManagement.RecoveryPlanListResult","com.azure.resourcemanager.resiliencemanagement.implementation.models.RecoveryResourceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.resiliencemanagement.implementation.models.UnifiedResilienceItemListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.resiliencemanagement.implementation.models.UsagePlanListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.resiliencemanagement.models.ActionTask":"Microsoft.AzureResilienceManagement.ActionTask","com.azure.resourcemanager.resiliencemanagement.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.resiliencemanagement.models.AddOrUpdateResourcesRequest":"Microsoft.AzureResilienceManagement.AddOrUpdateResourcesRequest","com.azure.resourcemanager.resiliencemanagement.models.ArmResponseErrorResponse":"Azure.ResourceManager.ArmResponse","com.azure.resourcemanager.resiliencemanagement.models.AssetPropertiesOfDrill":"Microsoft.AzureResilienceManagement.AssetPropertiesOfDrill","com.azure.resourcemanager.resiliencemanagement.models.AssociatedIdentity":"Microsoft.AzureResilienceManagement.AssociatedIdentity","com.azure.resourcemanager.resiliencemanagement.models.AttentionReason":"Microsoft.AzureResilienceManagement.AttentionReason","com.azure.resourcemanager.resiliencemanagement.models.AttestationState":"Microsoft.AzureResilienceManagement.AttestationState","com.azure.resourcemanager.resiliencemanagement.models.AutoFailover":"Microsoft.AzureResilienceManagement.AutoFailover","com.azure.resourcemanager.resiliencemanagement.models.ChaosResourcePropertiesOfDrill":"Microsoft.AzureResilienceManagement.ChaosResourcePropertiesOfDrill","com.azure.resourcemanager.resiliencemanagement.models.CommentType":"Microsoft.AzureResilienceManagement.CommentType","com.azure.resourcemanager.resiliencemanagement.models.ConfirmationStatus":"Microsoft.AzureResilienceManagement.ConfirmationStatus","com.azure.resourcemanager.resiliencemanagement.models.CustomFaultDetails":"Microsoft.AzureResilienceManagement.CustomFaultDetails","com.azure.resourcemanager.resiliencemanagement.models.DiskReprotectInputDetails":"Microsoft.AzureResilienceManagement.DiskReprotectInputDetails","com.azure.resourcemanager.resiliencemanagement.models.DrillAttestation":"Microsoft.AzureResilienceManagement.DrillAttestation","com.azure.resourcemanager.resiliencemanagement.models.DrillEndRequest":"Microsoft.AzureResilienceManagement.DrillEndRequest","com.azure.resourcemanager.resiliencemanagement.models.DrillMode":"Microsoft.AzureResilienceManagement.DrillMode","com.azure.resourcemanager.resiliencemanagement.models.DrillProperties":"Microsoft.AzureResilienceManagement.DrillProperties","com.azure.resourcemanager.resiliencemanagement.models.DrillResourceAttentionReason":"Microsoft.AzureResilienceManagement.DrillResourceAttentionReason","com.azure.resourcemanager.resiliencemanagement.models.DrillResourceFaultState":"Microsoft.AzureResilienceManagement.DrillResourceFaultState","com.azure.resourcemanager.resiliencemanagement.models.DrillResourceInclusionState":"Microsoft.AzureResilienceManagement.DrillResourceInclusionState","com.azure.resourcemanager.resiliencemanagement.models.DrillResourceProperties":"Microsoft.AzureResilienceManagement.DrillResourceProperties","com.azure.resourcemanager.resiliencemanagement.models.DrillResourceReadinessState":"Microsoft.AzureResilienceManagement.DrillResourceReadinessState","com.azure.resourcemanager.resiliencemanagement.models.DrillResourceState":"Microsoft.AzureResilienceManagement.DrillResourceState","com.azure.resourcemanager.resiliencemanagement.models.DrillRunAddNotesRequest":"Microsoft.AzureResilienceManagement.DrillRunAddNotesRequest","com.azure.resourcemanager.resiliencemanagement.models.DrillRunFailoverRequest":"Microsoft.AzureResilienceManagement.DrillRunFailoverRequest","com.azure.resourcemanager.resiliencemanagement.models.DrillRunOperationVerbs":"Microsoft.AzureResilienceManagement.DrillRunOperationVerbs","com.azure.resourcemanager.resiliencemanagement.models.DrillRunProperties":"Microsoft.AzureResilienceManagement.DrillRunProperties","com.azure.resourcemanager.resiliencemanagement.models.DrillRunResourceProperties":"Microsoft.AzureResilienceManagement.DrillRunResourceProperties","com.azure.resourcemanager.resiliencemanagement.models.DrillRunSubtasks":"Microsoft.AzureResilienceManagement.DrillRunSubtasks","com.azure.resourcemanager.resiliencemanagement.models.DrillStartRequest":"Microsoft.AzureResilienceManagement.DrillStartRequest","com.azure.resourcemanager.resiliencemanagement.models.DrillType":"Microsoft.AzureResilienceManagement.DrillType","com.azure.resourcemanager.resiliencemanagement.models.DrillUpdate":"Azure.ResourceManager.Foundations.ResourceUpdateModel","com.azure.resourcemanager.resiliencemanagement.models.DrillUpdateProperties":"Azure.ResourceManager.Foundations.ResourceUpdateModelProperties","com.azure.resourcemanager.resiliencemanagement.models.EnrollmentProperties":"Microsoft.AzureResilienceManagement.EnrollmentProperties","com.azure.resourcemanager.resiliencemanagement.models.ErrorDetails":"Microsoft.AzureResilienceManagement.ErrorDetails","com.azure.resourcemanager.resiliencemanagement.models.ExclusionReason":"Microsoft.AzureResilienceManagement.ExclusionReason","com.azure.resourcemanager.resiliencemanagement.models.ExclusionState":"Microsoft.AzureResilienceManagement.ExclusionState","com.azure.resourcemanager.resiliencemanagement.models.ExecutionConfigurations":"Microsoft.AzureResilienceManagement.ExecutionConfigurations","com.azure.resourcemanager.resiliencemanagement.models.ExecutionReadinessState":"Microsoft.AzureResilienceManagement.ExecutionReadinessState","com.azure.resourcemanager.resiliencemanagement.models.ExecutionState":"Microsoft.AzureResilienceManagement.ExecutionState","com.azure.resourcemanager.resiliencemanagement.models.ExtensionObjectState":"Microsoft.AzureResilienceManagement.ExtensionObjectState","com.azure.resourcemanager.resiliencemanagement.models.FailoverDirectionTypes":"Microsoft.AzureResilienceManagement.FailoverDirectionTypes","com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest":"Microsoft.AzureResilienceManagement.FailoverRequest","com.azure.resourcemanager.resiliencemanagement.models.FailoverRequestProperties":"Microsoft.AzureResilienceManagement.FailoverRequestProperties","com.azure.resourcemanager.resiliencemanagement.models.FailoverState":"Microsoft.AzureResilienceManagement.FailoverState","com.azure.resourcemanager.resiliencemanagement.models.FaultDetails":"Microsoft.AzureResilienceManagement.FaultDetails","com.azure.resourcemanager.resiliencemanagement.models.FaultProperties":"Microsoft.AzureResilienceManagement.FaultProperties","com.azure.resourcemanager.resiliencemanagement.models.ForceInclusionAndUpdate":"Microsoft.AzureResilienceManagement.ForceInclusionAndUpdate","com.azure.resourcemanager.resiliencemanagement.models.GoalAssignmentProperties":"Microsoft.AzureResilienceManagement.GoalAssignmentProperties","com.azure.resourcemanager.resiliencemanagement.models.GoalAssignmentType":"Microsoft.AzureResilienceManagement.GoalAssignmentType","com.azure.resourcemanager.resiliencemanagement.models.GoalResourceProperties":"Microsoft.AzureResilienceManagement.GoalResourceProperties","com.azure.resourcemanager.resiliencemanagement.models.GoalTemplateProperties":"Microsoft.AzureResilienceManagement.GoalTemplateProperties","com.azure.resourcemanager.resiliencemanagement.models.GoalType":"Microsoft.AzureResilienceManagement.GoalType","com.azure.resourcemanager.resiliencemanagement.models.GoalsData":"Microsoft.AzureResilienceManagement.GoalsData","com.azure.resourcemanager.resiliencemanagement.models.HAStatus":"Microsoft.AzureResilienceManagement.HAStatus","com.azure.resourcemanager.resiliencemanagement.models.IncludeOrUpdateResource":"Microsoft.AzureResilienceManagement.IncludeOrUpdateResource","com.azure.resourcemanager.resiliencemanagement.models.InitialConfig":"Microsoft.AzureResilienceManagement.InitialConfig","com.azure.resourcemanager.resiliencemanagement.models.IsoDuration":"Microsoft.AzureResilienceManagement.IsoDuration","com.azure.resourcemanager.resiliencemanagement.models.JobErrorInfo":"Microsoft.AzureResilienceManagement.JobErrorInfo","com.azure.resourcemanager.resiliencemanagement.models.JobExtendedInfo":"Microsoft.AzureResilienceManagement.JobExtendedInfo","com.azure.resourcemanager.resiliencemanagement.models.JobProperties":"Microsoft.AzureResilienceManagement.JobProperties","com.azure.resourcemanager.resiliencemanagement.models.JobResourceProperties":"Microsoft.AzureResilienceManagement.JobResourceProperties","com.azure.resourcemanager.resiliencemanagement.models.JobResourceType":"Microsoft.AzureResilienceManagement.JobResourceType","com.azure.resourcemanager.resiliencemanagement.models.JobRetryDetails":"Microsoft.AzureResilienceManagement.JobRetryDetails","com.azure.resourcemanager.resiliencemanagement.models.JobStatus":"Microsoft.AzureResilienceManagement.JobStatus","com.azure.resourcemanager.resiliencemanagement.models.JobTaskDetail":"Microsoft.AzureResilienceManagement.JobTaskDetail","com.azure.resourcemanager.resiliencemanagement.models.JobTriggeredBy":"Microsoft.AzureResilienceManagement.JobTriggeredBy","com.azure.resourcemanager.resiliencemanagement.models.JobType":"Microsoft.AzureResilienceManagement.JobType","com.azure.resourcemanager.resiliencemanagement.models.JobUserComment":"Microsoft.AzureResilienceManagement.JobUserComment","com.azure.resourcemanager.resiliencemanagement.models.LastRunProperties":"Microsoft.AzureResilienceManagement.LastRunProperties","com.azure.resourcemanager.resiliencemanagement.models.ManagedOnBehalfOfConfiguration":"Microsoft.AzureResilienceManagement.ManagedOnBehalfOfConfiguration","com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentity":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentity","com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType","com.azure.resourcemanager.resiliencemanagement.models.MarkAsCompleteRequest":"Microsoft.AzureResilienceManagement.MarkAsCompleteRequest","com.azure.resourcemanager.resiliencemanagement.models.MembershipType":"Microsoft.AzureResilienceManagement.MembershipType","com.azure.resourcemanager.resiliencemanagement.models.MoboBrokerResource":"Microsoft.AzureResilienceManagement.MoboBrokerResource","com.azure.resourcemanager.resiliencemanagement.models.MonitoringPropertiesOfDrill":"Microsoft.AzureResilienceManagement.MonitoringPropertiesOfDrill","com.azure.resourcemanager.resiliencemanagement.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.resiliencemanagement.models.OperationQualificationDetails":"Microsoft.AzureResilienceManagement.OperationQualificationDetails","com.azure.resourcemanager.resiliencemanagement.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.resiliencemanagement.models.ProvisioningState":"Microsoft.AzureResilienceManagement.ProvisioningState","com.azure.resourcemanager.resiliencemanagement.models.QualificationState":"Microsoft.AzureResilienceManagement.QualificationState","com.azure.resourcemanager.resiliencemanagement.models.RBACSetupMode":"Microsoft.AzureResilienceManagement.RBACSetupMode","com.azure.resourcemanager.resiliencemanagement.models.RBACState":"Microsoft.AzureResilienceManagement.RBACState","com.azure.resourcemanager.resiliencemanagement.models.ReasonForRequestingConfirmation":"Microsoft.AzureResilienceManagement.ReasonForRequestingConfirmation","com.azure.resourcemanager.resiliencemanagement.models.RecommendCapacityRequest":"Microsoft.AzureResilienceManagement.RecommendCapacityRequest","com.azure.resourcemanager.resiliencemanagement.models.RecommendationsData":"Microsoft.AzureResilienceManagement.RecommendationsData","com.azure.resourcemanager.resiliencemanagement.models.RecommendationsHighAvailabilityData":"Microsoft.AzureResilienceManagement.RecommendationsHighAvailabilityData","com.azure.resourcemanager.resiliencemanagement.models.RecoveryActionRequest":"Microsoft.AzureResilienceManagement.RecoveryActionRequest","com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroup":"Microsoft.AzureResilienceManagement.RecoveryGroup","com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupActionSettings":"Microsoft.AzureResilienceManagement.RecoveryGroupActionSettings","com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupActionType":"Microsoft.AzureResilienceManagement.RecoveryGroupActionType","com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupBaseAction":"Microsoft.AzureResilienceManagement.RecoveryGroupBaseAction","com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupCustomRunbookAction":"Microsoft.AzureResilienceManagement.RecoveryGroupCustomRunbookAction","com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupManualAction":"Microsoft.AzureResilienceManagement.RecoveryGroupManualAction","com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupProperties":"Microsoft.AzureResilienceManagement.RecoveryGroupProperties","com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupsSetting":"Microsoft.AzureResilienceManagement.RecoveryGroupsSetting","com.azure.resourcemanager.resiliencemanagement.models.RecoveryJobProperties":"Microsoft.AzureResilienceManagement.RecoveryJobProperties","com.azure.resourcemanager.resiliencemanagement.models.RecoveryJobResourceProperties":"Microsoft.AzureResilienceManagement.RecoveryJobResourceProperties","com.azure.resourcemanager.resiliencemanagement.models.RecoveryOperationNames":"Microsoft.AzureResilienceManagement.RecoveryOperationNames","com.azure.resourcemanager.resiliencemanagement.models.RecoveryOperationStatus":"Microsoft.AzureResilienceManagement.RecoveryOperationStatus","com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanExclusionReason":"Microsoft.AzureResilienceManagement.RecoveryPlanExclusionReason","com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanFailoverOperationStatus":"Microsoft.AzureResilienceManagement.RecoveryPlanFailoverOperationStatus","com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanOperationStatus":"Microsoft.AzureResilienceManagement.RecoveryPlanOperationStatus","com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanProperties":"Microsoft.AzureResilienceManagement.RecoveryPlanProperties","com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanPropertiesOfDrill":"Microsoft.AzureResilienceManagement.RecoveryPlanPropertiesOfDrill","com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanState":"Microsoft.AzureResilienceManagement.RecoveryPlanState","com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanType":"Microsoft.AzureResilienceManagement.RecoveryPlanType","com.azure.resourcemanager.resiliencemanagement.models.RecoveryResourceProperties":"Microsoft.AzureResilienceManagement.RecoveryResourceProperties","com.azure.resourcemanager.resiliencemanagement.models.RegionalDrillProperties":"Microsoft.AzureResilienceManagement.RegionalDrillProperties","com.azure.resourcemanager.resiliencemanagement.models.RelativeResourceCompositionState":"Microsoft.AzureResilienceManagement.RelativeResourceCompositionState","com.azure.resourcemanager.resiliencemanagement.models.ReprotectRequest":"Microsoft.AzureResilienceManagement.ReprotectRequest","com.azure.resourcemanager.resiliencemanagement.models.ReprotectRequestProperties":"Microsoft.AzureResilienceManagement.ReprotectRequestProperties","com.azure.resourcemanager.resiliencemanagement.models.RequirementSelected":"Microsoft.AzureResilienceManagement.RequirementSelected","com.azure.resourcemanager.resiliencemanagement.models.ResilienceHealthStatus":"Microsoft.AzureResilienceManagement.ResilienceHealthStatus","com.azure.resourcemanager.resiliencemanagement.models.ResourceBaseProtectionSolutionSetting":"Microsoft.AzureResilienceManagement.ResourceBaseProtectionSolutionSetting","com.azure.resourcemanager.resiliencemanagement.models.ResourceCustomProtectionAction":"Microsoft.AzureResilienceManagement.ResourceCustomProtectionAction","com.azure.resourcemanager.resiliencemanagement.models.ResourceCustomProtectionSetting":"Microsoft.AzureResilienceManagement.ResourceCustomProtectionSetting","com.azure.resourcemanager.resiliencemanagement.models.ResourceInclusionState":"Microsoft.AzureResilienceManagement.ResourceInclusionState","com.azure.resourcemanager.resiliencemanagement.models.ResourceLists":"Microsoft.AzureResilienceManagement.ResourceLists","com.azure.resourcemanager.resiliencemanagement.models.ResourceNativeProtectionSolutionSetting":"Microsoft.AzureResilienceManagement.ResourceNativeProtectionSolutionSetting","com.azure.resourcemanager.resiliencemanagement.models.ResourceProtectionSolutionSettings":"Microsoft.AzureResilienceManagement.ResourceProtectionSolutionSettings","com.azure.resourcemanager.resiliencemanagement.models.ResourceProtectionSolutionType":"Microsoft.AzureResilienceManagement.ResourceProtectionSolutionType","com.azure.resourcemanager.resiliencemanagement.models.ResourceProtectionStatus":"Microsoft.AzureResilienceManagement.ResourceProtectionStatus","com.azure.resourcemanager.resiliencemanagement.models.ResourceReplicationRole":"Microsoft.AzureResilienceManagement.ResourceReplicationRole","com.azure.resourcemanager.resiliencemanagement.models.ResourceSiteRecoveryProtectionSetting":"Microsoft.AzureResilienceManagement.ResourceSiteRecoveryProtectionSetting","com.azure.resourcemanager.resiliencemanagement.models.ResourceSiteRecoveryReprotectParams":"Microsoft.AzureResilienceManagement.ResourceSiteRecoveryReprotectParams","com.azure.resourcemanager.resiliencemanagement.models.ResourceSiteRecoveryTestFailoverCleanupParams":"Microsoft.AzureResilienceManagement.ResourceSiteRecoveryTestFailoverCleanupParams","com.azure.resourcemanager.resiliencemanagement.models.ResourceSiteRecoveryTestFailoverParams":"Microsoft.AzureResilienceManagement.ResourceSiteRecoveryTestFailoverParams","com.azure.resourcemanager.resiliencemanagement.models.ResourceTypeCategories":"Microsoft.AzureResilienceManagement.ResourceTypeCategories","com.azure.resourcemanager.resiliencemanagement.models.ServiceGroupMembership":"Microsoft.AzureResilienceManagement.ServiceGroupMembership","com.azure.resourcemanager.resiliencemanagement.models.ServiceLevelResource":"Microsoft.AzureResilienceManagement.ServiceLevelResource","com.azure.resourcemanager.resiliencemanagement.models.SolutionDisplayName":"Microsoft.AzureResilienceManagement.SolutionDisplayName","com.azure.resourcemanager.resiliencemanagement.models.SupportedVerbsForStage":"Microsoft.AzureResilienceManagement.SupportedVerbsForStage","com.azure.resourcemanager.resiliencemanagement.models.SystemMetadata":"Microsoft.AzureResilienceManagement.SystemMetadata","com.azure.resourcemanager.resiliencemanagement.models.TestFailoverCleanupRequest":"Microsoft.AzureResilienceManagement.TestFailoverCleanupRequest","com.azure.resourcemanager.resiliencemanagement.models.TestFailoverState":"Microsoft.AzureResilienceManagement.TestFailoverState","com.azure.resourcemanager.resiliencemanagement.models.UnifiedResilienceItemProperties":"Microsoft.AzureResilienceManagement.UnifiedResilienceItemProperties","com.azure.resourcemanager.resiliencemanagement.models.UnifiedResilienceItemRequirementSelected":"Microsoft.AzureResilienceManagement.UnifiedResilienceItemRequirementSelected","com.azure.resourcemanager.resiliencemanagement.models.UpdateGoalResourceRequest":"Microsoft.AzureResilienceManagement.UpdateGoalResourceRequest","com.azure.resourcemanager.resiliencemanagement.models.UpdateRecoveryResourcesRequest":"Microsoft.AzureResilienceManagement.UpdateRecoveryResourcesRequest","com.azure.resourcemanager.resiliencemanagement.models.UsagePlanProperties":"Microsoft.AzureResilienceManagement.UsagePlanProperties","com.azure.resourcemanager.resiliencemanagement.models.UsagePlanTagsUpdate":"Azure.ResourceManager.Foundations.TagsUpdateModel","com.azure.resourcemanager.resiliencemanagement.models.UsagePlanType":"Microsoft.AzureResilienceManagement.UsagePlanType","com.azure.resourcemanager.resiliencemanagement.models.UserAssignedIdentity":"Azure.ResourceManager.CommonTypes.UserAssignedIdentity","com.azure.resourcemanager.resiliencemanagement.models.UserConfirmationForHighAvailabilityItem":"Microsoft.AzureResilienceManagement.UserConfirmationForHighAvailabilityItem","com.azure.resourcemanager.resiliencemanagement.models.UserConsent":"Microsoft.AzureResilienceManagement.UserConsent","com.azure.resourcemanager.resiliencemanagement.models.VMPresent":"Microsoft.AzureResilienceManagement.VMPresent","com.azure.resourcemanager.resiliencemanagement.models.ValidateForExecutionProperties":"Microsoft.AzureResilienceManagement.ValidateForExecutionProperties","com.azure.resourcemanager.resiliencemanagement.models.ValidateForExecutionRequest":"Microsoft.AzureResilienceManagement.ValidateForExecutionRequest","com.azure.resourcemanager.resiliencemanagement.models.ValidateForOperationRequest":"Microsoft.AzureResilienceManagement.ValidateForOperationRequest","com.azure.resourcemanager.resiliencemanagement.models.ZonalDrillProperties":"Microsoft.AzureResilienceManagement.ZonalDrillProperties"},"generatedFiles":["src/main/java/com/azure/resourcemanager/resiliencemanagement/ResilienceManagementManager.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/DrillResourcesClient.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/DrillRunResourcesClient.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/DrillRunsClient.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/DrillsClient.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/EnrollmentsClient.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/GoalAssignmentsClient.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/GoalResourcesClient.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/GoalTemplatesClient.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/OperationStatusClient.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryJobResourcesClient.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryJobsClient.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryPlanActionsClient.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryPlansClient.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/RecoveryResourcesClient.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/ResilienceManagementManagementClient.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/UnifiedResilienceItemsClient.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/UsagePlansClient.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/DrillInner.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/DrillResourceInner.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/DrillRunInner.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/DrillRunResourceInner.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/EnrollmentInner.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/GoalAssignmentInner.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/GoalResourceInner.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/GoalTemplateInner.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/OperationStatusResultInner.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryJobInner.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryJobResourceInner.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryPlanActionBaseResponseInner.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryPlanInner.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryResourceInner.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/RecoveryResourceQualificationInner.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/UnifiedResilienceItemInner.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/UpdateRecoveryResourcesResponseInner.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/UsagePlanInner.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/ValidateForRecoveryOperationBaseResponseInner.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/fluent/package-info.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillResourceImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillResourcesImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunResourceImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunResourcesImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunsClientImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillRunsImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillsClientImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/DrillsImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/EnrollmentImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/EnrollmentsClientImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/EnrollmentsImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalAssignmentImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalAssignmentsClientImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalAssignmentsImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalResourceImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalResourcesImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalTemplateImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalTemplatesClientImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/GoalTemplatesImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationStatusClientImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationStatusImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationStatusResultImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobResourceImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobResourcesImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobsClientImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryJobsImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlanActionBaseResponseImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlanActionsClientImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlanActionsImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlanImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlansClientImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryPlansImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryResourceImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryResourceQualificationImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/RecoveryResourcesImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/ResilienceManagementManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/ResilienceManagementManagementClientImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UnifiedResilienceItemImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UnifiedResilienceItemsClientImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UnifiedResilienceItemsImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UpdateRecoveryResourcesResponseImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UsagePlanImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UsagePlansClientImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/UsagePlansImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/ValidateForRecoveryOperationBaseResponseImpl.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/DrillListResult.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/DrillResourceListResult.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/DrillRunListResult.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/DrillRunResourceListResult.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/EnrollmentListResult.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/GoalAssignmentListResult.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/GoalResourceListResult.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/GoalTemplateListResult.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/RecoveryJobListResult.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/RecoveryJobResourceListResult.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/RecoveryPlanListResult.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/RecoveryResourceListResult.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/UnifiedResilienceItemListResult.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/models/UsagePlanListResult.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/implementation/package-info.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ActionTask.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ActionType.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AddOrUpdateResourcesRequest.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ArmResponseErrorResponse.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AssetPropertiesOfDrill.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AssociatedIdentity.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AttentionReason.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AttestationState.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/AutoFailover.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ChaosResourcePropertiesOfDrill.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/CommentType.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ConfirmationStatus.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/CustomFaultDetails.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DiskReprotectInputDetails.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Drill.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillAttestation.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillEndRequest.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillMode.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResource.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceAttentionReason.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceFaultState.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceInclusionState.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceReadinessState.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResourceState.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillResources.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRun.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunAddNotesRequest.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunFailoverRequest.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunOperationVerbs.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunResource.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunResourceProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunResources.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRunSubtasks.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillRuns.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillStartRequest.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillType.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillUpdate.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/DrillUpdateProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Drills.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Enrollment.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/EnrollmentProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Enrollments.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ErrorDetails.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExclusionReason.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExclusionState.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExecutionConfigurations.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExecutionReadinessState.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExecutionState.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ExtensionObjectState.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FailoverDirectionTypes.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FailoverRequest.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FailoverRequestProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FailoverState.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FaultDetails.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/FaultProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ForceInclusionAndUpdate.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalAssignment.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalAssignmentProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalAssignmentType.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalAssignments.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalResource.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalResourceProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalResources.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalTemplate.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalTemplateProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalTemplates.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalType.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/GoalsData.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/HAStatus.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/IncludeOrUpdateResource.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/InitialConfig.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/IsoDuration.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobErrorInfo.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobExtendedInfo.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobResourceProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobResourceType.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobRetryDetails.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobStatus.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobTaskDetail.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobTriggeredBy.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobType.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/JobUserComment.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/LastRunProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ManagedOnBehalfOfConfiguration.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ManagedServiceIdentityType.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/MarkAsCompleteRequest.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/MembershipType.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/MoboBrokerResource.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/MonitoringPropertiesOfDrill.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Operation.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/OperationQualificationDetails.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/OperationStatus.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/OperationStatusResult.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Operations.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/Origin.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/QualificationState.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RBACSetupMode.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RBACState.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ReasonForRequestingConfirmation.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecommendCapacityRequest.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecommendationsData.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecommendationsHighAvailabilityData.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryActionRequest.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroup.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupActionSettings.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupActionType.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupBaseAction.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupCustomRunbookAction.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupManualAction.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryGroupsSetting.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJob.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobResource.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobResourceProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobResources.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryJobs.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryOperationNames.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryOperationStatus.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlan.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanActionBaseResponse.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanActions.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanExclusionReason.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanFailoverOperationStatus.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanOperationStatus.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanPropertiesOfDrill.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanState.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlanType.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryPlans.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryResource.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryResourceProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryResourceQualification.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RecoveryResources.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RegionalDrillProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RelativeResourceCompositionState.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ReprotectRequest.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ReprotectRequestProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/RequirementSelected.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResilienceHealthStatus.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceBaseProtectionSolutionSetting.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceCustomProtectionAction.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceCustomProtectionSetting.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceInclusionState.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceLists.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceNativeProtectionSolutionSetting.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceProtectionSolutionSettings.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceProtectionSolutionType.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceProtectionStatus.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceReplicationRole.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceSiteRecoveryProtectionSetting.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceSiteRecoveryReprotectParams.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceSiteRecoveryTestFailoverCleanupParams.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceSiteRecoveryTestFailoverParams.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ResourceTypeCategories.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ServiceGroupMembership.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ServiceLevelResource.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/SolutionDisplayName.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/SupportedVerbsForStage.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/SystemMetadata.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/TestFailoverCleanupRequest.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/TestFailoverState.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UnifiedResilienceItem.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UnifiedResilienceItemProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UnifiedResilienceItemRequirementSelected.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UnifiedResilienceItems.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UpdateGoalResourceRequest.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UpdateRecoveryResourcesRequest.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UpdateRecoveryResourcesResponse.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlan.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlanProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlanTagsUpdate.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlanType.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UsagePlans.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UserConfirmationForHighAvailabilityItem.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/UserConsent.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/VMPresent.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ValidateForExecutionProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ValidateForExecutionRequest.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ValidateForOperationRequest.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ValidateForRecoveryOperationBaseResponse.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/ZonalDrillProperties.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/models/package-info.java","src/main/java/com/azure/resourcemanager/resiliencemanagement/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-resiliencemanagement/proxy-config.json b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-resiliencemanagement/proxy-config.json new file mode 100644 index 000000000000..6b30ecdcb6b6 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-resiliencemanagement/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.resiliencemanagement.implementation.DrillResourcesClientImpl$DrillResourcesService"],["com.azure.resourcemanager.resiliencemanagement.implementation.DrillRunResourcesClientImpl$DrillRunResourcesService"],["com.azure.resourcemanager.resiliencemanagement.implementation.DrillRunsClientImpl$DrillRunsService"],["com.azure.resourcemanager.resiliencemanagement.implementation.DrillsClientImpl$DrillsService"],["com.azure.resourcemanager.resiliencemanagement.implementation.EnrollmentsClientImpl$EnrollmentsService"],["com.azure.resourcemanager.resiliencemanagement.implementation.GoalAssignmentsClientImpl$GoalAssignmentsService"],["com.azure.resourcemanager.resiliencemanagement.implementation.GoalResourcesClientImpl$GoalResourcesService"],["com.azure.resourcemanager.resiliencemanagement.implementation.GoalTemplatesClientImpl$GoalTemplatesService"],["com.azure.resourcemanager.resiliencemanagement.implementation.OperationStatusClientImpl$OperationStatusService"],["com.azure.resourcemanager.resiliencemanagement.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.resiliencemanagement.implementation.RecoveryJobResourcesClientImpl$RecoveryJobResourcesService"],["com.azure.resourcemanager.resiliencemanagement.implementation.RecoveryJobsClientImpl$RecoveryJobsService"],["com.azure.resourcemanager.resiliencemanagement.implementation.RecoveryPlanActionsClientImpl$RecoveryPlanActionsService"],["com.azure.resourcemanager.resiliencemanagement.implementation.RecoveryPlansClientImpl$RecoveryPlansService"],["com.azure.resourcemanager.resiliencemanagement.implementation.RecoveryResourcesClientImpl$RecoveryResourcesService"],["com.azure.resourcemanager.resiliencemanagement.implementation.UnifiedResilienceItemsClientImpl$UnifiedResilienceItemsService"],["com.azure.resourcemanager.resiliencemanagement.implementation.UsagePlansClientImpl$UsagePlansService"]] \ No newline at end of file diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-resiliencemanagement/reflect-config.json b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-resiliencemanagement/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-resiliencemanagement/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/resources/azure-resourcemanager-resiliencemanagement.properties b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/resources/azure-resourcemanager-resiliencemanagement.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/main/resources/azure-resourcemanager-resiliencemanagement.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillResourcesGetSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillResourcesGetSamples.java new file mode 100644 index 000000000000..50f2199b39e5 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillResourcesGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for DrillResources Get. + */ +public final class DrillResourcesGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillResources_Get_MaximumSet_Gen.json + */ + /** + * Sample code: DrillResources_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillResourcesGetMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillResources() + .getWithResponse("sampleServiceGroupName", "drill1", "b6378181-9dc0-4a43-8e09-97a8b08aabaa", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillResourcesListSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillResourcesListSamples.java new file mode 100644 index 000000000000..e92a6ca6a458 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillResourcesListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for DrillResources List. + */ +public final class DrillResourcesListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillResources_List_MaximumSet_Gen.json + */ + /** + * Sample code: DrillResources_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillResourcesListMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillResources() + .list("sampleServiceGroupName", "drill1", "xntbyoswztnmvitj", 69, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunResourcesGetSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunResourcesGetSamples.java new file mode 100644 index 000000000000..049b5397320f --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunResourcesGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for DrillRunResources Get. + */ +public final class DrillRunResourcesGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillRunResources_Get_MaximumSet_Gen.json + */ + /** + * Sample code: DrillRunResources_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillRunResourcesGetMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillRunResources() + .getWithResponse("sampleServiceGroupName", "drill1", "ca92602e-53bf-43d2-ae62-d3fc940474b3", + "56f942da-a30e-43c0-b5f0-1c22e44f2d94", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunResourcesListSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunResourcesListSamples.java new file mode 100644 index 000000000000..551bd1d02cda --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunResourcesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for DrillRunResources List. + */ +public final class DrillRunResourcesListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillRunResources_List_MaximumSet_Gen.json + */ + /** + * Sample code: DrillRunResources_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillRunResourcesListMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillRunResources() + .list("sampleServiceGroupName", "drill1", "ca92602e-53bf-43d2-ae62-d3fc940474b3", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsAddNotesSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsAddNotesSamples.java new file mode 100644 index 000000000000..d5607992434c --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsAddNotesSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunAddNotesRequest; + +/** + * Samples for DrillRuns AddNotes. + */ +public final class DrillRunsAddNotesSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillRuns_AddNotes_MaximumSet_Gen.json + */ + /** + * Sample code: DrillRuns_AddNotes_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillRunsAddNotesMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillRuns() + .addNotes("sampleServiceGroupName", "qmn", "drill1", "ca92602e-53bf-43d2-ae62-d3fc940474b3", + new DrillRunAddNotesRequest().withNotes("wubqjajveatmwcglo"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsFailOverSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsFailOverSamples.java new file mode 100644 index 000000000000..dcbed67a66db --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsFailOverSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.AutoFailover; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunFailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverDirectionTypes; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequestProperties; +import java.util.Arrays; + +/** + * Samples for DrillRuns FailOver. + */ +public final class DrillRunsFailOverSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillRuns_FailOver_MaximumSet_Gen.json + */ + /** + * Sample code: DrillRuns_FailOver_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillRunsFailOverMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillRuns() + .failOver("sampleServiceGroupName", "qmn", "drill1", "ca92602e-53bf-43d2-ae62-d3fc940474b3", + new DrillRunFailoverRequest().withAutoFailover(AutoFailover.ENABLE) + .withFailoverProperties( + new FailoverRequest().withFailoverDirection(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS) + .withFailoverRequestProperties( + new FailoverRequestProperties().withSourceLocations(Arrays.asList("westus")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsGetSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsGetSamples.java new file mode 100644 index 000000000000..2d20617c7d07 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for DrillRuns Get. + */ +public final class DrillRunsGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillRuns_Get_MaximumSet_Gen.json + */ + /** + * Sample code: DrillRuns_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + drillRunsGetMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillRuns() + .getWithResponse("sampleServiceGroupName", "drill1", "ca92602e-53bf-43d2-ae62-d3fc940474b3", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsListSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsListSamples.java new file mode 100644 index 000000000000..10e2dbbe1dfb --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for DrillRuns List. + */ +public final class DrillRunsListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillRuns_List_MaximumSet_Gen.json + */ + /** + * Sample code: DrillRuns_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + drillRunsListMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillRuns().list("sampleServiceGroupName", "drill1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsMarkAsCompleteSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsMarkAsCompleteSamples.java new file mode 100644 index 000000000000..47575a2fb3b7 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsMarkAsCompleteSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunSubtasks; +import com.azure.resourcemanager.resiliencemanagement.models.MarkAsCompleteRequest; + +/** + * Samples for DrillRuns MarkAsComplete. + */ +public final class DrillRunsMarkAsCompleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillRuns_MarkAsComplete_MaximumSet_Gen.json + */ + /** + * Sample code: DrillRuns_MarkAsComplete_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillRunsMarkAsCompleteMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillRuns() + .markAsComplete("sampleServiceGroupName", "qmn", "drill1", "ca92602e-53bf-43d2-ae62-d3fc940474b3", + new MarkAsCompleteRequest().withDrillRunStage(DrillRunSubtasks.fromString("Fault")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsReprotectSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsReprotectSamples.java new file mode 100644 index 000000000000..d11dad5b2b05 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsReprotectSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for DrillRuns Reprotect. + */ +public final class DrillRunsReprotectSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillRuns_Reprotect_MaximumSet_Gen.json + */ + /** + * Sample code: DrillRuns_Reprotect_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillRunsReprotectMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillRuns() + .reprotect("sampleServiceGroupName", "qmn", "drill1", "ca92602e-53bf-43d2-ae62-d3fc940474b3", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsResumeSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsResumeSamples.java new file mode 100644 index 000000000000..7ccfb21f1b29 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsResumeSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for DrillRuns Resume. + */ +public final class DrillRunsResumeSamples { + /* + * x-ms-original-file: 2026-04-01-preview/DrillRuns_Resume_MaximumSet_Gen.json + */ + /** + * Sample code: DrillRuns_Resume_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + drillRunsResumeMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drillRuns() + .resume("sampleServiceGroupName", "qmn", "drill1", "ca92602e-53bf-43d2-ae62-d3fc940474b3", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsAddOrUpdateResourcesSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsAddOrUpdateResourcesSamples.java new file mode 100644 index 000000000000..1f0fa92825cb --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsAddOrUpdateResourcesSamples.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.AddOrUpdateResourcesRequest; +import com.azure.resourcemanager.resiliencemanagement.models.CustomFaultDetails; +import com.azure.resourcemanager.resiliencemanagement.models.FaultDetails; +import com.azure.resourcemanager.resiliencemanagement.models.FaultProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ForceInclusionAndUpdate; +import com.azure.resourcemanager.resiliencemanagement.models.IncludeOrUpdateResource; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceLists; +import java.util.Arrays; + +/** + * Samples for Drills AddOrUpdateResources. + */ +public final class DrillsAddOrUpdateResourcesSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Drills_AddOrUpdateResources_MaximumSet_Gen.json + */ + /** + * Sample code: Drills_AddOrUpdateResources_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillsAddOrUpdateResourcesMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drills() + .addOrUpdateResources("sampleServiceGroupName", "qmn", "drill1", new AddOrUpdateResourcesRequest() + .withFaultDurationInMin(0) + .withResourceLists(new ResourceLists().withIncludeResources(Arrays.asList(new IncludeOrUpdateResource() + .withId( + "/providers/Microsoft.Management/serviceGroups/sampleServiceGroupName/providers/Microsoft.AzureResilienceManagement/drills/drill1/drillResources/2c9b3a1f-f96e-42c2-98fe-15005da8a133") + .withFaultProperties(new FaultProperties().withOverriddenDefaultFault(new FaultDetails() + .withFaultUrn("urn:csci:microsoft:virtualMachine:shutdown/1.0") + .withFaultName("shutdown") + .withTargetResourceId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1")) + .withCustomFault(new CustomFaultDetails().withFaultName( + "umofuzwgczqwyzcoakmrdrkjknykdonhypxibwrweggltsmjayvnlzroxdfalwkfsqvuqtfwhhzcnemndbgxdiciqs") + .withScriptResourceId( + "/subscriptions/191973cd-9c54-41e0-ac19-25dd9a92d5a8/resourceGroups/abhinkRG/providers/Microsoft.Automation/automationAccounts/abhinkAcc/runbooks/viveksi"))))) + .withExcludeResources(Arrays.asList( + "/providers/Microsoft.Management/serviceGroups/sampleServiceGroupName/providers/Microsoft.AzureResilienceManagement/drills/drill1/drillResources/c2191964-be24-4849-8faf-d9569576c708")) + .withUpdateResources(Arrays.asList(new IncludeOrUpdateResource().withId( + "/providers/Microsoft.Management/serviceGroups/sampleServiceGroupName/providers/Microsoft.AzureResilienceManagement/drills/drill1/drillResources/c26bea42-c34c-4e6f-8cf4-15043e18c8bc") + .withFaultProperties(new FaultProperties().withOverriddenDefaultFault(new FaultDetails() + .withFaultUrn("urn:csci:microsoft:virtualMachine:shutdown/1.0") + .withFaultName("shutdown") + .withTargetResourceId( + "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1")) + .withCustomFault(new CustomFaultDetails().withFaultName( + "umofuzwgczqwyzcoakmrdrkjknykdonhypxibwrweggltsmjayvnlzroxdfalwkfsqvuqtfwhhzcnemndbgxdiciqs") + .withScriptResourceId( + "/subscriptions/191973cd-9c54-41e0-ac19-25dd9a92d5a8/resourceGroups/abhinkRG/providers/Microsoft.Automation/automationAccounts/abhinkAcc/runbooks/viveksi")))))) + .withForceInclusionAndUpdate(ForceInclusionAndUpdate.ENABLE), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsCreateSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsCreateSamples.java new file mode 100644 index 000000000000..e7d59e17af20 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsCreateSamples.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.fluent.models.DrillInner; +import com.azure.resourcemanager.resiliencemanagement.models.AssetPropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.AssociatedIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ChaosResourcePropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.DrillProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.MonitoringPropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.RBACSetupMode; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanPropertiesOfDrill; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Drills Create. + */ +public final class DrillsCreateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Drills_Create_MaximumSet_Gen.json + */ + /** + * Sample code: Drills_Create_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + drillsCreateMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drills() + .create("sampleServiceGroupName", "drill1", new DrillInner().withProperties(new DrillProperties() + .withRecoveryPlanProperties(new RecoveryPlanPropertiesOfDrill().withIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))) + .withDrillAssetProperties( + new AssetPropertiesOfDrill().withSubscription("4e88bed3-114f-443d-9975-28f64122ec5e") + .withRegion("eastus") + .withResourceGroup("customDrillResourceGroup")) + .withChaosResourceProperties(new ChaosResourcePropertiesOfDrill().withIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")) + .withChaosResourceIdentityForFaults(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))) + .withRbacSetupMode(RBACSetupMode.AUTOMATED_CUSTOM_ROLE) + .withMonitoringProperties(new MonitoringPropertiesOfDrill().withIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf())), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsDeleteSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsDeleteSamples.java new file mode 100644 index 000000000000..a3c25a12ed93 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for Drills Delete. + */ +public final class DrillsDeleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Drills_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: Drills_Delete_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + drillsDeleteMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drills().delete("sampleServiceGroupName", "drill1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsEndSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsEndSamples.java new file mode 100644 index 000000000000..3995a37c510a --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsEndSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.DrillAttestation; +import com.azure.resourcemanager.resiliencemanagement.models.DrillEndRequest; + +/** + * Samples for Drills End. + */ +public final class DrillsEndSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Drills_End_MaximumSet_Gen.json + */ + /** + * Sample code: Drills_End_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + drillsEndMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drills() + .end("sampleServiceGroupName", "qmn", "drill1", + new DrillEndRequest().withAttestation(DrillAttestation.ATTESTED_SUCCESS) + .withAttestationNotes("ycnqvrgduotohgycsapckhixwqwgp"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsGetSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsGetSamples.java new file mode 100644 index 000000000000..91f5ab4f40e9 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for Drills Get. + */ +public final class DrillsGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Drills_Get_MaximumSet_Gen.json + */ + /** + * Sample code: Drills_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + drillsGetMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drills().getWithResponse("sampleServiceGroupName", "drill1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsListSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsListSamples.java new file mode 100644 index 000000000000..b93b5c1a1744 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for Drills List. + */ +public final class DrillsListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Drills_List_MaximumSet_Gen.json + */ + /** + * Sample code: Drills_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + drillsListMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drills().list("sampleServiceGroupName", "xntbyoswztnmvitj", 69, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsResyncReadinessCheckSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsResyncReadinessCheckSamples.java new file mode 100644 index 000000000000..5981d6f574b9 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsResyncReadinessCheckSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for Drills ResyncReadinessCheck. + */ +public final class DrillsResyncReadinessCheckSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Drills_ResyncReadinessCheck_MaximumSet_Gen.json + */ + /** + * Sample code: Drills_ResyncReadinessCheck_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillsResyncReadinessCheckMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drills() + .resyncReadinessCheck("sampleServiceGroupName", "qmn", "drill1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsStartSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsStartSamples.java new file mode 100644 index 000000000000..b7d9bcb52bb0 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsStartSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.DrillMode; +import com.azure.resourcemanager.resiliencemanagement.models.DrillStartRequest; + +/** + * Samples for Drills Start. + */ +public final class DrillsStartSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Drills_Start_MaximumSet_Gen.json + */ + /** + * Sample code: Drills_Start_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + drillsStartMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drills() + .start("sampleServiceGroupName", "qmn", "drill1", new DrillStartRequest().withMode(DrillMode.FAILOVER), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsUpdateSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsUpdateSamples.java new file mode 100644 index 000000000000..ee869b5df21b --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsUpdateSamples.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.AssetPropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.AssociatedIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ChaosResourcePropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.DrillUpdate; +import com.azure.resourcemanager.resiliencemanagement.models.DrillUpdateProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.MonitoringPropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.RBACSetupMode; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanPropertiesOfDrill; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Drills Update. + */ +public final class DrillsUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Drills_Update_MaximumSet_Gen.json + */ + /** + * Sample code: Drills_Update_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + drillsUpdateMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drills() + .update("sampleServiceGroupName", "drill1", new DrillUpdate() + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf())) + .withProperties(new DrillUpdateProperties().withRecoveryPlanProperties( + new RecoveryPlanPropertiesOfDrill().withIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))) + .withDrillAssetProperties(new AssetPropertiesOfDrill().withSubscription("pxlmwjuhcif") + .withRegion("zuvwzxnbqyzdkthrewruw")) + .withChaosResourceProperties(new ChaosResourcePropertiesOfDrill() + .withIdentity(new AssociatedIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")) + .withChaosResourceIdentityForFaults(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))) + .withRbacSetupMode(RBACSetupMode.AUTOMATED_CUSTOM_ROLE) + .withMonitoringProperties(new MonitoringPropertiesOfDrill().withIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsValidateForExecutionSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsValidateForExecutionSamples.java new file mode 100644 index 000000000000..88d2f0317eb1 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsValidateForExecutionSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForExecutionProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForExecutionRequest; +import java.util.Arrays; + +/** + * Samples for Drills ValidateForExecution. + */ +public final class DrillsValidateForExecutionSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Drills_ValidateForExecution_MaximumSet_Gen.json + */ + /** + * Sample code: Drills_ValidateForExecution_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void drillsValidateForExecutionMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.drills() + .validateForExecution("sampleServiceGroupName", "qmn", "drill1", + new ValidateForExecutionRequest().withValidateForExecutionProperties( + new ValidateForExecutionProperties().withSourceLocations(Arrays.asList("eastus2-az1"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/EnrollmentsCreateOrUpdateSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/EnrollmentsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..359b89ea7a55 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/EnrollmentsCreateOrUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.EnrollmentProperties; + +/** + * Samples for Enrollments CreateOrUpdate. + */ +public final class EnrollmentsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Enrollments_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: Enrollments_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void enrollmentsCreateOrUpdateMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.enrollments() + .define("sg1-enrollment") + .withExistingUsagePlan("MyResourceGroup", "myUsagePlan") + .withProperties( + new EnrollmentProperties().withServiceGroupId("/providers/Microsoft.Management/serviceGroups/sg1")) + .create(); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/EnrollmentsDeleteSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/EnrollmentsDeleteSamples.java new file mode 100644 index 000000000000..7725f28c415e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/EnrollmentsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for Enrollments Delete. + */ +public final class EnrollmentsDeleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Enrollments_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: Enrollments_Delete_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void enrollmentsDeleteMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.enrollments() + .delete("MyResourceGroup", "myUsagePlan", "sg1-enrollment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/EnrollmentsGetSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/EnrollmentsGetSamples.java new file mode 100644 index 000000000000..34edeb78209c --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/EnrollmentsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for Enrollments Get. + */ +public final class EnrollmentsGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Enrollments_Get_MaximumSet_Gen.json + */ + /** + * Sample code: Enrollments_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + enrollmentsGetMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.enrollments() + .getWithResponse("MyResourceGroup", "myUsagePlan", "sg1-enrollment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/EnrollmentsListSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/EnrollmentsListSamples.java new file mode 100644 index 000000000000..b11a5d07c699 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/EnrollmentsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for Enrollments List. + */ +public final class EnrollmentsListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Enrollments_List_MaximumSet_Gen.json + */ + /** + * Sample code: Enrollments_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + enrollmentsListMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.enrollments().list("MyResourceGroup", "myUsagePlan", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsCreateOrUpdateSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..5ade7e0a087c --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsCreateOrUpdateSamples.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalAssignmentInner; +import com.azure.resourcemanager.resiliencemanagement.models.GoalAssignmentProperties; +import com.azure.resourcemanager.resiliencemanagement.models.GoalAssignmentType; +import com.azure.resourcemanager.resiliencemanagement.models.ServiceLevelResource; +import java.util.Arrays; + +/** + * Samples for GoalAssignments CreateOrUpdate. + */ +public final class GoalAssignmentsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalAssignments_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: GoalAssignments_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalAssignmentsCreateOrUpdateMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalAssignments() + .createOrUpdate("sg1", "ga1", new GoalAssignmentInner().withProperties(new GoalAssignmentProperties() + .withGoalTemplateId("/providers/Microsoft.AzureResilienceManagement/goaltemplates/gt1") + .withGoalAssignmentType(GoalAssignmentType.RESILIENCY) + .withServiceLevelResources(Arrays.asList(new ServiceLevelResource().withServiceLevelIndicatorResourceId( + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/MyVirtualMachine") + .withServiceLevelObjectiveResourceId( + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/MyVirtualMachine")))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/GoalAssignments_CreateOrUpdate_MinimumSet_Gen.json + */ + /** + * Sample code: GoalAssignments_CreateOrUpdate_MinimumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalAssignmentsCreateOrUpdateMinimumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalAssignments() + .createOrUpdate("sg1", "ga1", + new GoalAssignmentInner().withProperties(new GoalAssignmentProperties() + .withGoalTemplateId("/providers/Microsoft.AzureResilienceManagement/goaltemplates/gt1") + .withGoalAssignmentType(GoalAssignmentType.RESILIENCY)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsDeleteSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsDeleteSamples.java new file mode 100644 index 000000000000..9c58d1b273fc --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for GoalAssignments Delete. + */ +public final class GoalAssignmentsDeleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalAssignments_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: GoalAssignments_Delete_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalAssignmentsDeleteMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalAssignments().delete("sg1", "ga1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsGetSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsGetSamples.java new file mode 100644 index 000000000000..2595ae71ef6e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for GoalAssignments Get. + */ +public final class GoalAssignmentsGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalAssignments_Get_MaximumSet_Gen.json + */ + /** + * Sample code: GoalAssignments_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalAssignmentsGetMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalAssignments().getWithResponse("sg1", "ga1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsListSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsListSamples.java new file mode 100644 index 000000000000..c550f720c487 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsListSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for GoalAssignments List. + */ +public final class GoalAssignmentsListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalAssignments_List_MaximumSet_Gen.json + */ + /** + * Sample code: GoalAssignments_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalAssignmentsListMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalAssignments().list("zldmpkvqzifygkqau", "xntbyoswztnmvitj", 69, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/GoalAssignments_List_MinimumSet_Gen.json + */ + /** + * Sample code: GoalAssignments_List_MinimumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalAssignmentsListMinimumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalAssignments().list("sg1", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsRecommendCapacitySamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsRecommendCapacitySamples.java new file mode 100644 index 000000000000..8ef4a83cdcc4 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsRecommendCapacitySamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.RecommendCapacityRequest; +import java.util.Arrays; + +/** + * Samples for GoalAssignments RecommendCapacity. + */ +public final class GoalAssignmentsRecommendCapacitySamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalAssignments_RecommendCapacity_MaximumSet_Gen.json + */ + /** + * Sample code: GoalAssignments_RecommendCapacity_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalAssignmentsRecommendCapacityMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalAssignments() + .recommendCapacity("sg1", "ga1", new RecommendCapacityRequest().withResourceIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.Storage/storageAccounts/sa1")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsRefreshGoalResourcesSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsRefreshGoalResourcesSamples.java new file mode 100644 index 000000000000..ddad8a37b294 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsRefreshGoalResourcesSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for GoalAssignments RefreshGoalResources. + */ +public final class GoalAssignmentsRefreshGoalResourcesSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalAssignments_RefreshGoalResources_MaximumSet_Gen.json + */ + /** + * Sample code: GoalAssignments_RefreshGoalResources_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalAssignmentsRefreshGoalResourcesMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalAssignments().refreshGoalResources("sg1", "ga1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsUpdateGoalResourcesSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsUpdateGoalResourcesSamples.java new file mode 100644 index 000000000000..e284c1ebbfe3 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsUpdateGoalResourcesSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalResourceInner; +import com.azure.resourcemanager.resiliencemanagement.models.AttestationState; +import com.azure.resourcemanager.resiliencemanagement.models.ExclusionState; +import com.azure.resourcemanager.resiliencemanagement.models.GoalResourceProperties; +import com.azure.resourcemanager.resiliencemanagement.models.UpdateGoalResourceRequest; +import java.util.Arrays; + +/** + * Samples for GoalAssignments UpdateGoalResources. + */ +public final class GoalAssignmentsUpdateGoalResourcesSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalAssignments_UpdateGoalResources_MaximumSet_Gen.json + */ + /** + * Sample code: GoalAssignments_UpdateGoalResources_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalAssignmentsUpdateGoalResourcesMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalAssignments() + .updateGoalResources("sg1", "ga1", new UpdateGoalResourceRequest().withResources(Arrays.asList( + new GoalResourceInner().withProperties(new GoalResourceProperties().withResourceArmId( + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/MyVirtualMachine") + .withHighAvailabilityGoalParticipation(ExclusionState.EXCLUDED) + .withHighAvailabilityAttestationStatus(AttestationState.MANUALLY_ATTESTED) + .withDisasterRecoveryGoalParticipation(ExclusionState.EXCLUDED) + .withDisasterRecoveryAttestationStatus(AttestationState.MANUALLY_ATTESTED)), + new GoalResourceInner().withProperties(new GoalResourceProperties().withResourceArmId( + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/MyVirtualMachine1") + .withHighAvailabilityGoalParticipation(ExclusionState.EXCLUDED) + .withHighAvailabilityAttestationStatus(AttestationState.MANUALLY_ATTESTED) + .withDisasterRecoveryGoalParticipation(ExclusionState.EXCLUDED) + .withDisasterRecoveryAttestationStatus(AttestationState.MANUALLY_ATTESTED)))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsUpdateSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsUpdateSamples.java new file mode 100644 index 000000000000..88991065a1db --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsUpdateSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalAssignmentInner; +import com.azure.resourcemanager.resiliencemanagement.models.GoalAssignmentProperties; +import com.azure.resourcemanager.resiliencemanagement.models.GoalAssignmentType; +import com.azure.resourcemanager.resiliencemanagement.models.ServiceLevelResource; +import java.util.Arrays; + +/** + * Samples for GoalAssignments Update. + */ +public final class GoalAssignmentsUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalAssignments_Update_MaximumSet_Gen.json + */ + /** + * Sample code: GoalAssignments_Update_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalAssignmentsUpdateMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalAssignments() + .update("sg1", "ga1", new GoalAssignmentInner().withProperties(new GoalAssignmentProperties() + .withGoalTemplateId("/providers/Microsoft.AzureResilienceManagement/goaltemplates/gt1") + .withGoalAssignmentType(GoalAssignmentType.RESILIENCY) + .withServiceLevelResources(Arrays.asList(new ServiceLevelResource().withServiceLevelIndicatorResourceId( + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/MyVirtualMachine") + .withServiceLevelObjectiveResourceId( + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/MyVirtualMachine")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourcesGetSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourcesGetSamples.java new file mode 100644 index 000000000000..f563d4495639 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourcesGetSamples.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for GoalResources Get. + */ +public final class GoalResourcesGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalResources_Get_Complete_Example.json + */ + /** + * Sample code: GoalResources_Get_Complete_Example. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalResourcesGetCompleteExample( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalResources() + .getWithResponse("production-sg", "resiliencyGoalAssignment", "web-app-resource", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/GoalResources_Get_MaximumSet_Gen.json + */ + /** + * Sample code: GoalResources_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + goalResourcesGetMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalResources() + .getWithResponse("umyghwnfpzsgrhpczizcn", "ga1", "gr1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/GoalResources_Get_MinimumSet_Gen.json + */ + /** + * Sample code: GoalResources_Get_MinimumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + goalResourcesGetMinimumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalResources().getWithResponse("sg1", "ga1", "gr1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourcesListSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourcesListSamples.java new file mode 100644 index 000000000000..480a4c3c1bef --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourcesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for GoalResources List. + */ +public final class GoalResourcesListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalResources_List_MaximumSet_Gen.json + */ + /** + * Sample code: GoalResources_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalResourcesListMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalResources().list("sg1", "ga1", "xntbyoswztnmvitj", 69, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalTemplatesCreateOrUpdateSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalTemplatesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..1f41c90f4cc4 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalTemplatesCreateOrUpdateSamples.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalTemplateInner; +import com.azure.resourcemanager.resiliencemanagement.models.GoalTemplateProperties; +import com.azure.resourcemanager.resiliencemanagement.models.GoalType; +import com.azure.resourcemanager.resiliencemanagement.models.RequirementSelected; + +/** + * Samples for GoalTemplates CreateOrUpdate. + */ +public final class GoalTemplatesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalTemplates_CreateOrUpdate_MinimumSet_Gen.json + */ + /** + * Sample code: GoalTemplates_CreateOrUpdate_MinimumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalTemplatesCreateOrUpdateMinimumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalTemplates() + .createOrUpdate("sg1", "gt1", + new GoalTemplateInner().withProperties(new GoalTemplateProperties().withGoalType(GoalType.RESILIENCY)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/GoalTemplates_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: GoalTemplates_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalTemplatesCreateOrUpdateMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalTemplates() + .createOrUpdate("zumt", "gt1", + new GoalTemplateInner().withProperties( + new GoalTemplateProperties().withRequireHighAvailability(RequirementSelected.REQUIRED) + .withRequireDisasterRecovery(RequirementSelected.NOT_REQUIRED) + .withRegionalRecoveryPointObjective("PT15M") + .withRegionalRecoveryTimeObjective("PT30M") + .withGoalType(GoalType.RESILIENCY)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalTemplatesDeleteSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalTemplatesDeleteSamples.java new file mode 100644 index 000000000000..59f03f9d1a77 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalTemplatesDeleteSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for GoalTemplates Delete. + */ +public final class GoalTemplatesDeleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalTemplates_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: GoalTemplates_Delete_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalTemplatesDeleteMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalTemplates().delete("ajsvdpsdgp", "gt1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/GoalTemplates_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: GoalTemplates_Delete_MinimumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalTemplatesDeleteMinimumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalTemplates().delete("sg1", "gt1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalTemplatesGetSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalTemplatesGetSamples.java new file mode 100644 index 000000000000..2633d70b6e0a --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalTemplatesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for GoalTemplates Get. + */ +public final class GoalTemplatesGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalTemplates_Get_MaximumSet_Gen.json + */ + /** + * Sample code: GoalTemplates_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + goalTemplatesGetMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalTemplates().getWithResponse("qsqjquhxpermcblvegajq", "gt1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalTemplatesListSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalTemplatesListSamples.java new file mode 100644 index 000000000000..a03374fe7f09 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalTemplatesListSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for GoalTemplates List. + */ +public final class GoalTemplatesListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalTemplates_List_MaximumSet_Gen.json + */ + /** + * Sample code: GoalTemplates_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalTemplatesListMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalTemplates().list("vmmacokmkuxzy", "xntbyoswztnmvitj", 69, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/GoalTemplates_List_MinimumSet_Gen.json + */ + /** + * Sample code: GoalTemplates_List_MinimumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalTemplatesListMinimumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalTemplates().list("sg1", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalTemplatesUpdateSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalTemplatesUpdateSamples.java new file mode 100644 index 000000000000..62b09a7998a9 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalTemplatesUpdateSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalTemplateInner; +import com.azure.resourcemanager.resiliencemanagement.models.GoalTemplateProperties; +import com.azure.resourcemanager.resiliencemanagement.models.GoalType; +import com.azure.resourcemanager.resiliencemanagement.models.RequirementSelected; + +/** + * Samples for GoalTemplates Update. + */ +public final class GoalTemplatesUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/GoalTemplates_Update_MaximumSet_Gen.json + */ + /** + * Sample code: GoalTemplates_Update_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void goalTemplatesUpdateMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.goalTemplates() + .update("ipvrpvfcsfwltkmalhklsyg", "gt1", + new GoalTemplateInner().withProperties( + new GoalTemplateProperties().withRequireHighAvailability(RequirementSelected.REQUIRED) + .withRequireDisasterRecovery(RequirementSelected.NOT_REQUIRED) + .withRegionalRecoveryPointObjective("PT15M") + .withRegionalRecoveryTimeObjective("PT30M") + .withGoalType(GoalType.RESILIENCY)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationStatusGetSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationStatusGetSamples.java new file mode 100644 index 000000000000..5f9124521bbb --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationStatusGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for OperationStatus Get. + */ +public final class OperationStatusGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/OperationStatus_Get_MaximumSet_Gen.json + */ + /** + * Sample code: OperationStatus_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void operationStatusGetMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.operationStatus() + .getWithResponse("eastus", "12345678-1234-1234-1234-123456789012", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationsListSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationsListSamples.java new file mode 100644 index 000000000000..df51aa5e0215 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationsListSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MinimumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + operationsListMinimumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + operationsListMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobResourcesGetSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobResourcesGetSamples.java new file mode 100644 index 000000000000..0b88a8a11ed6 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobResourcesGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for RecoveryJobResources Get. + */ +public final class RecoveryJobResourcesGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryJobResources_Get_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryJobResources_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryJobResourcesGetMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryJobResources() + .getWithResponse("sampleServiceGroupName", "samplePlanName", "c56888ef-9ced-4001-a6d4-7145a0309bdb", + "56f942da-a30e-43c0-b5f0-1c22e44f2d94", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobResourcesListSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobResourcesListSamples.java new file mode 100644 index 000000000000..303f379e9abb --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobResourcesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for RecoveryJobResources List. + */ +public final class RecoveryJobResourcesListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryJobResources_List_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryJobResources_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryJobResourcesListMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryJobResources() + .list("sampleServiceGroupName", "samplePlanName", "c56888ef-9ced-4001-a6d4-7145a0309bdb", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobsCancelSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobsCancelSamples.java new file mode 100644 index 000000000000..517885c49b24 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobsCancelSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryActionRequest; + +/** + * Samples for RecoveryJobs Cancel. + */ +public final class RecoveryJobsCancelSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryJobs_Cancel_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryJobs_Cancel_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryJobsCancelMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryJobs() + .cancel("sampleServiceGroup", null, "samplePlanName", "c56888ef-9ced-4001-a6d4-7145a0309bdb", + new RecoveryActionRequest().withDescription("Cancelling the recovery job due to user request"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobsGetSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobsGetSamples.java new file mode 100644 index 000000000000..e1bed7fbc433 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for RecoveryJobs Get. + */ +public final class RecoveryJobsGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryJobs_Get_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryJobs_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + recoveryJobsGetMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryJobs() + .getWithResponse("sampleServiceGroupName", "samplePlanName", "c56888ef-9ced-4001-a6d4-7145a0309bdb", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobsListSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobsListSamples.java new file mode 100644 index 000000000000..86cf669e2e81 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for RecoveryJobs List. + */ +public final class RecoveryJobsListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryJobs_List_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryJobs_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + recoveryJobsListMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryJobs().list("sampleServiceGroupName", "samplePlanName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobsResumeSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobsResumeSamples.java new file mode 100644 index 000000000000..c8547c245051 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobsResumeSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryActionRequest; + +/** + * Samples for RecoveryJobs Resume. + */ +public final class RecoveryJobsResumeSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryJobs_Resume_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryJobs_Resume_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryJobsResumeMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryJobs() + .resume("sampleServiceGroupName", null, "samplePlanName", "c56888ef-9ced-4001-a6d4-7145a0309bdb", + new RecoveryActionRequest().withDescription("Resuming the recovery job after user verification"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobsRetrySamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobsRetrySamples.java new file mode 100644 index 000000000000..fbe7b2ac66f7 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryJobsRetrySamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for RecoveryJobs Retry. + */ +public final class RecoveryJobsRetrySamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryJobs_Retry_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryJobs_Retry_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryJobsRetryMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryJobs() + .retry("sampleServiceGroupName", null, "samplePlanName", "c56888ef-9ced-4001-a6d4-7145a0309bdb", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsCheckReadinessSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsCheckReadinessSamples.java new file mode 100644 index 000000000000..c42fb40dc486 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsCheckReadinessSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for RecoveryPlanActions CheckReadiness. + */ +public final class RecoveryPlanActionsCheckReadinessSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_CheckReadiness_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_CheckReadiness_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsCheckReadinessMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .checkReadiness("sampleServiceGroupName", "qmn", "samplePlanName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsFailoverCommitSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsFailoverCommitSamples.java new file mode 100644 index 000000000000..9fcca5b4c570 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsFailoverCommitSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for RecoveryPlanActions FailoverCommit. + */ +public final class RecoveryPlanActionsFailoverCommitSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_FailoverCommit_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_FailoverCommit_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsFailoverCommitMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .failoverCommit("sampleServiceGroupName", null, "samplePlanName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsFailoverSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsFailoverSamples.java new file mode 100644 index 000000000000..809ff4672218 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsFailoverSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.ExecutionConfigurations; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverDirectionTypes; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequestProperties; +import com.azure.resourcemanager.resiliencemanagement.models.UserConsent; +import java.util.Arrays; + +/** + * Samples for RecoveryPlanActions Failover. + */ +public final class RecoveryPlanActionsFailoverSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_Failover_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_Failover_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsFailoverMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .failover("sampleServiceGroupName", null, "samplePlanName", new FailoverRequest() + .withFailoverDirection(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS) + .withFailoverRequestProperties(new FailoverRequestProperties() + .withSourceLocations(Arrays.asList("westus")) + .withSelectedResourceIds(Arrays.asList( + "/providers/Microsoft.Management/serviceGroups/sampleServiceGroupName/providers/Microsoft.AzureResilienceManagement/recoveryPlans/samplePlanName/recoveryResources/12345678-9012-3456-7890-123456789012")) + .withExecutionConfigurations(new ExecutionConfigurations().withUserConsent(UserConsent.ALLOWED))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsFinalizeSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsFinalizeSamples.java new file mode 100644 index 000000000000..40160e23627c --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsFinalizeSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for RecoveryPlanActions Finalize. + */ +public final class RecoveryPlanActionsFinalizeSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_Finalize_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_Finalize_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsFinalizeMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .finalize("sampleServiceGroupName", null, "samplePlanName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsReprotectSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsReprotectSamples.java new file mode 100644 index 000000000000..7a942beab06b --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsReprotectSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.ReprotectRequest; +import com.azure.resourcemanager.resiliencemanagement.models.ReprotectRequestProperties; +import java.util.Arrays; + +/** + * Samples for RecoveryPlanActions Reprotect. + */ +public final class RecoveryPlanActionsReprotectSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_Reprotect_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_Reprotect_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsReprotectMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .reprotect("sampleServiceGroupName", null, "samplePlanName", new ReprotectRequest() + .withReprotectRequestProperties(new ReprotectRequestProperties().withSelectedResourceIds(Arrays.asList( + "/providers/Microsoft.Management/serviceGroups/sampleServiceGroupName/providers/Microsoft.AzureResilienceManagement/recoveryPlans/samplePlanName/recoveryResources/12345678-9012-3456-7890-123456789012"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsTestFailoverCleanupSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsTestFailoverCleanupSamples.java new file mode 100644 index 000000000000..9c2f91187f13 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsTestFailoverCleanupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.TestFailoverCleanupRequest; + +/** + * Samples for RecoveryPlanActions TestFailoverCleanup. + */ +public final class RecoveryPlanActionsTestFailoverCleanupSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_TestFailoverCleanup_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_TestFailoverCleanup_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsTestFailoverCleanupMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .testFailoverCleanup("sampleServiceGroupName", null, "samplePlanName", + new TestFailoverCleanupRequest().withComments("Test failover clean-up comments"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsTestFailoverSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsTestFailoverSamples.java new file mode 100644 index 000000000000..bc34df6d9241 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsTestFailoverSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.ExecutionConfigurations; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverDirectionTypes; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequestProperties; +import com.azure.resourcemanager.resiliencemanagement.models.UserConsent; +import java.util.Arrays; + +/** + * Samples for RecoveryPlanActions TestFailover. + */ +public final class RecoveryPlanActionsTestFailoverSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_TestFailover_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_TestFailover_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsTestFailoverMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .testFailover("sampleServiceGroupName", "qmn", "samplePlanName", new FailoverRequest() + .withFailoverDirection(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS) + .withFailoverRequestProperties(new FailoverRequestProperties() + .withSourceLocations(Arrays.asList("westus")) + .withSelectedResourceIds(Arrays.asList( + "/providers/Microsoft.Management/serviceGroups/sampleServiceGroupName/providers/Microsoft.AzureResilienceManagement/recoveryPlans/samplePlanName/recoveryResources/12345678-9012-3456-7890-123456789012")) + .withExecutionConfigurations(new ExecutionConfigurations().withUserConsent(UserConsent.ALLOWED))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsUpdateResourcesSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsUpdateResourcesSamples.java new file mode 100644 index 000000000000..e792d1e6f6a9 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsUpdateResourcesSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryResourceInner; +import com.azure.resourcemanager.resiliencemanagement.models.AssociatedIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryResourceProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceInclusionState; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceNativeProtectionSolutionSetting; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceProtectionSolutionType; +import com.azure.resourcemanager.resiliencemanagement.models.UpdateRecoveryResourcesRequest; +import java.util.Arrays; + +/** + * Samples for RecoveryPlanActions UpdateResources. + */ +public final class RecoveryPlanActionsUpdateResourcesSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_UpdateResources_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_UpdateResources_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsUpdateResourcesMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .updateResources("sampleServiceGroupName", null, "samplePlanName", new UpdateRecoveryResourcesRequest() + .withResourcesToUpdate( + Arrays.asList(new RecoveryResourceInner().withProperties(new RecoveryResourceProperties() + .withRecoveryResourceUniqueId("e2a7b8d1-4c3f-4e2b-9a1c-7f6e2d8b5c4a") + .withInclusionState(ResourceInclusionState.INCLUDED) + .withSelectedProtectionSolutionType(ResourceProtectionSolutionType.AZURE_NATIVE) + .withSelectedProtectionSolutionSetting(new ResourceNativeProtectionSolutionSetting()) + .withRecoveryGroupId("11111111-1111-1111-1111-123456789012") + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))) + .withResourcesToRemove(Arrays.asList( + "/providers/Microsoft.Management/serviceGroups/sampleServiceGroupName/providers/Microsoft.AzureResilienceManagement/recoveryPlans/samplePlanName/recoveryResources/12345678-9012-3456-7890-123456789012")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForFailoverCommitSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForFailoverCommitSamples.java new file mode 100644 index 000000000000..f11d9ffde999 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForFailoverCommitSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for RecoveryPlanActions ValidateForFailoverCommit. + */ +public final class RecoveryPlanActionsValidateForFailoverCommitSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_ValidateForFailoverCommit_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_ValidateForFailoverCommit_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsValidateForFailoverCommitMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .validateForFailoverCommit("sampleServiceGroupName", null, "samplePlanName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForFailoverSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForFailoverSamples.java new file mode 100644 index 000000000000..9c3f314c8dc9 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForFailoverSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.FailoverDirectionTypes; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequestProperties; +import java.util.Arrays; + +/** + * Samples for RecoveryPlanActions ValidateForFailover. + */ +public final class RecoveryPlanActionsValidateForFailoverSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_ValidateForFailover_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_ValidateForFailover_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsValidateForFailoverMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .validateForFailover("sampleServiceGroupName", null, "samplePlanName", + new FailoverRequest().withFailoverDirection(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS) + .withFailoverRequestProperties( + new FailoverRequestProperties().withSourceLocations(Arrays.asList("westus"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForOperationSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForOperationSamples.java new file mode 100644 index 000000000000..d0b2fbeac074 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForOperationSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryOperationNames; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForOperationRequest; + +/** + * Samples for RecoveryPlanActions ValidateForOperation. + */ +public final class RecoveryPlanActionsValidateForOperationSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_ValidateForOperation_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_ValidateForOperation_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsValidateForOperationMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .validateForOperation("sampleServiceGroupName", null, "samplePlanName", + new ValidateForOperationRequest().withOperationName(RecoveryOperationNames.FAILOVER), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForReprotectSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForReprotectSamples.java new file mode 100644 index 000000000000..35ec1d56bc3e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForReprotectSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.ReprotectRequest; +import com.azure.resourcemanager.resiliencemanagement.models.ReprotectRequestProperties; +import java.util.Arrays; + +/** + * Samples for RecoveryPlanActions ValidateForReprotect. + */ +public final class RecoveryPlanActionsValidateForReprotectSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_ValidateForReprotect_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_ValidateForReprotect_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsValidateForReprotectMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .validateForReprotect("nrhlfd", null, "samplePlanName", new ReprotectRequest() + .withReprotectRequestProperties(new ReprotectRequestProperties().withSelectedResourceIds(Arrays.asList( + "/providers/Microsoft.Management/serviceGroups/sampleServiceGroupName/providers/Microsoft.AzureResilienceManagement/recoveryPlans/samplePlanName/recoveryResources/12345678-9012-3456-7890-123456789012"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForTestFailoverCleanupSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForTestFailoverCleanupSamples.java new file mode 100644 index 000000000000..a85a7e8e119f --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForTestFailoverCleanupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for RecoveryPlanActions ValidateForTestFailoverCleanup. + */ +public final class RecoveryPlanActionsValidateForTestFailoverCleanupSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_ValidateForTestFailoverCleanup_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_ValidateForTestFailoverCleanup_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsValidateForTestFailoverCleanupMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .validateForTestFailoverCleanup("sampleServiceGroupName", null, "samplePlanName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForTestFailoverSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForTestFailoverSamples.java new file mode 100644 index 000000000000..1f8789919580 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForTestFailoverSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.FailoverDirectionTypes; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequestProperties; +import java.util.Arrays; + +/** + * Samples for RecoveryPlanActions ValidateForTestFailover. + */ +public final class RecoveryPlanActionsValidateForTestFailoverSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlanActions_ValidateForTestFailover_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlanActions_ValidateForTestFailover_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlanActionsValidateForTestFailoverMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlanActions() + .validateForTestFailover("sampleServiceGroupName", null, "samplePlanName", + new FailoverRequest().withFailoverDirection(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS) + .withFailoverRequestProperties( + new FailoverRequestProperties().withSourceLocations(Arrays.asList("westus"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlansCreateOrUpdateSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlansCreateOrUpdateSamples.java new file mode 100644 index 000000000000..ba28f46cc684 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlansCreateOrUpdateSamples.java @@ -0,0 +1,445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryPlanInner; +import com.azure.resourcemanager.resiliencemanagement.models.AssociatedIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroup; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupCustomRunbookAction; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupProperties; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupsSetting; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanProperties; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanType; +import com.azure.resourcemanager.resiliencemanagement.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RecoveryPlans CreateOrUpdate. + */ +public final class RecoveryPlansCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlans_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlans_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlansCreateOrUpdateMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlans() + .createOrUpdate("sampleServiceGroupName", "samplePlanName", new RecoveryPlanInner() + .withProperties(new RecoveryPlanProperties().withPlanType(RecoveryPlanType.REGIONAL) + .withPlanDescription("Sample Plan") + .withRecoveryGroupsSetting(new RecoveryGroupsSetting() + .withDefaultGroup(new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(0) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withDescription("sample group action instructions") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))))) + .withAdditionalGroups(Arrays.asList( + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))))))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1", + new UserAssignedIdentity()))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlansDeleteSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlansDeleteSamples.java new file mode 100644 index 000000000000..e8491ec258d2 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlansDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for RecoveryPlans Delete. + */ +public final class RecoveryPlansDeleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlans_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlans_Delete_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlansDeleteMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlans().delete("sampleServiceGroupName", "samplePlanName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlansGetSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlansGetSamples.java new file mode 100644 index 000000000000..d32c2d479218 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlansGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for RecoveryPlans Get. + */ +public final class RecoveryPlansGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlans_Get_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlans_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + recoveryPlansGetMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlans() + .getWithResponse("sampleServiceGroupName", "samplePlanName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlansListSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlansListSamples.java new file mode 100644 index 000000000000..62386dfa3a10 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlansListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for RecoveryPlans List. + */ +public final class RecoveryPlansListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlans_List_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlans_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlansListMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlans().list("sampleServiceGroupName", "jfpmvvhtt", 44, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlansUpdateSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlansUpdateSamples.java new file mode 100644 index 000000000000..301c519f1977 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlansUpdateSamples.java @@ -0,0 +1,1269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryPlanInner; +import com.azure.resourcemanager.resiliencemanagement.models.AssociatedIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroup; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupCustomRunbookAction; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupProperties; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupsSetting; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanProperties; +import com.azure.resourcemanager.resiliencemanagement.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RecoveryPlans Update. + */ +public final class RecoveryPlansUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryPlans_Update_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryPlans_Update_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryPlansUpdateMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryPlans() + .update("sampleServiceGroupName", "samplePlanName", new RecoveryPlanInner() + .withProperties(new RecoveryPlanProperties().withPlanDescription("my sample recovery plan") + .withRecoveryGroupsSetting(new RecoveryGroupsSetting() + .withDefaultGroup(new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(3) + .withDescription("sample-recoverygroup") + .withPreActions(Arrays.asList( + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList( + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))))) + .withAdditionalGroups(Arrays.asList( + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))), + new RecoveryGroup().withProperties(new RecoveryGroupProperties() + .withGroupUniqueId("b7e2a1c4-9f3b-4e2d-8c6a-2f7e4d1b5a9f") + .withOrderId(1) + .withDescription("sample recoverygroup") + .withPreActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")))) + .withPostActions(Arrays.asList(new RecoveryGroupCustomRunbookAction() + .withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1")), + new RecoveryGroupCustomRunbookAction().withName("sample-group-action") + .withTimeoutInMinutes(29) + .withActionResourceId( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.Automation/automationAccounts/sampleAccount/runbooks/sameplRunbooks1") + .withParameters(mapOf("key7795", "fakeTokenPlaceholder")) + .withAssociatedIdentity(new AssociatedIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity( + "/subscriptions/4e88bed3-114f-443d-9975-28f64122ec5e/resourcegroups/resourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami1"))))))))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("key7088", new UserAssignedIdentity()))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryResourcesGetSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryResourcesGetSamples.java new file mode 100644 index 000000000000..f545a5fdfa61 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryResourcesGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for RecoveryResources Get. + */ +public final class RecoveryResourcesGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryResources_Get_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryResources_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryResourcesGetMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryResources() + .getWithResponse("sampleServiceGroupName", "samplePlanName", "12345678-9012-3456-7890-123456789012", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryResourcesListSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryResourcesListSamples.java new file mode 100644 index 000000000000..a31724494501 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryResourcesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for RecoveryResources List. + */ +public final class RecoveryResourcesListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/RecoveryResources_List_MaximumSet_Gen.json + */ + /** + * Sample code: RecoveryResources_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void recoveryResourcesListMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.recoveryResources().list("sampleServiceGroupName", "plan1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemsGetSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemsGetSamples.java new file mode 100644 index 000000000000..33386d0cc692 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for UnifiedResilienceItems Get. + */ +public final class UnifiedResilienceItemsGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/UnifiedResilienceItems_Get_MaximumSet_Gen.json + */ + /** + * Sample code: UnifiedResilienceItems_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void unifiedResilienceItemsGetMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.unifiedResilienceItems().getWithResponse("sg1", "uri1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemsListSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemsListSamples.java new file mode 100644 index 000000000000..84b8a95b15c9 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemsListSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for UnifiedResilienceItems List. + */ +public final class UnifiedResilienceItemsListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/UnifiedResilienceItems_List_MaximumSet_Gen.json + */ + /** + * Sample code: UnifiedResilienceItems_List_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void unifiedResilienceItemsListMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.unifiedResilienceItems() + .list("zldmpkvqzifygkqau", "xntbyoswztnmvitj", 69, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/UnifiedResilienceItems_List_MinimumSet_Gen.json + */ + /** + * Sample code: UnifiedResilienceItems_List_MaximumSet - generated by [MinimumSet] rule. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void unifiedResilienceItemsListMaximumSetGeneratedByMinimumSetRule( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.unifiedResilienceItems().list("sampleServiceGroupName", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansCreateOrUpdateSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansCreateOrUpdateSamples.java new file mode 100644 index 000000000000..40db14cff017 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansCreateOrUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.UsagePlanProperties; +import com.azure.resourcemanager.resiliencemanagement.models.UsagePlanType; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for UsagePlans CreateOrUpdate. + */ +public final class UsagePlansCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/UsagePlans_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: UsagePlans_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void usagePlansCreateOrUpdateMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.usagePlans() + .define("myUsagePlan") + .withRegion("global") + .withExistingResourceGroup("MyResourceGroup") + .withTags(mapOf("environment", "production")) + .withProperties(new UsagePlanProperties().withPlanType(UsagePlanType.STANDARD)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansDeleteSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansDeleteSamples.java new file mode 100644 index 000000000000..c0f894b979c7 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for UsagePlans Delete. + */ +public final class UsagePlansDeleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/UsagePlans_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: UsagePlans_Delete_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + usagePlansDeleteMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.usagePlans().delete("MyResourceGroup", "myUsagePlan", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansGetByResourceGroupSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansGetByResourceGroupSamples.java new file mode 100644 index 000000000000..4111a8924ce0 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for UsagePlans GetByResourceGroup. + */ +public final class UsagePlansGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-04-01-preview/UsagePlans_Get_MaximumSet_Gen.json + */ + /** + * Sample code: UsagePlans_Get_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + usagePlansGetMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.usagePlans() + .getByResourceGroupWithResponse("MyResourceGroup", "myUsagePlan", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansListByResourceGroupSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansListByResourceGroupSamples.java new file mode 100644 index 000000000000..7308b258cfcd --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for UsagePlans ListByResourceGroup. + */ +public final class UsagePlansListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-04-01-preview/UsagePlans_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: UsagePlans_ListByResourceGroup_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void usagePlansListByResourceGroupMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.usagePlans().listByResourceGroup("MyResourceGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansListSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansListSamples.java new file mode 100644 index 000000000000..3bf56581e39d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +/** + * Samples for UsagePlans List. + */ +public final class UsagePlansListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/UsagePlans_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: UsagePlans_ListBySubscription_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void usagePlansListBySubscriptionMaximumSet( + com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + manager.usagePlans().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansUpdateSamples.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansUpdateSamples.java new file mode 100644 index 000000000000..4e9d86e11f5c --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/samples/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlansUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.resourcemanager.resiliencemanagement.models.UsagePlan; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for UsagePlans Update. + */ +public final class UsagePlansUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/UsagePlans_Update_MaximumSet_Gen.json + */ + /** + * Sample code: UsagePlans_Update_MaximumSet. + * + * @param manager Entry point to ResilienceManagementManager. + */ + public static void + usagePlansUpdateMaximumSet(com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager manager) { + UsagePlan resource = manager.usagePlans() + .getByResourceGroupWithResponse("MyResourceGroup", "myUsagePlan", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("environment", "staging", "costCenter", "12345")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/AddOrUpdateResourcesRequestTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/AddOrUpdateResourcesRequestTests.java new file mode 100644 index 000000000000..e68c6a79316a --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/AddOrUpdateResourcesRequestTests.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.AddOrUpdateResourcesRequest; +import com.azure.resourcemanager.resiliencemanagement.models.CustomFaultDetails; +import com.azure.resourcemanager.resiliencemanagement.models.FaultDetails; +import com.azure.resourcemanager.resiliencemanagement.models.FaultProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ForceInclusionAndUpdate; +import com.azure.resourcemanager.resiliencemanagement.models.IncludeOrUpdateResource; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceLists; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class AddOrUpdateResourcesRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AddOrUpdateResourcesRequest model = BinaryData.fromString( + "{\"faultDurationInMin\":1651090930,\"resourceLists\":{\"includeResources\":[{\"id\":\"ao\",\"faultProperties\":{\"availableFaults\":[{\"faultUrn\":\"vcyy\",\"faultName\":\"s\",\"targetResourceId\":\"gdotcubiipuipwo\"},{\"faultUrn\":\"onmacjekniz\",\"faultName\":\"hqvcimpevfgmblr\",\"targetResourceId\":\"ilbywdxsm\"},{\"faultUrn\":\"ccwr\",\"faultName\":\"fscjfnynszquji\",\"targetResourceId\":\"dvoqyt\"}],\"defaultFault\":{\"faultUrn\":\"yo\",\"faultName\":\"bblgyavut\",\"targetResourceId\":\"thjoxoism\"},\"overriddenDefaultFault\":{\"faultUrn\":\"sbpimlq\",\"faultName\":\"ljxkcgxxlx\",\"targetResourceId\":\"ffgcvizqz\"},\"customFault\":{\"faultName\":\"l\",\"scriptResourceId\":\"w\"}}},{\"id\":\"youpfgfbkj\",\"faultProperties\":{\"availableFaults\":[{\"faultUrn\":\"hgkfmin\",\"faultName\":\"g\",\"targetResourceId\":\"wzf\"}],\"defaultFault\":{\"faultUrn\":\"sttktlahbqa\",\"faultName\":\"tx\",\"targetResourceId\":\"gzukxitmm\"},\"overriddenDefaultFault\":{\"faultUrn\":\"gqqqxh\",\"faultName\":\"n\",\"targetResourceId\":\"rxcpjuisavo\"},\"customFault\":{\"faultName\":\"dzf\",\"scriptResourceId\":\"azivjlfrqttbajl\"}}},{\"id\":\"atnwxyiopi\",\"faultProperties\":{\"availableFaults\":[{\"faultUrn\":\"fku\",\"faultName\":\"s\",\"targetResourceId\":\"xkdmligo\"},{\"faultUrn\":\"ibrxkp\",\"faultName\":\"loazuruocbgoo\",\"targetResourceId\":\"bteoybf\"},{\"faultUrn\":\"jxakv\",\"faultName\":\"jgslordilmyww\",\"targetResourceId\":\"kgkxn\"},{\"faultUrn\":\"edabgyvudtjue\",\"faultName\":\"bcihxuuwhc\",\"targetResourceId\":\"yxccyb\"}],\"defaultFault\":{\"faultUrn\":\"ayakkudzpx\",\"faultName\":\"wjplma\",\"targetResourceId\":\"stcyohpfkyrkdbd\"},\"overriddenDefaultFault\":{\"faultUrn\":\"ogsjkmnwqjno\",\"faultName\":\"aiy\",\"targetResourceId\":\"ddviacegfnmntfpm\"},\"customFault\":{\"faultName\":\"emfnczdwvvbal\",\"scriptResourceId\":\"lllchpodb\"}}}],\"excludeResources\":[\"wrd\",\"hfuk\",\"vsjcswsmystuluqy\",\"fcvlerch\"],\"updateResources\":[{\"id\":\"mfpjbabw\",\"faultProperties\":{\"availableFaults\":[{\"faultUrn\":\"xsspuunnoxyhk\",\"faultName\":\"g\",\"targetResourceId\":\"ddrihpf\"},{\"faultUrn\":\"oqcaaewdaomdj\",\"faultName\":\"l\",\"targetResourceId\":\"jxxkzbrmsgei\"},{\"faultUrn\":\"siykzkdncjdxonbz\",\"faultName\":\"ggcula\",\"targetResourceId\":\"z\"},{\"faultUrn\":\"y\",\"faultName\":\"pgogtqxepny\",\"targetResourceId\":\"b\"}],\"defaultFault\":{\"faultUrn\":\"ajlyjtlvofqzhv\",\"faultName\":\"cib\",\"targetResourceId\":\"fmo\"},\"overriddenDefaultFault\":{\"faultUrn\":\"xrkjpvdw\",\"faultName\":\"fzwiivwzjbhyz\",\"targetResourceId\":\"xjrk\"},\"customFault\":{\"faultName\":\"btrnegvm\",\"scriptResourceId\":\"vuqeqvldspast\"}}}]},\"forceInclusionAndUpdate\":\"Enable\"}") + .toObject(AddOrUpdateResourcesRequest.class); + Assertions.assertEquals(1651090930, model.faultDurationInMin()); + Assertions.assertEquals("ao", model.resourceLists().includeResources().get(0).id()); + Assertions.assertEquals("sbpimlq", + model.resourceLists().includeResources().get(0).faultProperties().overriddenDefaultFault().faultUrn()); + Assertions.assertEquals("ljxkcgxxlx", + model.resourceLists().includeResources().get(0).faultProperties().overriddenDefaultFault().faultName()); + Assertions.assertEquals("ffgcvizqz", + model.resourceLists() + .includeResources() + .get(0) + .faultProperties() + .overriddenDefaultFault() + .targetResourceId()); + Assertions.assertEquals("l", + model.resourceLists().includeResources().get(0).faultProperties().customFault().faultName()); + Assertions.assertEquals("w", + model.resourceLists().includeResources().get(0).faultProperties().customFault().scriptResourceId()); + Assertions.assertEquals("wrd", model.resourceLists().excludeResources().get(0)); + Assertions.assertEquals("mfpjbabw", model.resourceLists().updateResources().get(0).id()); + Assertions.assertEquals("xrkjpvdw", + model.resourceLists().updateResources().get(0).faultProperties().overriddenDefaultFault().faultUrn()); + Assertions.assertEquals("fzwiivwzjbhyz", + model.resourceLists().updateResources().get(0).faultProperties().overriddenDefaultFault().faultName()); + Assertions.assertEquals("xjrk", + model.resourceLists() + .updateResources() + .get(0) + .faultProperties() + .overriddenDefaultFault() + .targetResourceId()); + Assertions.assertEquals("btrnegvm", + model.resourceLists().updateResources().get(0).faultProperties().customFault().faultName()); + Assertions.assertEquals("vuqeqvldspast", + model.resourceLists().updateResources().get(0).faultProperties().customFault().scriptResourceId()); + Assertions.assertEquals(ForceInclusionAndUpdate.ENABLE, model.forceInclusionAndUpdate()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AddOrUpdateResourcesRequest model = new AddOrUpdateResourcesRequest().withFaultDurationInMin(1651090930) + .withResourceLists(new ResourceLists() + .withIncludeResources(Arrays.asList( + new IncludeOrUpdateResource().withId("ao") + .withFaultProperties(new FaultProperties() + .withOverriddenDefaultFault(new FaultDetails().withFaultUrn("sbpimlq") + .withFaultName("ljxkcgxxlx") + .withTargetResourceId("ffgcvizqz")) + .withCustomFault(new CustomFaultDetails().withFaultName("l").withScriptResourceId("w"))), + new IncludeOrUpdateResource().withId("youpfgfbkj") + .withFaultProperties(new FaultProperties() + .withOverriddenDefaultFault(new FaultDetails().withFaultUrn("gqqqxh") + .withFaultName("n") + .withTargetResourceId("rxcpjuisavo")) + .withCustomFault( + new CustomFaultDetails().withFaultName("dzf").withScriptResourceId("azivjlfrqttbajl"))), + new IncludeOrUpdateResource().withId("atnwxyiopi") + .withFaultProperties(new FaultProperties() + .withOverriddenDefaultFault(new FaultDetails().withFaultUrn("ogsjkmnwqjno") + .withFaultName("aiy") + .withTargetResourceId("ddviacegfnmntfpm")) + .withCustomFault(new CustomFaultDetails().withFaultName("emfnczdwvvbal") + .withScriptResourceId("lllchpodb"))))) + .withExcludeResources(Arrays.asList("wrd", "hfuk", "vsjcswsmystuluqy", "fcvlerch")) + .withUpdateResources(Arrays.asList(new IncludeOrUpdateResource().withId("mfpjbabw") + .withFaultProperties(new FaultProperties() + .withOverriddenDefaultFault(new FaultDetails().withFaultUrn("xrkjpvdw") + .withFaultName("fzwiivwzjbhyz") + .withTargetResourceId("xjrk")) + .withCustomFault(new CustomFaultDetails().withFaultName("btrnegvm") + .withScriptResourceId("vuqeqvldspast")))))) + .withForceInclusionAndUpdate(ForceInclusionAndUpdate.ENABLE); + model = BinaryData.fromObject(model).toObject(AddOrUpdateResourcesRequest.class); + Assertions.assertEquals(1651090930, model.faultDurationInMin()); + Assertions.assertEquals("ao", model.resourceLists().includeResources().get(0).id()); + Assertions.assertEquals("sbpimlq", + model.resourceLists().includeResources().get(0).faultProperties().overriddenDefaultFault().faultUrn()); + Assertions.assertEquals("ljxkcgxxlx", + model.resourceLists().includeResources().get(0).faultProperties().overriddenDefaultFault().faultName()); + Assertions.assertEquals("ffgcvizqz", + model.resourceLists() + .includeResources() + .get(0) + .faultProperties() + .overriddenDefaultFault() + .targetResourceId()); + Assertions.assertEquals("l", + model.resourceLists().includeResources().get(0).faultProperties().customFault().faultName()); + Assertions.assertEquals("w", + model.resourceLists().includeResources().get(0).faultProperties().customFault().scriptResourceId()); + Assertions.assertEquals("wrd", model.resourceLists().excludeResources().get(0)); + Assertions.assertEquals("mfpjbabw", model.resourceLists().updateResources().get(0).id()); + Assertions.assertEquals("xrkjpvdw", + model.resourceLists().updateResources().get(0).faultProperties().overriddenDefaultFault().faultUrn()); + Assertions.assertEquals("fzwiivwzjbhyz", + model.resourceLists().updateResources().get(0).faultProperties().overriddenDefaultFault().faultName()); + Assertions.assertEquals("xjrk", + model.resourceLists() + .updateResources() + .get(0) + .faultProperties() + .overriddenDefaultFault() + .targetResourceId()); + Assertions.assertEquals("btrnegvm", + model.resourceLists().updateResources().get(0).faultProperties().customFault().faultName()); + Assertions.assertEquals("vuqeqvldspast", + model.resourceLists().updateResources().get(0).faultProperties().customFault().scriptResourceId()); + Assertions.assertEquals(ForceInclusionAndUpdate.ENABLE, model.forceInclusionAndUpdate()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/AssetPropertiesOfDrillTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/AssetPropertiesOfDrillTests.java new file mode 100644 index 000000000000..dc613123b9a5 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/AssetPropertiesOfDrillTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.AssetPropertiesOfDrill; +import org.junit.jupiter.api.Assertions; + +public final class AssetPropertiesOfDrillTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AssetPropertiesOfDrill model = BinaryData + .fromString("{\"subscription\":\"vvt\",\"region\":\"seinqfiuf\",\"resourceGroup\":\"knpirgnepttwq\"}") + .toObject(AssetPropertiesOfDrill.class); + Assertions.assertEquals("vvt", model.subscription()); + Assertions.assertEquals("seinqfiuf", model.region()); + Assertions.assertEquals("knpirgnepttwq", model.resourceGroup()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AssetPropertiesOfDrill model = new AssetPropertiesOfDrill().withSubscription("vvt") + .withRegion("seinqfiuf") + .withResourceGroup("knpirgnepttwq"); + model = BinaryData.fromObject(model).toObject(AssetPropertiesOfDrill.class); + Assertions.assertEquals("vvt", model.subscription()); + Assertions.assertEquals("seinqfiuf", model.region()); + Assertions.assertEquals("knpirgnepttwq", model.resourceGroup()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/AssociatedIdentityTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/AssociatedIdentityTests.java new file mode 100644 index 000000000000..f4b79e5ab501 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/AssociatedIdentityTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.AssociatedIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import org.junit.jupiter.api.Assertions; + +public final class AssociatedIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AssociatedIdentity model + = BinaryData.fromString("{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"ybyxc\"}") + .toObject(AssociatedIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); + Assertions.assertEquals("ybyxc", model.userAssignedIdentity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AssociatedIdentity model = new AssociatedIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity("ybyxc"); + model = BinaryData.fromObject(model).toObject(AssociatedIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); + Assertions.assertEquals("ybyxc", model.userAssignedIdentity()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ChaosResourcePropertiesOfDrillTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ChaosResourcePropertiesOfDrillTests.java new file mode 100644 index 000000000000..70fe559d622f --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ChaosResourcePropertiesOfDrillTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.AssociatedIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ChaosResourcePropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import org.junit.jupiter.api.Assertions; + +public final class ChaosResourcePropertiesOfDrillTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ChaosResourcePropertiesOfDrill model = BinaryData.fromString( + "{\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"iffcdmqnrojlpijn\"},\"chaosResourceIdentityForFaults\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"frddhcrati\"},\"chaosResourceId\":\"ronasxift\",\"faultDurationInMin\":1206467391}") + .toObject(ChaosResourcePropertiesOfDrill.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); + Assertions.assertEquals("iffcdmqnrojlpijn", model.identity().userAssignedIdentity()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, + model.chaosResourceIdentityForFaults().type()); + Assertions.assertEquals("frddhcrati", model.chaosResourceIdentityForFaults().userAssignedIdentity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ChaosResourcePropertiesOfDrill model = new ChaosResourcePropertiesOfDrill() + .withIdentity(new AssociatedIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentity("iffcdmqnrojlpijn")) + .withChaosResourceIdentityForFaults( + new AssociatedIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentity("frddhcrati")); + model = BinaryData.fromObject(model).toObject(ChaosResourcePropertiesOfDrill.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); + Assertions.assertEquals("iffcdmqnrojlpijn", model.identity().userAssignedIdentity()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, + model.chaosResourceIdentityForFaults().type()); + Assertions.assertEquals("frddhcrati", model.chaosResourceIdentityForFaults().userAssignedIdentity()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/CustomFaultDetailsTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/CustomFaultDetailsTests.java new file mode 100644 index 000000000000..3e398dec7dce --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/CustomFaultDetailsTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.CustomFaultDetails; +import org.junit.jupiter.api.Assertions; + +public final class CustomFaultDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CustomFaultDetails model + = BinaryData.fromString("{\"faultName\":\"biorktal\",\"scriptResourceId\":\"wjhhgdnhxmsivf\"}") + .toObject(CustomFaultDetails.class); + Assertions.assertEquals("biorktal", model.faultName()); + Assertions.assertEquals("wjhhgdnhxmsivf", model.scriptResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CustomFaultDetails model + = new CustomFaultDetails().withFaultName("biorktal").withScriptResourceId("wjhhgdnhxmsivf"); + model = BinaryData.fromObject(model).toObject(CustomFaultDetails.class); + Assertions.assertEquals("biorktal", model.faultName()); + Assertions.assertEquals("wjhhgdnhxmsivf", model.scriptResourceId()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DiskReprotectInputDetailsTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DiskReprotectInputDetailsTests.java new file mode 100644 index 000000000000..acc09a691698 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DiskReprotectInputDetailsTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.DiskReprotectInputDetails; +import org.junit.jupiter.api.Assertions; + +public final class DiskReprotectInputDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DiskReprotectInputDetails model + = BinaryData.fromString("{\"diskResourceId\":\"v\",\"stagingStorageAccountResourceId\":\"xclvit\"}") + .toObject(DiskReprotectInputDetails.class); + Assertions.assertEquals("v", model.diskResourceId()); + Assertions.assertEquals("xclvit", model.stagingStorageAccountResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DiskReprotectInputDetails model + = new DiskReprotectInputDetails().withDiskResourceId("v").withStagingStorageAccountResourceId("xclvit"); + model = BinaryData.fromObject(model).toObject(DiskReprotectInputDetails.class); + Assertions.assertEquals("v", model.diskResourceId()); + Assertions.assertEquals("xclvit", model.stagingStorageAccountResourceId()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillEndRequestTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillEndRequestTests.java new file mode 100644 index 000000000000..547ddf745413 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillEndRequestTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.DrillAttestation; +import com.azure.resourcemanager.resiliencemanagement.models.DrillEndRequest; +import org.junit.jupiter.api.Assertions; + +public final class DrillEndRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DrillEndRequest model + = BinaryData.fromString("{\"attestation\":\"Failed\",\"attestationNotes\":\"loxggdufiqn\"}") + .toObject(DrillEndRequest.class); + Assertions.assertEquals(DrillAttestation.ATTESTED_FAILED, model.attestation()); + Assertions.assertEquals("loxggdufiqn", model.attestationNotes()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DrillEndRequest model = new DrillEndRequest().withAttestation(DrillAttestation.ATTESTED_FAILED) + .withAttestationNotes("loxggdufiqn"); + model = BinaryData.fromObject(model).toObject(DrillEndRequest.class); + Assertions.assertEquals(DrillAttestation.ATTESTED_FAILED, model.attestation()); + Assertions.assertEquals("loxggdufiqn", model.attestationNotes()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillResourceAttentionReasonTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillResourceAttentionReasonTests.java new file mode 100644 index 000000000000..386a599d9b62 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillResourceAttentionReasonTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.DrillResourceAttentionReason; +import com.azure.resourcemanager.resiliencemanagement.models.DrillResourceState; +import com.azure.resourcemanager.resiliencemanagement.models.RBACState; +import org.junit.jupiter.api.Assertions; + +public final class DrillResourceAttentionReasonTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DrillResourceAttentionReason model = BinaryData.fromString( + "{\"faultRbacOnTargetResource\":\"NotSet\",\"runbookFaultRbacOnTargets\":\"Set\",\"monitoringRbacOnTargets\":\"Set\",\"resourceState\":[\"InServiceGroupNotInDrill\",\"InDrillNotInServiceGroup\",\"InDrillNotInRecoveryPlan\",\"InServiceGroupNotInDrill\"]}") + .toObject(DrillResourceAttentionReason.class); + Assertions.assertEquals(RBACState.NOT_SET, model.faultRbacOnTargetResource()); + Assertions.assertEquals(RBACState.SET, model.runbookFaultRbacOnTargets()); + Assertions.assertEquals(RBACState.SET, model.monitoringRbacOnTargets()); + Assertions.assertEquals(DrillResourceState.IN_SERVICE_GROUP_NOT_IN_DRILL, model.resourceState().get(0)); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunAddNotesRequestTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunAddNotesRequestTests.java new file mode 100644 index 000000000000..fe1d9431d58a --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunAddNotesRequestTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunAddNotesRequest; +import org.junit.jupiter.api.Assertions; + +public final class DrillRunAddNotesRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DrillRunAddNotesRequest model = BinaryData + .fromString("{\"notes\":\"jeamurv\",\"timestamp\":\"2021-04-02T13:13Z\",\"author\":\"vuanashcxlp\"}") + .toObject(DrillRunAddNotesRequest.class); + Assertions.assertEquals("jeamurv", model.notes()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DrillRunAddNotesRequest model = new DrillRunAddNotesRequest().withNotes("jeamurv"); + model = BinaryData.fromObject(model).toObject(DrillRunAddNotesRequest.class); + Assertions.assertEquals("jeamurv", model.notes()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunFailoverRequestTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunFailoverRequestTests.java new file mode 100644 index 000000000000..5fc92d04e31a --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunFailoverRequestTests.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.AutoFailover; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunFailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.ExecutionConfigurations; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverDirectionTypes; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequestProperties; +import com.azure.resourcemanager.resiliencemanagement.models.UserConsent; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class DrillRunFailoverRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DrillRunFailoverRequest model = BinaryData.fromString( + "{\"autoFailover\":\"Disable\",\"failoverProperties\":{\"failoverDirection\":\"FromSpecificLocations\",\"failoverRequestProperties\":{\"sourceLocations\":[\"rhqvwrevkh\",\"nlnzonzlrpi\"],\"selectedResourceIds\":[\"ncvjts\",\"cof\",\"zehtdhgb\",\"k\"],\"executionConfigurations\":{\"userConsent\":\"Allowed\"}}}}") + .toObject(DrillRunFailoverRequest.class); + Assertions.assertEquals(AutoFailover.DISABLE, model.autoFailover()); + Assertions.assertEquals(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS, + model.failoverProperties().failoverDirection()); + Assertions.assertEquals("rhqvwrevkh", + model.failoverProperties().failoverRequestProperties().sourceLocations().get(0)); + Assertions.assertEquals("ncvjts", + model.failoverProperties().failoverRequestProperties().selectedResourceIds().get(0)); + Assertions.assertEquals(UserConsent.ALLOWED, + model.failoverProperties().failoverRequestProperties().executionConfigurations().userConsent()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DrillRunFailoverRequest model = new DrillRunFailoverRequest().withAutoFailover(AutoFailover.DISABLE) + .withFailoverProperties(new FailoverRequest() + .withFailoverDirection(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS) + .withFailoverRequestProperties(new FailoverRequestProperties() + .withSourceLocations(Arrays.asList("rhqvwrevkh", "nlnzonzlrpi")) + .withSelectedResourceIds(Arrays.asList("ncvjts", "cof", "zehtdhgb", "k")) + .withExecutionConfigurations(new ExecutionConfigurations().withUserConsent(UserConsent.ALLOWED)))); + model = BinaryData.fromObject(model).toObject(DrillRunFailoverRequest.class); + Assertions.assertEquals(AutoFailover.DISABLE, model.autoFailover()); + Assertions.assertEquals(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS, + model.failoverProperties().failoverDirection()); + Assertions.assertEquals("rhqvwrevkh", + model.failoverProperties().failoverRequestProperties().sourceLocations().get(0)); + Assertions.assertEquals("ncvjts", + model.failoverProperties().failoverRequestProperties().selectedResourceIds().get(0)); + Assertions.assertEquals(UserConsent.ALLOWED, + model.failoverProperties().failoverRequestProperties().executionConfigurations().userConsent()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsAddNotesMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsAddNotesMockTests.java new file mode 100644 index 000000000000..18f8b1179e9c --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsAddNotesMockTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunAddNotesRequest; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DrillRunsAddNotesMockTests { + @Test + public void testAddNotes() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.drillRuns() + .addNotes("jodqhykincn", "emehllizh", "eumoqod", "adppyibn", + new DrillRunAddNotesRequest().withNotes("ladywrxwhyd"), com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsFailOverMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsFailOverMockTests.java new file mode 100644 index 000000000000..9ea228fc9dde --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsFailOverMockTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.AutoFailover; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunFailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.ExecutionConfigurations; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverDirectionTypes; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequestProperties; +import com.azure.resourcemanager.resiliencemanagement.models.UserConsent; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DrillRunsFailOverMockTests { + @Test + public void testFailOver() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.drillRuns() + .failOver("owegmmutey", "eyguq", "gijiitnspxlzd", "sygrijwa", + new DrillRunFailoverRequest().withAutoFailover(AutoFailover.ENABLE) + .withFailoverProperties( + new FailoverRequest().withFailoverDirection(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS) + .withFailoverRequestProperties( + new FailoverRequestProperties().withSourceLocations(Arrays.asList("raybfueqfr")) + .withSelectedResourceIds(Arrays.asList("ydgr", "ydkygywezskieca", "ygzmxieqvdsmak")) + .withExecutionConfigurations( + new ExecutionConfigurations().withUserConsent(UserConsent.UNSPECIFIED)))), + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsMarkAsCompleteMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsMarkAsCompleteMockTests.java new file mode 100644 index 000000000000..054bd6e7cd1a --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsMarkAsCompleteMockTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunSubtasks; +import com.azure.resourcemanager.resiliencemanagement.models.MarkAsCompleteRequest; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DrillRunsMarkAsCompleteMockTests { + @Test + public void testMarkAsComplete() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.drillRuns() + .markAsComplete("ih", "vjdrqcrjidhftuk", "hdxlw", "ojbf", + new MarkAsCompleteRequest().withDrillRunStage(DrillRunSubtasks.FAILOVER_REVERSE), + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsReprotectMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsReprotectMockTests.java new file mode 100644 index 000000000000..e135331f6fb0 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsReprotectMockTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DrillRunsReprotectMockTests { + @Test + public void testReprotect() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.drillRuns().reprotect("qcahyhxal", "bx", "woijpodtbl", "pkkwj", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsResumeMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsResumeMockTests.java new file mode 100644 index 000000000000..59ab5d2b33ff --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillRunsResumeMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DrillRunsResumeMockTests { + @Test + public void testResume() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.drillRuns() + .resume("uyem", "owuowh", "xlnwyrmouvblgmo", "zkltrfowtdvrfmv", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillStartRequestTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillStartRequestTests.java new file mode 100644 index 000000000000..09c019d7785b --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillStartRequestTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.DrillMode; +import com.azure.resourcemanager.resiliencemanagement.models.DrillStartRequest; +import org.junit.jupiter.api.Assertions; + +public final class DrillStartRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DrillStartRequest model = BinaryData.fromString("{\"mode\":\"Failover\"}").toObject(DrillStartRequest.class); + Assertions.assertEquals(DrillMode.FAILOVER, model.mode()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DrillStartRequest model = new DrillStartRequest().withMode(DrillMode.FAILOVER); + model = BinaryData.fromObject(model).toObject(DrillStartRequest.class); + Assertions.assertEquals(DrillMode.FAILOVER, model.mode()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillUpdatePropertiesTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillUpdatePropertiesTests.java new file mode 100644 index 000000000000..30faac2626ef --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillUpdatePropertiesTests.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.AssetPropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.AssociatedIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ChaosResourcePropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.DrillUpdateProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.MonitoringPropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.RBACSetupMode; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanPropertiesOfDrill; +import org.junit.jupiter.api.Assertions; + +public final class DrillUpdatePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DrillUpdateProperties model = BinaryData.fromString( + "{\"recoveryPlanProperties\":{\"identity\":{\"type\":\"None\",\"userAssignedIdentity\":\"rpxeh\"},\"recoveryPlanId\":\"rykqgaifmvikl\",\"recoveryPlanResourceExcludedCount\":703238637},\"drillAssetProperties\":{\"subscription\":\"khbejdznxc\",\"region\":\"dsrhnjiv\",\"resourceGroup\":\"v\"},\"chaosResourceProperties\":{\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"qfzgemjdftul\"},\"chaosResourceIdentityForFaults\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"duceamtmc\"},\"chaosResourceId\":\"o\",\"faultDurationInMin\":418634069},\"rbacSetupMode\":\"Manual\",\"monitoringProperties\":{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"oknssxmojmsvpkjp\"},\"logAnalyticsWorkspaceId\":\"kwcf\",\"rawMetricsDataCollectionRuleId\":\"ljyxgtczhe\",\"serviceGroupMetricsDataCollectionRuleId\":\"bsdshmkxmaehvbbx\",\"dataCollectionEndpointId\":\"iplt\"}}") + .toObject(DrillUpdateProperties.class); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.recoveryPlanProperties().identity().type()); + Assertions.assertEquals("rpxeh", model.recoveryPlanProperties().identity().userAssignedIdentity()); + Assertions.assertEquals("khbejdznxc", model.drillAssetProperties().subscription()); + Assertions.assertEquals("dsrhnjiv", model.drillAssetProperties().region()); + Assertions.assertEquals("v", model.drillAssetProperties().resourceGroup()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, + model.chaosResourceProperties().identity().type()); + Assertions.assertEquals("qfzgemjdftul", model.chaosResourceProperties().identity().userAssignedIdentity()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, + model.chaosResourceProperties().chaosResourceIdentityForFaults().type()); + Assertions.assertEquals("duceamtmc", + model.chaosResourceProperties().chaosResourceIdentityForFaults().userAssignedIdentity()); + Assertions.assertEquals(RBACSetupMode.MANUAL, model.rbacSetupMode()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, + model.monitoringProperties().identity().type()); + Assertions.assertEquals("oknssxmojmsvpkjp", model.monitoringProperties().identity().userAssignedIdentity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DrillUpdateProperties model = new DrillUpdateProperties() + .withRecoveryPlanProperties(new RecoveryPlanPropertiesOfDrill().withIdentity( + new AssociatedIdentity().withType(ManagedServiceIdentityType.NONE).withUserAssignedIdentity("rpxeh"))) + .withDrillAssetProperties(new AssetPropertiesOfDrill().withSubscription("khbejdznxc") + .withRegion("dsrhnjiv") + .withResourceGroup("v")) + .withChaosResourceProperties(new ChaosResourcePropertiesOfDrill() + .withIdentity(new AssociatedIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentity("qfzgemjdftul")) + .withChaosResourceIdentityForFaults( + new AssociatedIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentity("duceamtmc"))) + .withRbacSetupMode(RBACSetupMode.MANUAL) + .withMonitoringProperties(new MonitoringPropertiesOfDrill() + .withIdentity(new AssociatedIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity("oknssxmojmsvpkjp"))); + model = BinaryData.fromObject(model).toObject(DrillUpdateProperties.class); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.recoveryPlanProperties().identity().type()); + Assertions.assertEquals("rpxeh", model.recoveryPlanProperties().identity().userAssignedIdentity()); + Assertions.assertEquals("khbejdznxc", model.drillAssetProperties().subscription()); + Assertions.assertEquals("dsrhnjiv", model.drillAssetProperties().region()); + Assertions.assertEquals("v", model.drillAssetProperties().resourceGroup()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, + model.chaosResourceProperties().identity().type()); + Assertions.assertEquals("qfzgemjdftul", model.chaosResourceProperties().identity().userAssignedIdentity()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, + model.chaosResourceProperties().chaosResourceIdentityForFaults().type()); + Assertions.assertEquals("duceamtmc", + model.chaosResourceProperties().chaosResourceIdentityForFaults().userAssignedIdentity()); + Assertions.assertEquals(RBACSetupMode.MANUAL, model.rbacSetupMode()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, + model.monitoringProperties().identity().type()); + Assertions.assertEquals("oknssxmojmsvpkjp", model.monitoringProperties().identity().userAssignedIdentity()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillUpdateTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillUpdateTests.java new file mode 100644 index 000000000000..04f91d17adf2 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillUpdateTests.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.AssetPropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.AssociatedIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ChaosResourcePropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.DrillUpdate; +import com.azure.resourcemanager.resiliencemanagement.models.DrillUpdateProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.MonitoringPropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.RBACSetupMode; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanPropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class DrillUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DrillUpdate model = BinaryData.fromString( + "{\"identity\":{\"principalId\":\"ye\",\"tenantId\":\"ymsgaojfmwnc\",\"type\":\"None\",\"userAssignedIdentities\":{\"usps\":{\"principalId\":\"hirctymoxoftpipi\",\"clientId\":\"czuhxacpqjlihh\"}}},\"properties\":{\"recoveryPlanProperties\":{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"lmfwdgzx\"},\"recoveryPlanId\":\"ucvpamrs\",\"recoveryPlanResourceExcludedCount\":856089944},\"drillAssetProperties\":{\"subscription\":\"vxurisjnhnytxifq\",\"region\":\"zgxmr\",\"resourceGroup\":\"blwpcesutrgj\"},\"chaosResourceProperties\":{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"utpwoqhihejqgw\"},\"chaosResourceIdentityForFaults\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"fqntcyp\"},\"chaosResourceId\":\"jv\",\"faultDurationInMin\":1058520064},\"rbacSetupMode\":\"AutomatedCustomRole\",\"monitoringProperties\":{\"identity\":{\"type\":\"None\",\"userAssignedIdentity\":\"rcizjxvyd\"},\"logAnalyticsWorkspaceId\":\"eacvl\",\"rawMetricsDataCollectionRuleId\":\"ygdyftumrtw\",\"serviceGroupMetricsDataCollectionRuleId\":\"wjslbiwkojgcyzt\",\"dataCollectionEndpointId\":\"mznbaeqphch\"}}}") + .toObject(DrillUpdate.class); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, + model.properties().recoveryPlanProperties().identity().type()); + Assertions.assertEquals("lmfwdgzx", + model.properties().recoveryPlanProperties().identity().userAssignedIdentity()); + Assertions.assertEquals("vxurisjnhnytxifq", model.properties().drillAssetProperties().subscription()); + Assertions.assertEquals("zgxmr", model.properties().drillAssetProperties().region()); + Assertions.assertEquals("blwpcesutrgj", model.properties().drillAssetProperties().resourceGroup()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, + model.properties().chaosResourceProperties().identity().type()); + Assertions.assertEquals("utpwoqhihejqgw", + model.properties().chaosResourceProperties().identity().userAssignedIdentity()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, + model.properties().chaosResourceProperties().chaosResourceIdentityForFaults().type()); + Assertions.assertEquals("fqntcyp", + model.properties().chaosResourceProperties().chaosResourceIdentityForFaults().userAssignedIdentity()); + Assertions.assertEquals(RBACSetupMode.AUTOMATED_CUSTOM_ROLE, model.properties().rbacSetupMode()); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, + model.properties().monitoringProperties().identity().type()); + Assertions.assertEquals("rcizjxvyd", + model.properties().monitoringProperties().identity().userAssignedIdentity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DrillUpdate model = new DrillUpdate() + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("usps", new UserAssignedIdentity()))) + .withProperties(new DrillUpdateProperties() + .withRecoveryPlanProperties(new RecoveryPlanPropertiesOfDrill() + .withIdentity(new AssociatedIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity("lmfwdgzx"))) + .withDrillAssetProperties(new AssetPropertiesOfDrill().withSubscription("vxurisjnhnytxifq") + .withRegion("zgxmr") + .withResourceGroup("blwpcesutrgj")) + .withChaosResourceProperties(new ChaosResourcePropertiesOfDrill() + .withIdentity(new AssociatedIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity("utpwoqhihejqgw")) + .withChaosResourceIdentityForFaults( + new AssociatedIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentity("fqntcyp"))) + .withRbacSetupMode(RBACSetupMode.AUTOMATED_CUSTOM_ROLE) + .withMonitoringProperties(new MonitoringPropertiesOfDrill() + .withIdentity(new AssociatedIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentity("rcizjxvyd")))); + model = BinaryData.fromObject(model).toObject(DrillUpdate.class); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, + model.properties().recoveryPlanProperties().identity().type()); + Assertions.assertEquals("lmfwdgzx", + model.properties().recoveryPlanProperties().identity().userAssignedIdentity()); + Assertions.assertEquals("vxurisjnhnytxifq", model.properties().drillAssetProperties().subscription()); + Assertions.assertEquals("zgxmr", model.properties().drillAssetProperties().region()); + Assertions.assertEquals("blwpcesutrgj", model.properties().drillAssetProperties().resourceGroup()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, + model.properties().chaosResourceProperties().identity().type()); + Assertions.assertEquals("utpwoqhihejqgw", + model.properties().chaosResourceProperties().identity().userAssignedIdentity()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, + model.properties().chaosResourceProperties().chaosResourceIdentityForFaults().type()); + Assertions.assertEquals("fqntcyp", + model.properties().chaosResourceProperties().chaosResourceIdentityForFaults().userAssignedIdentity()); + Assertions.assertEquals(RBACSetupMode.AUTOMATED_CUSTOM_ROLE, model.properties().rbacSetupMode()); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, + model.properties().monitoringProperties().identity().type()); + Assertions.assertEquals("rcizjxvyd", + model.properties().monitoringProperties().identity().userAssignedIdentity()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsEndMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsEndMockTests.java new file mode 100644 index 000000000000..389d9f4fefe2 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsEndMockTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.DrillAttestation; +import com.azure.resourcemanager.resiliencemanagement.models.DrillEndRequest; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DrillsEndMockTests { + @Test + public void testEnd() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.drills() + .end("cs", "yqwixvcpwnkwywzw", "falickduoiqtamty", + new DrillEndRequest().withAttestation(DrillAttestation.ATTESTED_FAILED).withAttestationNotes("kn"), + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsStartMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsStartMockTests.java new file mode 100644 index 000000000000..0c37c60a8be7 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsStartMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.DrillMode; +import com.azure.resourcemanager.resiliencemanagement.models.DrillStartRequest; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DrillsStartMockTests { + @Test + public void testStart() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.drills() + .start("uxx", "pmywbormcq", "iciijqpkzfbojx", new DrillStartRequest().withMode(DrillMode.FAILOVER), + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsUpdateMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsUpdateMockTests.java new file mode 100644 index 000000000000..86141ea99fbe --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsUpdateMockTests.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.AssetPropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.AssociatedIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ChaosResourcePropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.DrillUpdate; +import com.azure.resourcemanager.resiliencemanagement.models.DrillUpdateProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.MonitoringPropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.RBACSetupMode; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanPropertiesOfDrill; +import com.azure.resourcemanager.resiliencemanagement.models.UserAssignedIdentity; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DrillsUpdateMockTests { + @Test + public void testUpdate() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.drills() + .update("bcvex", "e", + new DrillUpdate() + .withIdentity( + new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("ykgsangpszng", new UserAssignedIdentity(), "ujcngo", + new UserAssignedIdentity()))) + .withProperties(new DrillUpdateProperties() + .withRecoveryPlanProperties(new RecoveryPlanPropertiesOfDrill().withIdentity( + new AssociatedIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentity("mzr"))) + .withDrillAssetProperties(new AssetPropertiesOfDrill().withSubscription("rgdg") + .withRegion("vcoqraswugyxpqi") + .withResourceGroup("eialwvskb")) + .withChaosResourceProperties(new ChaosResourcePropertiesOfDrill() + .withIdentity(new AssociatedIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentity("caqt")) + .withChaosResourceIdentityForFaults( + new AssociatedIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentity("co"))) + .withRbacSetupMode(RBACSetupMode.AUTOMATED_CUSTOM_ROLE) + .withMonitoringProperties(new MonitoringPropertiesOfDrill() + .withIdentity(new AssociatedIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentity("tjo")))), + com.azure.core.util.Context.NONE); + + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsValidateForExecutionMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsValidateForExecutionMockTests.java new file mode 100644 index 000000000000..5f9da27a6147 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/DrillsValidateForExecutionMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForExecutionProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForExecutionRequest; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DrillsValidateForExecutionMockTests { + @Test + public void testValidateForExecution() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.drills() + .validateForExecution("jb", "xjeaoqaqbzgyh", "w", + new ValidateForExecutionRequest() + .withValidateForExecutionProperties(new ValidateForExecutionProperties() + .withSourceLocations(Arrays.asList("atbwbqam", "e", "liys", "pkcvmwf"))), + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ExecutionConfigurationsTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ExecutionConfigurationsTests.java new file mode 100644 index 000000000000..0a60c6b859c5 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ExecutionConfigurationsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.ExecutionConfigurations; +import com.azure.resourcemanager.resiliencemanagement.models.UserConsent; +import org.junit.jupiter.api.Assertions; + +public final class ExecutionConfigurationsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ExecutionConfigurations model + = BinaryData.fromString("{\"userConsent\":\"Allowed\"}").toObject(ExecutionConfigurations.class); + Assertions.assertEquals(UserConsent.ALLOWED, model.userConsent()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ExecutionConfigurations model = new ExecutionConfigurations().withUserConsent(UserConsent.ALLOWED); + model = BinaryData.fromObject(model).toObject(ExecutionConfigurations.class); + Assertions.assertEquals(UserConsent.ALLOWED, model.userConsent()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/FailoverRequestPropertiesTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/FailoverRequestPropertiesTests.java new file mode 100644 index 000000000000..9551de00ea97 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/FailoverRequestPropertiesTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.ExecutionConfigurations; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequestProperties; +import com.azure.resourcemanager.resiliencemanagement.models.UserConsent; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class FailoverRequestPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FailoverRequestProperties model = BinaryData.fromString( + "{\"sourceLocations\":[\"lkdmtncvokotllxd\",\"h\",\"syocogjltdtbnnha\",\"oocrkvcikhnv\"],\"selectedResourceIds\":[\"qgxqquezikyw\"],\"executionConfigurations\":{\"userConsent\":\"Unspecified\"}}") + .toObject(FailoverRequestProperties.class); + Assertions.assertEquals("lkdmtncvokotllxd", model.sourceLocations().get(0)); + Assertions.assertEquals("qgxqquezikyw", model.selectedResourceIds().get(0)); + Assertions.assertEquals(UserConsent.UNSPECIFIED, model.executionConfigurations().userConsent()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FailoverRequestProperties model = new FailoverRequestProperties() + .withSourceLocations(Arrays.asList("lkdmtncvokotllxd", "h", "syocogjltdtbnnha", "oocrkvcikhnv")) + .withSelectedResourceIds(Arrays.asList("qgxqquezikyw")) + .withExecutionConfigurations(new ExecutionConfigurations().withUserConsent(UserConsent.UNSPECIFIED)); + model = BinaryData.fromObject(model).toObject(FailoverRequestProperties.class); + Assertions.assertEquals("lkdmtncvokotllxd", model.sourceLocations().get(0)); + Assertions.assertEquals("qgxqquezikyw", model.selectedResourceIds().get(0)); + Assertions.assertEquals(UserConsent.UNSPECIFIED, model.executionConfigurations().userConsent()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/FailoverRequestTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/FailoverRequestTests.java new file mode 100644 index 000000000000..f9cbc1c6ab8d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/FailoverRequestTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.ExecutionConfigurations; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverDirectionTypes; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequestProperties; +import com.azure.resourcemanager.resiliencemanagement.models.UserConsent; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class FailoverRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FailoverRequest model = BinaryData.fromString( + "{\"failoverDirection\":\"FromSpecificLocations\",\"failoverRequestProperties\":{\"sourceLocations\":[\"zbchckqqzqioxiy\",\"uiizynke\"],\"selectedResourceIds\":[\"trwyhqmib\",\"yhwitsmypyynpcdp\",\"mnzgmwznmabi\",\"nsorgjhxbldt\"],\"executionConfigurations\":{\"userConsent\":\"Unspecified\"}}}") + .toObject(FailoverRequest.class); + Assertions.assertEquals(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS, model.failoverDirection()); + Assertions.assertEquals("zbchckqqzqioxiy", model.failoverRequestProperties().sourceLocations().get(0)); + Assertions.assertEquals("trwyhqmib", model.failoverRequestProperties().selectedResourceIds().get(0)); + Assertions.assertEquals(UserConsent.UNSPECIFIED, + model.failoverRequestProperties().executionConfigurations().userConsent()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FailoverRequest model = new FailoverRequest() + .withFailoverDirection(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS) + .withFailoverRequestProperties(new FailoverRequestProperties() + .withSourceLocations(Arrays.asList("zbchckqqzqioxiy", "uiizynke")) + .withSelectedResourceIds(Arrays.asList("trwyhqmib", "yhwitsmypyynpcdp", "mnzgmwznmabi", "nsorgjhxbldt")) + .withExecutionConfigurations(new ExecutionConfigurations().withUserConsent(UserConsent.UNSPECIFIED))); + model = BinaryData.fromObject(model).toObject(FailoverRequest.class); + Assertions.assertEquals(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS, model.failoverDirection()); + Assertions.assertEquals("zbchckqqzqioxiy", model.failoverRequestProperties().sourceLocations().get(0)); + Assertions.assertEquals("trwyhqmib", model.failoverRequestProperties().selectedResourceIds().get(0)); + Assertions.assertEquals(UserConsent.UNSPECIFIED, + model.failoverRequestProperties().executionConfigurations().userConsent()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/FaultDetailsTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/FaultDetailsTests.java new file mode 100644 index 000000000000..a50beb932774 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/FaultDetailsTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.FaultDetails; +import org.junit.jupiter.api.Assertions; + +public final class FaultDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FaultDetails model = BinaryData + .fromString("{\"faultUrn\":\"epzl\",\"faultName\":\"phwzsoldweyuqdu\",\"targetResourceId\":\"vmnnrw\"}") + .toObject(FaultDetails.class); + Assertions.assertEquals("epzl", model.faultUrn()); + Assertions.assertEquals("phwzsoldweyuqdu", model.faultName()); + Assertions.assertEquals("vmnnrw", model.targetResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FaultDetails model + = new FaultDetails().withFaultUrn("epzl").withFaultName("phwzsoldweyuqdu").withTargetResourceId("vmnnrw"); + model = BinaryData.fromObject(model).toObject(FaultDetails.class); + Assertions.assertEquals("epzl", model.faultUrn()); + Assertions.assertEquals("phwzsoldweyuqdu", model.faultName()); + Assertions.assertEquals("vmnnrw", model.targetResourceId()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/FaultPropertiesTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/FaultPropertiesTests.java new file mode 100644 index 000000000000..cdf311610c1f --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/FaultPropertiesTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.CustomFaultDetails; +import com.azure.resourcemanager.resiliencemanagement.models.FaultDetails; +import com.azure.resourcemanager.resiliencemanagement.models.FaultProperties; +import org.junit.jupiter.api.Assertions; + +public final class FaultPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FaultProperties model = BinaryData.fromString( + "{\"availableFaults\":[{\"faultUrn\":\"zov\",\"faultName\":\"jjziuxxpsh\",\"targetResourceId\":\"eekulfgslqubkwd\"},{\"faultUrn\":\"enr\",\"faultName\":\"sutujba\",\"targetResourceId\":\"pjuohminyfl\"}],\"defaultFault\":{\"faultUrn\":\"rwm\",\"faultName\":\"uvwpklvxwmyg\",\"targetResourceId\":\"xpgpq\"},\"overriddenDefaultFault\":{\"faultUrn\":\"isze\",\"faultName\":\"nnbj\",\"targetResourceId\":\"rxgibbd\"},\"customFault\":{\"faultName\":\"confozauors\",\"scriptResourceId\":\"kokwbqplhlvnu\"}}") + .toObject(FaultProperties.class); + Assertions.assertEquals("isze", model.overriddenDefaultFault().faultUrn()); + Assertions.assertEquals("nnbj", model.overriddenDefaultFault().faultName()); + Assertions.assertEquals("rxgibbd", model.overriddenDefaultFault().targetResourceId()); + Assertions.assertEquals("confozauors", model.customFault().faultName()); + Assertions.assertEquals("kokwbqplhlvnu", model.customFault().scriptResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FaultProperties model = new FaultProperties() + .withOverriddenDefaultFault( + new FaultDetails().withFaultUrn("isze").withFaultName("nnbj").withTargetResourceId("rxgibbd")) + .withCustomFault( + new CustomFaultDetails().withFaultName("confozauors").withScriptResourceId("kokwbqplhlvnu")); + model = BinaryData.fromObject(model).toObject(FaultProperties.class); + Assertions.assertEquals("isze", model.overriddenDefaultFault().faultUrn()); + Assertions.assertEquals("nnbj", model.overriddenDefaultFault().faultName()); + Assertions.assertEquals("rxgibbd", model.overriddenDefaultFault().targetResourceId()); + Assertions.assertEquals("confozauors", model.customFault().faultName()); + Assertions.assertEquals("kokwbqplhlvnu", model.customFault().scriptResourceId()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsRecommendCapacityMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsRecommendCapacityMockTests.java new file mode 100644 index 000000000000..f10aa9ce26df --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsRecommendCapacityMockTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.RecommendCapacityRequest; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class GoalAssignmentsRecommendCapacityMockTests { + @Test + public void testRecommendCapacity() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.goalAssignments() + .recommendCapacity("gbqi", "kxkbsazgakgacyr", + new RecommendCapacityRequest().withResourceIds(Arrays.asList("jdmspofapvuhryln")), + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsRefreshGoalResourcesMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsRefreshGoalResourcesMockTests.java new file mode 100644 index 000000000000..d95c2f5a4355 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsRefreshGoalResourcesMockTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class GoalAssignmentsRefreshGoalResourcesMockTests { + @Test + public void testRefreshGoalResources() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.goalAssignments().refreshGoalResources("duragegizvc", "felisdjub", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsUpdateGoalResourcesMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsUpdateGoalResourcesMockTests.java new file mode 100644 index 000000000000..63c7197223ee --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalAssignmentsUpdateGoalResourcesMockTests.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalResourceInner; +import com.azure.resourcemanager.resiliencemanagement.models.AttestationState; +import com.azure.resourcemanager.resiliencemanagement.models.ConfirmationStatus; +import com.azure.resourcemanager.resiliencemanagement.models.ExclusionState; +import com.azure.resourcemanager.resiliencemanagement.models.GoalResourceProperties; +import com.azure.resourcemanager.resiliencemanagement.models.SolutionDisplayName; +import com.azure.resourcemanager.resiliencemanagement.models.UpdateGoalResourceRequest; +import com.azure.resourcemanager.resiliencemanagement.models.UserConfirmationForHighAvailabilityItem; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class GoalAssignmentsUpdateGoalResourcesMockTests { + @Test + public void testUpdateGoalResources() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.goalAssignments() + .updateGoalResources("yrio", "vzidsxwaab", new UpdateGoalResourceRequest().withResources(Arrays.asList( + new GoalResourceInner().withProperties(new GoalResourceProperties().withResourceArmId("frygznmmax") + .withHighAvailabilityGoalParticipation(ExclusionState.EXCLUDED) + .withHighAvailabilityAttestationStatus(AttestationState.MANUALLY_ATTESTED) + .withDisasterRecoveryGoalParticipation(ExclusionState.EXCLUDED) + .withDisasterRecoveryAttestationStatus(AttestationState.MANUALLY_ATTESTED) + .withUserConfirmationForHighAvailability(Arrays.asList(new UserConfirmationForHighAvailabilityItem() + .withSolutionDisplayName(SolutionDisplayName.ZONE_PINNED_VM_WITH_ZRS_DISK) + .withConfirmationStatus(ConfirmationStatus.APPROVAL_NOT_NEEDED)))), + new GoalResourceInner() + .withProperties(new GoalResourceProperties().withResourceArmId("amwabzxrvxcushsp") + .withHighAvailabilityGoalParticipation(ExclusionState.INCLUDED) + .withHighAvailabilityAttestationStatus(AttestationState.MANUALLY_ATTESTED) + .withDisasterRecoveryGoalParticipation(ExclusionState.INCLUDED) + .withDisasterRecoveryAttestationStatus(AttestationState.MANUALLY_ATTESTED) + .withUserConfirmationForHighAvailability(Arrays.asList( + new UserConfirmationForHighAvailabilityItem() + .withSolutionDisplayName(SolutionDisplayName.VM_IN_MULTI_ZONE_VMSS) + .withConfirmationStatus(ConfirmationStatus.APPROVAL_PENDING), + new UserConfirmationForHighAvailabilityItem() + .withSolutionDisplayName(SolutionDisplayName.ZONE_PINNED_VM_WITH_ZRS_DISK) + .withConfirmationStatus(ConfirmationStatus.APPROVED_BY_USER), + new UserConfirmationForHighAvailabilityItem() + .withSolutionDisplayName(SolutionDisplayName.ZONE_PINNED_VM_WITH_ZRS_DISK) + .withConfirmationStatus(ConfirmationStatus.APPROVAL_PENDING), + new UserConfirmationForHighAvailabilityItem() + .withSolutionDisplayName(SolutionDisplayName.ZONE_PINNED_VM_WITH_ZRS_DISK) + .withConfirmationStatus(ConfirmationStatus.APPROVED_BY_USER)))), + new GoalResourceInner().withProperties(new GoalResourceProperties().withResourceArmId("ql") + .withHighAvailabilityGoalParticipation(ExclusionState.INCLUDED) + .withHighAvailabilityAttestationStatus(AttestationState.NOT_ATTESTED) + .withDisasterRecoveryGoalParticipation(ExclusionState.EXCLUDED) + .withDisasterRecoveryAttestationStatus(AttestationState.MANUALLY_ATTESTED) + .withUserConfirmationForHighAvailability(Arrays.asList(new UserConfirmationForHighAvailabilityItem() + .withSolutionDisplayName(SolutionDisplayName.ZONE_PINNED_VM_WITH_ZRS_DISK) + .withConfirmationStatus(ConfirmationStatus.APPROVAL_NOT_NEEDED)))))), + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourceInnerTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourceInnerTests.java new file mode 100644 index 000000000000..31da887fbdfc --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourceInnerTests.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalResourceInner; +import com.azure.resourcemanager.resiliencemanagement.models.AttestationState; +import com.azure.resourcemanager.resiliencemanagement.models.ConfirmationStatus; +import com.azure.resourcemanager.resiliencemanagement.models.ExclusionState; +import com.azure.resourcemanager.resiliencemanagement.models.GoalResourceProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ReasonForRequestingConfirmation; +import com.azure.resourcemanager.resiliencemanagement.models.SolutionDisplayName; +import com.azure.resourcemanager.resiliencemanagement.models.UserConfirmationForHighAvailabilityItem; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class GoalResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GoalResourceInner model = BinaryData.fromString( + "{\"properties\":{\"resourceArmId\":\"tnhxbn\",\"highAvailabilityGoalParticipation\":\"Excluded\",\"highAvailabilityAttestationStatus\":\"NotAttested\",\"disasterRecoveryGoalParticipation\":\"Included\",\"disasterRecoveryAttestationStatus\":\"ManuallyAttested\",\"exclusionReasonForHighAvailabilityGoals\":\"UnsupportedResource\",\"exclusionReasonForDisasterRecoveryGoals\":\"FailedOverResource\",\"userConfirmationForHighAvailability\":[{\"solutionDisplayName\":\"VmInMultiZoneVmss\",\"confirmationStatus\":\"ApprovalNotNeeded\",\"reasonForRequestingConfirmation\":\"VmInMultiZoneScaleSetStatelessOnly\"},{\"solutionDisplayName\":\"VmInMultiZoneVmss\",\"confirmationStatus\":\"ApprovedByUser\",\"reasonForRequestingConfirmation\":\"VmInMultiZoneScaleSetStatelessOnly\"},{\"solutionDisplayName\":\"ZonePinnedVmWithZrsDisk\",\"confirmationStatus\":\"ApprovedByUser\",\"reasonForRequestingConfirmation\":\"VmInMultiZoneScaleSetStatelessOnly\"}],\"serviceGroupMemberships\":[{\"serviceGroupId\":\"eebvmgxsab\",\"membershipType\":\"ThroughResourceGroup\"}],\"provisioningState\":\"Updating\"},\"id\":\"ujitcjcz\",\"name\":\"zevndhkrwpdappds\",\"type\":\"dkvwrwjfe\"}") + .toObject(GoalResourceInner.class); + Assertions.assertEquals("tnhxbn", model.properties().resourceArmId()); + Assertions.assertEquals(ExclusionState.EXCLUDED, model.properties().highAvailabilityGoalParticipation()); + Assertions.assertEquals(AttestationState.NOT_ATTESTED, model.properties().highAvailabilityAttestationStatus()); + Assertions.assertEquals(ExclusionState.INCLUDED, model.properties().disasterRecoveryGoalParticipation()); + Assertions.assertEquals(AttestationState.MANUALLY_ATTESTED, + model.properties().disasterRecoveryAttestationStatus()); + Assertions.assertEquals(SolutionDisplayName.VM_IN_MULTI_ZONE_VMSS, + model.properties().userConfirmationForHighAvailability().get(0).solutionDisplayName()); + Assertions.assertEquals(ConfirmationStatus.APPROVAL_NOT_NEEDED, + model.properties().userConfirmationForHighAvailability().get(0).confirmationStatus()); + Assertions.assertEquals(ReasonForRequestingConfirmation.VM_IN_MULTI_ZONE_SCALE_SET_STATELESS_ONLY, + model.properties().userConfirmationForHighAvailability().get(0).reasonForRequestingConfirmation()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GoalResourceInner model + = new GoalResourceInner().withProperties(new GoalResourceProperties().withResourceArmId("tnhxbn") + .withHighAvailabilityGoalParticipation(ExclusionState.EXCLUDED) + .withHighAvailabilityAttestationStatus(AttestationState.NOT_ATTESTED) + .withDisasterRecoveryGoalParticipation(ExclusionState.INCLUDED) + .withDisasterRecoveryAttestationStatus(AttestationState.MANUALLY_ATTESTED) + .withUserConfirmationForHighAvailability(Arrays.asList( + new UserConfirmationForHighAvailabilityItem() + .withSolutionDisplayName(SolutionDisplayName.VM_IN_MULTI_ZONE_VMSS) + .withConfirmationStatus(ConfirmationStatus.APPROVAL_NOT_NEEDED) + .withReasonForRequestingConfirmation( + ReasonForRequestingConfirmation.VM_IN_MULTI_ZONE_SCALE_SET_STATELESS_ONLY), + new UserConfirmationForHighAvailabilityItem() + .withSolutionDisplayName(SolutionDisplayName.VM_IN_MULTI_ZONE_VMSS) + .withConfirmationStatus(ConfirmationStatus.APPROVED_BY_USER) + .withReasonForRequestingConfirmation( + ReasonForRequestingConfirmation.VM_IN_MULTI_ZONE_SCALE_SET_STATELESS_ONLY), + new UserConfirmationForHighAvailabilityItem() + .withSolutionDisplayName(SolutionDisplayName.ZONE_PINNED_VM_WITH_ZRS_DISK) + .withConfirmationStatus(ConfirmationStatus.APPROVED_BY_USER) + .withReasonForRequestingConfirmation( + ReasonForRequestingConfirmation.VM_IN_MULTI_ZONE_SCALE_SET_STATELESS_ONLY)))); + model = BinaryData.fromObject(model).toObject(GoalResourceInner.class); + Assertions.assertEquals("tnhxbn", model.properties().resourceArmId()); + Assertions.assertEquals(ExclusionState.EXCLUDED, model.properties().highAvailabilityGoalParticipation()); + Assertions.assertEquals(AttestationState.NOT_ATTESTED, model.properties().highAvailabilityAttestationStatus()); + Assertions.assertEquals(ExclusionState.INCLUDED, model.properties().disasterRecoveryGoalParticipation()); + Assertions.assertEquals(AttestationState.MANUALLY_ATTESTED, + model.properties().disasterRecoveryAttestationStatus()); + Assertions.assertEquals(SolutionDisplayName.VM_IN_MULTI_ZONE_VMSS, + model.properties().userConfirmationForHighAvailability().get(0).solutionDisplayName()); + Assertions.assertEquals(ConfirmationStatus.APPROVAL_NOT_NEEDED, + model.properties().userConfirmationForHighAvailability().get(0).confirmationStatus()); + Assertions.assertEquals(ReasonForRequestingConfirmation.VM_IN_MULTI_ZONE_SCALE_SET_STATELESS_ONLY, + model.properties().userConfirmationForHighAvailability().get(0).reasonForRequestingConfirmation()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourceListResultTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourceListResultTests.java new file mode 100644 index 000000000000..2db6090942ec --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourceListResultTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.implementation.models.GoalResourceListResult; +import com.azure.resourcemanager.resiliencemanagement.models.AttestationState; +import com.azure.resourcemanager.resiliencemanagement.models.ConfirmationStatus; +import com.azure.resourcemanager.resiliencemanagement.models.ExclusionState; +import com.azure.resourcemanager.resiliencemanagement.models.ReasonForRequestingConfirmation; +import com.azure.resourcemanager.resiliencemanagement.models.SolutionDisplayName; +import org.junit.jupiter.api.Assertions; + +public final class GoalResourceListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GoalResourceListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"resourceArmId\":\"lnerkujysvleju\",\"highAvailabilityGoalParticipation\":\"Included\",\"highAvailabilityAttestationStatus\":\"ManuallyAttested\",\"disasterRecoveryGoalParticipation\":\"Included\",\"disasterRecoveryAttestationStatus\":\"ManuallyAttested\",\"exclusionReasonForHighAvailabilityGoals\":\"UnsupportedResource\",\"exclusionReasonForDisasterRecoveryGoals\":\"UserSelectedExclusion\",\"userConfirmationForHighAvailability\":[{\"solutionDisplayName\":\"VmInMultiZoneVmss\",\"confirmationStatus\":\"RejectedByUser\",\"reasonForRequestingConfirmation\":\"VmInMultiZoneScaleSetStatelessOnly\"}],\"serviceGroupMemberships\":[{\"serviceGroupId\":\"xgjvtbv\",\"membershipType\":\"Direct\"}],\"provisioningState\":\"Failed\"},\"id\":\"dnrujqguhmuouqfp\",\"name\":\"wzwbnguitn\",\"type\":\"uizga\"},{\"properties\":{\"resourceArmId\":\"ufizuckyf\",\"highAvailabilityGoalParticipation\":\"Excluded\",\"highAvailabilityAttestationStatus\":\"ManuallyAttested\",\"disasterRecoveryGoalParticipation\":\"Excluded\",\"disasterRecoveryAttestationStatus\":\"ManuallyAttested\",\"exclusionReasonForHighAvailabilityGoals\":\"UnsupportedResource\",\"exclusionReasonForDisasterRecoveryGoals\":\"FailedOverResource\",\"userConfirmationForHighAvailability\":[{\"solutionDisplayName\":\"ZonePinnedVmWithZrsDisk\",\"confirmationStatus\":\"ApprovedByUser\",\"reasonForRequestingConfirmation\":\"VmInMultiZoneScaleSetStatelessOnly\"}],\"serviceGroupMemberships\":[{\"serviceGroupId\":\"sdkf\",\"membershipType\":\"ThroughResourceGroup\"},{\"serviceGroupId\":\"wxmnteiwao\",\"membershipType\":\"ThroughResourceGroup\"},{\"serviceGroupId\":\"km\",\"membershipType\":\"ThroughSubscription\"},{\"serviceGroupId\":\"c\",\"membershipType\":\"Direct\"}],\"provisioningState\":\"Updating\"},\"id\":\"ufufsrp\",\"name\":\"mzidnsezcxtb\",\"type\":\"sgfyccsnew\"}],\"nextLink\":\"wzjeiach\"}") + .toObject(GoalResourceListResult.class); + Assertions.assertEquals("lnerkujysvleju", model.value().get(0).properties().resourceArmId()); + Assertions.assertEquals(ExclusionState.INCLUDED, + model.value().get(0).properties().highAvailabilityGoalParticipation()); + Assertions.assertEquals(AttestationState.MANUALLY_ATTESTED, + model.value().get(0).properties().highAvailabilityAttestationStatus()); + Assertions.assertEquals(ExclusionState.INCLUDED, + model.value().get(0).properties().disasterRecoveryGoalParticipation()); + Assertions.assertEquals(AttestationState.MANUALLY_ATTESTED, + model.value().get(0).properties().disasterRecoveryAttestationStatus()); + Assertions.assertEquals(SolutionDisplayName.VM_IN_MULTI_ZONE_VMSS, + model.value().get(0).properties().userConfirmationForHighAvailability().get(0).solutionDisplayName()); + Assertions.assertEquals(ConfirmationStatus.REJECTED_BY_USER, + model.value().get(0).properties().userConfirmationForHighAvailability().get(0).confirmationStatus()); + Assertions.assertEquals(ReasonForRequestingConfirmation.VM_IN_MULTI_ZONE_SCALE_SET_STATELESS_ONLY, + model.value() + .get(0) + .properties() + .userConfirmationForHighAvailability() + .get(0) + .reasonForRequestingConfirmation()); + Assertions.assertEquals("wzjeiach", model.nextLink()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourcePropertiesTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourcePropertiesTests.java new file mode 100644 index 000000000000..9c877b6af52f --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourcePropertiesTests.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.AttestationState; +import com.azure.resourcemanager.resiliencemanagement.models.ConfirmationStatus; +import com.azure.resourcemanager.resiliencemanagement.models.ExclusionState; +import com.azure.resourcemanager.resiliencemanagement.models.GoalResourceProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ReasonForRequestingConfirmation; +import com.azure.resourcemanager.resiliencemanagement.models.SolutionDisplayName; +import com.azure.resourcemanager.resiliencemanagement.models.UserConfirmationForHighAvailabilityItem; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class GoalResourcePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GoalResourceProperties model = BinaryData.fromString( + "{\"resourceArmId\":\"snhu\",\"highAvailabilityGoalParticipation\":\"Excluded\",\"highAvailabilityAttestationStatus\":\"ManuallyAttested\",\"disasterRecoveryGoalParticipation\":\"Included\",\"disasterRecoveryAttestationStatus\":\"NotAttested\",\"exclusionReasonForHighAvailabilityGoals\":\"FailedOverResource\",\"exclusionReasonForDisasterRecoveryGoals\":\"FailedOverResource\",\"userConfirmationForHighAvailability\":[{\"solutionDisplayName\":\"ZonePinnedVmWithZrsDisk\",\"confirmationStatus\":\"ApprovalNotNeeded\",\"reasonForRequestingConfirmation\":\"ZonePinnedZrsDataDisksConditional\"}],\"serviceGroupMemberships\":[{\"serviceGroupId\":\"xhocdgeablgphuti\",\"membershipType\":\"Direct\"},{\"serviceGroupId\":\"dvkaozw\",\"membershipType\":\"ThroughResourceGroup\"},{\"serviceGroupId\":\"ftyhxhurokf\",\"membershipType\":\"ThroughSubscription\"},{\"serviceGroupId\":\"xolniwpwcukjfk\",\"membershipType\":\"Direct\"}],\"provisioningState\":\"Succeeded\"}") + .toObject(GoalResourceProperties.class); + Assertions.assertEquals("snhu", model.resourceArmId()); + Assertions.assertEquals(ExclusionState.EXCLUDED, model.highAvailabilityGoalParticipation()); + Assertions.assertEquals(AttestationState.MANUALLY_ATTESTED, model.highAvailabilityAttestationStatus()); + Assertions.assertEquals(ExclusionState.INCLUDED, model.disasterRecoveryGoalParticipation()); + Assertions.assertEquals(AttestationState.NOT_ATTESTED, model.disasterRecoveryAttestationStatus()); + Assertions.assertEquals(SolutionDisplayName.ZONE_PINNED_VM_WITH_ZRS_DISK, + model.userConfirmationForHighAvailability().get(0).solutionDisplayName()); + Assertions.assertEquals(ConfirmationStatus.APPROVAL_NOT_NEEDED, + model.userConfirmationForHighAvailability().get(0).confirmationStatus()); + Assertions.assertEquals(ReasonForRequestingConfirmation.ZONE_PINNED_ZRS_DATA_DISKS_CONDITIONAL, + model.userConfirmationForHighAvailability().get(0).reasonForRequestingConfirmation()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GoalResourceProperties model = new GoalResourceProperties().withResourceArmId("snhu") + .withHighAvailabilityGoalParticipation(ExclusionState.EXCLUDED) + .withHighAvailabilityAttestationStatus(AttestationState.MANUALLY_ATTESTED) + .withDisasterRecoveryGoalParticipation(ExclusionState.INCLUDED) + .withDisasterRecoveryAttestationStatus(AttestationState.NOT_ATTESTED) + .withUserConfirmationForHighAvailability(Arrays.asList(new UserConfirmationForHighAvailabilityItem() + .withSolutionDisplayName(SolutionDisplayName.ZONE_PINNED_VM_WITH_ZRS_DISK) + .withConfirmationStatus(ConfirmationStatus.APPROVAL_NOT_NEEDED) + .withReasonForRequestingConfirmation( + ReasonForRequestingConfirmation.ZONE_PINNED_ZRS_DATA_DISKS_CONDITIONAL))); + model = BinaryData.fromObject(model).toObject(GoalResourceProperties.class); + Assertions.assertEquals("snhu", model.resourceArmId()); + Assertions.assertEquals(ExclusionState.EXCLUDED, model.highAvailabilityGoalParticipation()); + Assertions.assertEquals(AttestationState.MANUALLY_ATTESTED, model.highAvailabilityAttestationStatus()); + Assertions.assertEquals(ExclusionState.INCLUDED, model.disasterRecoveryGoalParticipation()); + Assertions.assertEquals(AttestationState.NOT_ATTESTED, model.disasterRecoveryAttestationStatus()); + Assertions.assertEquals(SolutionDisplayName.ZONE_PINNED_VM_WITH_ZRS_DISK, + model.userConfirmationForHighAvailability().get(0).solutionDisplayName()); + Assertions.assertEquals(ConfirmationStatus.APPROVAL_NOT_NEEDED, + model.userConfirmationForHighAvailability().get(0).confirmationStatus()); + Assertions.assertEquals(ReasonForRequestingConfirmation.ZONE_PINNED_ZRS_DATA_DISKS_CONDITIONAL, + model.userConfirmationForHighAvailability().get(0).reasonForRequestingConfirmation()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourcesGetWithResponseMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourcesGetWithResponseMockTests.java new file mode 100644 index 000000000000..eb3b642a5e5e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourcesGetWithResponseMockTests.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.AttestationState; +import com.azure.resourcemanager.resiliencemanagement.models.ConfirmationStatus; +import com.azure.resourcemanager.resiliencemanagement.models.ExclusionState; +import com.azure.resourcemanager.resiliencemanagement.models.GoalResource; +import com.azure.resourcemanager.resiliencemanagement.models.ReasonForRequestingConfirmation; +import com.azure.resourcemanager.resiliencemanagement.models.SolutionDisplayName; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class GoalResourcesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"resourceArmId\":\"jww\",\"highAvailabilityGoalParticipation\":\"Excluded\",\"highAvailabilityAttestationStatus\":\"NotAttested\",\"disasterRecoveryGoalParticipation\":\"Included\",\"disasterRecoveryAttestationStatus\":\"ManuallyAttested\",\"exclusionReasonForHighAvailabilityGoals\":\"UserSelectedExclusion\",\"exclusionReasonForDisasterRecoveryGoals\":\"UnsupportedResource\",\"userConfirmationForHighAvailability\":[{\"solutionDisplayName\":\"VmInMultiZoneVmss\",\"confirmationStatus\":\"RejectedByUser\",\"reasonForRequestingConfirmation\":\"ZonePinnedZrsDataDisksConditional\"},{\"solutionDisplayName\":\"VmInMultiZoneVmss\",\"confirmationStatus\":\"ApprovalNotNeeded\",\"reasonForRequestingConfirmation\":\"VmInMultiZoneScaleSetStatelessOnly\"},{\"solutionDisplayName\":\"VmInMultiZoneVmss\",\"confirmationStatus\":\"RejectedByUser\",\"reasonForRequestingConfirmation\":\"VmInMultiZoneScaleSetStatelessOnly\"},{\"solutionDisplayName\":\"ZonePinnedVmWithZrsDisk\",\"confirmationStatus\":\"ApprovedByUser\",\"reasonForRequestingConfirmation\":\"ZonePinnedZrsDataDisksConditional\"}],\"serviceGroupMemberships\":[{\"serviceGroupId\":\"lzok\",\"membershipType\":\"Direct\"},{\"serviceGroupId\":\"ox\",\"membershipType\":\"ThroughSubscription\"}],\"provisioningState\":\"Deleting\"},\"id\":\"eta\",\"name\":\"ltsxoatf\",\"type\":\"g\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + GoalResource response = manager.goalResources() + .getWithResponse("amikzebrqbsm", "wziqgfuhokzr", "swhvhczznvfbycj", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("jww", response.properties().resourceArmId()); + Assertions.assertEquals(ExclusionState.EXCLUDED, response.properties().highAvailabilityGoalParticipation()); + Assertions.assertEquals(AttestationState.NOT_ATTESTED, + response.properties().highAvailabilityAttestationStatus()); + Assertions.assertEquals(ExclusionState.INCLUDED, response.properties().disasterRecoveryGoalParticipation()); + Assertions.assertEquals(AttestationState.MANUALLY_ATTESTED, + response.properties().disasterRecoveryAttestationStatus()); + Assertions.assertEquals(SolutionDisplayName.VM_IN_MULTI_ZONE_VMSS, + response.properties().userConfirmationForHighAvailability().get(0).solutionDisplayName()); + Assertions.assertEquals(ConfirmationStatus.REJECTED_BY_USER, + response.properties().userConfirmationForHighAvailability().get(0).confirmationStatus()); + Assertions.assertEquals(ReasonForRequestingConfirmation.ZONE_PINNED_ZRS_DATA_DISKS_CONDITIONAL, + response.properties().userConfirmationForHighAvailability().get(0).reasonForRequestingConfirmation()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourcesListMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourcesListMockTests.java new file mode 100644 index 000000000000..238baaad463d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalResourcesListMockTests.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.AttestationState; +import com.azure.resourcemanager.resiliencemanagement.models.ConfirmationStatus; +import com.azure.resourcemanager.resiliencemanagement.models.ExclusionState; +import com.azure.resourcemanager.resiliencemanagement.models.GoalResource; +import com.azure.resourcemanager.resiliencemanagement.models.ReasonForRequestingConfirmation; +import com.azure.resourcemanager.resiliencemanagement.models.SolutionDisplayName; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class GoalResourcesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"resourceArmId\":\"cxcjxgry\",\"highAvailabilityGoalParticipation\":\"Included\",\"highAvailabilityAttestationStatus\":\"ManuallyAttested\",\"disasterRecoveryGoalParticipation\":\"Excluded\",\"disasterRecoveryAttestationStatus\":\"NotAttested\",\"exclusionReasonForHighAvailabilityGoals\":\"FailedOverResource\",\"exclusionReasonForDisasterRecoveryGoals\":\"UserSelectedExclusion\",\"userConfirmationForHighAvailability\":[{\"solutionDisplayName\":\"VmInMultiZoneVmss\",\"confirmationStatus\":\"ApprovalPending\",\"reasonForRequestingConfirmation\":\"VmInMultiZoneScaleSetStatelessOnly\"},{\"solutionDisplayName\":\"VmInMultiZoneVmss\",\"confirmationStatus\":\"ApprovalNotNeeded\",\"reasonForRequestingConfirmation\":\"VmInMultiZoneScaleSetStatelessOnly\"},{\"solutionDisplayName\":\"VmInMultiZoneVmss\",\"confirmationStatus\":\"ApprovedByUser\",\"reasonForRequestingConfirmation\":\"ZonePinnedZrsDataDisksConditional\"}],\"serviceGroupMemberships\":[{\"serviceGroupId\":\"wp\",\"membershipType\":\"ThroughResourceGroup\"},{\"serviceGroupId\":\"fcpfnznth\",\"membershipType\":\"ThroughSubscription\"},{\"serviceGroupId\":\"wkjaos\",\"membershipType\":\"ThroughResourceGroup\"}],\"provisioningState\":\"Accepted\"},\"id\":\"oamktcq\",\"name\":\"os\",\"type\":\"gbzahgxqdlyr\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.goalResources() + .list("pnpbswveflocc", "rmozihmipgawt", "xp", 156137612, com.azure.core.util.Context.NONE); + + Assertions.assertEquals("cxcjxgry", response.iterator().next().properties().resourceArmId()); + Assertions.assertEquals(ExclusionState.INCLUDED, + response.iterator().next().properties().highAvailabilityGoalParticipation()); + Assertions.assertEquals(AttestationState.MANUALLY_ATTESTED, + response.iterator().next().properties().highAvailabilityAttestationStatus()); + Assertions.assertEquals(ExclusionState.EXCLUDED, + response.iterator().next().properties().disasterRecoveryGoalParticipation()); + Assertions.assertEquals(AttestationState.NOT_ATTESTED, + response.iterator().next().properties().disasterRecoveryAttestationStatus()); + Assertions.assertEquals(SolutionDisplayName.VM_IN_MULTI_ZONE_VMSS, + response.iterator().next().properties().userConfirmationForHighAvailability().get(0).solutionDisplayName()); + Assertions.assertEquals(ConfirmationStatus.APPROVAL_PENDING, + response.iterator().next().properties().userConfirmationForHighAvailability().get(0).confirmationStatus()); + Assertions.assertEquals(ReasonForRequestingConfirmation.VM_IN_MULTI_ZONE_SCALE_SET_STATELESS_ONLY, + response.iterator() + .next() + .properties() + .userConfirmationForHighAvailability() + .get(0) + .reasonForRequestingConfirmation()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalsDataTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalsDataTests.java new file mode 100644 index 000000000000..b3f7c45c7431 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/GoalsDataTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.GoalsData; +import com.azure.resourcemanager.resiliencemanagement.models.IsoDuration; +import com.azure.resourcemanager.resiliencemanagement.models.ResilienceHealthStatus; +import com.azure.resourcemanager.resiliencemanagement.models.UnifiedResilienceItemRequirementSelected; +import org.junit.jupiter.api.Assertions; + +public final class GoalsDataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GoalsData model = BinaryData.fromString( + "{\"templateId\":\"vfuuru\",\"assignmentId\":\"lwexxwl\",\"regionalRecoveryPointObjectiveInMinutes\":\"PT24H\",\"regionalRecoveryPointEstimatedInMinutes\":\"PT1H\",\"regionalRecoveryPointObjectiveStatus\":\"Unhealthy\",\"regionalRecoveryTimeObjectiveInMinutes\":\"PT24H\",\"regionalRecoveryTimeActualInMinutes\":\"PT1H\",\"regionalRecoveryTimeObjectiveStatus\":\"Unhealthy\",\"requireHighAvailability\":\"NotSelected\",\"requireDisasterRecovery\":\"NotRequired\"}") + .toObject(GoalsData.class); + Assertions.assertEquals("vfuuru", model.templateId()); + Assertions.assertEquals("lwexxwl", model.assignmentId()); + Assertions.assertEquals(IsoDuration.PT24H, model.regionalRecoveryPointObjectiveInMinutes()); + Assertions.assertEquals(IsoDuration.PT1H, model.regionalRecoveryPointEstimatedInMinutes()); + Assertions.assertEquals(ResilienceHealthStatus.UNHEALTHY, model.regionalRecoveryPointObjectiveStatus()); + Assertions.assertEquals(IsoDuration.PT24H, model.regionalRecoveryTimeObjectiveInMinutes()); + Assertions.assertEquals(IsoDuration.PT1H, model.regionalRecoveryTimeActualInMinutes()); + Assertions.assertEquals(ResilienceHealthStatus.UNHEALTHY, model.regionalRecoveryTimeObjectiveStatus()); + Assertions.assertEquals(UnifiedResilienceItemRequirementSelected.NOT_SELECTED, model.requireHighAvailability()); + Assertions.assertEquals(UnifiedResilienceItemRequirementSelected.NOT_REQUIRED, model.requireDisasterRecovery()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/IncludeOrUpdateResourceTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/IncludeOrUpdateResourceTests.java new file mode 100644 index 000000000000..7b0a5c263b43 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/IncludeOrUpdateResourceTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.CustomFaultDetails; +import com.azure.resourcemanager.resiliencemanagement.models.FaultDetails; +import com.azure.resourcemanager.resiliencemanagement.models.FaultProperties; +import com.azure.resourcemanager.resiliencemanagement.models.IncludeOrUpdateResource; +import org.junit.jupiter.api.Assertions; + +public final class IncludeOrUpdateResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IncludeOrUpdateResource model = BinaryData.fromString( + "{\"id\":\"bawpfajnjwltlwt\",\"faultProperties\":{\"availableFaults\":[{\"faultUrn\":\"ktalhsnvkcdmxz\",\"faultName\":\"poaimlnwiaaomyl\",\"targetResourceId\":\"eazulcs\"},{\"faultUrn\":\"thwwn\",\"faultName\":\"jhlfzswpchwahf\",\"targetResourceId\":\"ousnfepgfewe\"},{\"faultUrn\":\"wlyxgncxyk\",\"faultName\":\"hdjhlimmbcx\",\"targetResourceId\":\"h\"},{\"faultUrn\":\"cporxvxcjz\",\"faultName\":\"qizxfpxtgqscjavf\",\"targetResourceId\":\"juhdqazkmtgguwpi\"}],\"defaultFault\":{\"faultUrn\":\"ajc\",\"faultName\":\"vmmghfcfiwrxgk\",\"targetResourceId\":\"euvyinzqodfvpgs\"},\"overriddenDefaultFault\":{\"faultUrn\":\"xgsg\",\"faultName\":\"p\",\"targetResourceId\":\"gzdjtxvzf\"},\"customFault\":{\"faultName\":\"q\",\"scriptResourceId\":\"gaqvlgafcqusrd\"}}}") + .toObject(IncludeOrUpdateResource.class); + Assertions.assertEquals("bawpfajnjwltlwt", model.id()); + Assertions.assertEquals("xgsg", model.faultProperties().overriddenDefaultFault().faultUrn()); + Assertions.assertEquals("p", model.faultProperties().overriddenDefaultFault().faultName()); + Assertions.assertEquals("gzdjtxvzf", model.faultProperties().overriddenDefaultFault().targetResourceId()); + Assertions.assertEquals("q", model.faultProperties().customFault().faultName()); + Assertions.assertEquals("gaqvlgafcqusrd", model.faultProperties().customFault().scriptResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IncludeOrUpdateResource model = new IncludeOrUpdateResource().withId("bawpfajnjwltlwt") + .withFaultProperties(new FaultProperties() + .withOverriddenDefaultFault( + new FaultDetails().withFaultUrn("xgsg").withFaultName("p").withTargetResourceId("gzdjtxvzf")) + .withCustomFault(new CustomFaultDetails().withFaultName("q").withScriptResourceId("gaqvlgafcqusrd"))); + model = BinaryData.fromObject(model).toObject(IncludeOrUpdateResource.class); + Assertions.assertEquals("bawpfajnjwltlwt", model.id()); + Assertions.assertEquals("xgsg", model.faultProperties().overriddenDefaultFault().faultUrn()); + Assertions.assertEquals("p", model.faultProperties().overriddenDefaultFault().faultName()); + Assertions.assertEquals("gzdjtxvzf", model.faultProperties().overriddenDefaultFault().targetResourceId()); + Assertions.assertEquals("q", model.faultProperties().customFault().faultName()); + Assertions.assertEquals("gaqvlgafcqusrd", model.faultProperties().customFault().scriptResourceId()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/JobUserCommentTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/JobUserCommentTests.java new file mode 100644 index 000000000000..962b23d8a11e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/JobUserCommentTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.JobUserComment; + +public final class JobUserCommentTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + JobUserComment model = BinaryData + .fromString( + "{\"commentType\":\"ResumeReason\",\"commentTime\":\"2021-10-02T15:19:08Z\",\"comments\":\"md\"}") + .toObject(JobUserComment.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/LastRunPropertiesTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/LastRunPropertiesTests.java new file mode 100644 index 000000000000..fbd0e9338040 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/LastRunPropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.LastRunProperties; + +public final class LastRunPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LastRunProperties model = BinaryData.fromString( + "{\"lastRunTime\":\"2021-05-05T23:09:26Z\",\"lastRunState\":\"Cancelled\",\"lastRunDuration\":\"PT22H5M57S\",\"lastRunAttestation\":\"Failed\"}") + .toObject(LastRunProperties.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ManagedOnBehalfOfConfigurationTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ManagedOnBehalfOfConfigurationTests.java new file mode 100644 index 000000000000..f8d2b666b21f --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ManagedOnBehalfOfConfigurationTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedOnBehalfOfConfiguration; + +public final class ManagedOnBehalfOfConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedOnBehalfOfConfiguration model = BinaryData.fromString( + "{\"moboBrokerResources\":[{\"id\":\"ilqu\"},{\"id\":\"ydxtqm\"},{\"id\":\"ox\"},{\"id\":\"ggufhyaomtb\"}]}") + .toObject(ManagedOnBehalfOfConfiguration.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ManagedServiceIdentityTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ManagedServiceIdentityTests.java new file mode 100644 index 000000000000..ddf1414517c0 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ManagedServiceIdentityTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedServiceIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedServiceIdentity model = BinaryData.fromString( + "{\"principalId\":\"yyazttbt\",\"tenantId\":\"rq\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"qwalmuzyoxaepd\":{\"principalId\":\"kzywbiex\",\"clientId\":\"eyueaxibxujwb\"},\"zt\":{\"principalId\":\"jancu\",\"clientId\":\"hdwbavxbniwdjs\"},\"xbzpfzab\":{\"principalId\":\"bpg\",\"clientId\":\"ytxhp\"}}}") + .toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("qwalmuzyoxaepd", new UserAssignedIdentity(), "zt", + new UserAssignedIdentity(), "xbzpfzab", new UserAssignedIdentity())); + model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/MarkAsCompleteRequestTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/MarkAsCompleteRequestTests.java new file mode 100644 index 000000000000..f726eaf03207 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/MarkAsCompleteRequestTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunSubtasks; +import com.azure.resourcemanager.resiliencemanagement.models.MarkAsCompleteRequest; +import org.junit.jupiter.api.Assertions; + +public final class MarkAsCompleteRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MarkAsCompleteRequest model + = BinaryData.fromString("{\"drillRunStage\":\"FaultInjection\"}").toObject(MarkAsCompleteRequest.class); + Assertions.assertEquals(DrillRunSubtasks.FAULT_INJECTION, model.drillRunStage()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MarkAsCompleteRequest model = new MarkAsCompleteRequest().withDrillRunStage(DrillRunSubtasks.FAULT_INJECTION); + model = BinaryData.fromObject(model).toObject(MarkAsCompleteRequest.class); + Assertions.assertEquals(DrillRunSubtasks.FAULT_INJECTION, model.drillRunStage()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/MoboBrokerResourceTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/MoboBrokerResourceTests.java new file mode 100644 index 000000000000..d05aac186f7e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/MoboBrokerResourceTests.java @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.MoboBrokerResource; + +public final class MoboBrokerResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MoboBrokerResource model = BinaryData.fromString("{\"id\":\"havgrvk\"}").toObject(MoboBrokerResource.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/MonitoringPropertiesOfDrillTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/MonitoringPropertiesOfDrillTests.java new file mode 100644 index 000000000000..43c27f1933c9 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/MonitoringPropertiesOfDrillTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.AssociatedIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.MonitoringPropertiesOfDrill; +import org.junit.jupiter.api.Assertions; + +public final class MonitoringPropertiesOfDrillTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MonitoringPropertiesOfDrill model = BinaryData.fromString( + "{\"identity\":{\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentity\":\"jzhpjbibgjmfx\"},\"logAnalyticsWorkspaceId\":\"vfcluyovwxnbkfe\",\"rawMetricsDataCollectionRuleId\":\"xscyhwzdgirujbz\",\"serviceGroupMetricsDataCollectionRuleId\":\"mvzzbtdcqvp\",\"dataCollectionEndpointId\":\"yujviylwdshfssn\"}") + .toObject(MonitoringPropertiesOfDrill.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("jzhpjbibgjmfx", model.identity().userAssignedIdentity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MonitoringPropertiesOfDrill model = new MonitoringPropertiesOfDrill() + .withIdentity(new AssociatedIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentity("jzhpjbibgjmfx")); + model = BinaryData.fromObject(model).toObject(MonitoringPropertiesOfDrill.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("jzhpjbibgjmfx", model.identity().userAssignedIdentity()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationDisplayTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationDisplayTests.java new file mode 100644 index 000000000000..d21c5f72c9e9 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationDisplayTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.OperationDisplay; + +public final class OperationDisplayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationDisplay model = BinaryData.fromString( + "{\"provider\":\"cdm\",\"resource\":\"rcryuanzwuxzdxta\",\"operation\":\"lhmwhfpmrqobm\",\"description\":\"kknryrtihf\"}") + .toObject(OperationDisplay.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationInnerTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationInnerTests.java new file mode 100644 index 000000000000..41afb51ab379 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.OperationInner; + +public final class OperationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationInner model = BinaryData.fromString( + "{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") + .toObject(OperationInner.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationListResultTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationListResultTests.java new file mode 100644 index 000000000000..c0837354d54a --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.implementation.models.OperationListResult; +import org.junit.jupiter.api.Assertions; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"fpownoizhwlr\",\"isDataAction\":false,\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"esaagdfm\",\"isDataAction\":true,\"display\":{\"provider\":\"j\",\"resource\":\"ifkwmrvktsizntoc\",\"operation\":\"a\",\"description\":\"ajpsquc\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kfo\"}") + .toObject(OperationListResult.class); + Assertions.assertEquals("kfo", model.nextLink()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationQualificationDetailsTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationQualificationDetailsTests.java new file mode 100644 index 000000000000..9a76ce20ae35 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationQualificationDetailsTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.OperationQualificationDetails; +import com.azure.resourcemanager.resiliencemanagement.models.QualificationState; +import org.junit.jupiter.api.Assertions; + +public final class OperationQualificationDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationQualificationDetails model = BinaryData.fromString( + "{\"qualificationState\":\"Qualified\",\"notQualifiedReasons\":[\"pfrxtrthzvay\",\"dwkqbrq\",\"bpaxhexiilivpdt\",\"irqtdqoa\"]}") + .toObject(OperationQualificationDetails.class); + Assertions.assertEquals(QualificationState.QUALIFIED, model.qualificationState()); + Assertions.assertEquals("pfrxtrthzvay", model.notQualifiedReasons().get(0)); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationsListMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationsListMockTests.java new file mode 100644 index 000000000000..750500d6e21d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/OperationsListMockTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.Operation; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OperationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"name\":\"o\",\"isDataAction\":true,\"display\":{\"provider\":\"nlu\",\"resource\":\"krrfx\",\"operation\":\"ebtijvacvbmqzbqq\",\"description\":\"aj\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecommendCapacityRequestTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecommendCapacityRequestTests.java new file mode 100644 index 000000000000..9845694c30ca --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecommendCapacityRequestTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.RecommendCapacityRequest; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class RecommendCapacityRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecommendCapacityRequest model = BinaryData.fromString("{\"resourceIds\":[\"basyy\",\"nddhsgcbacph\"]}") + .toObject(RecommendCapacityRequest.class); + Assertions.assertEquals("basyy", model.resourceIds().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RecommendCapacityRequest model + = new RecommendCapacityRequest().withResourceIds(Arrays.asList("basyy", "nddhsgcbacph")); + model = BinaryData.fromObject(model).toObject(RecommendCapacityRequest.class); + Assertions.assertEquals("basyy", model.resourceIds().get(0)); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecommendationsDataTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecommendationsDataTests.java new file mode 100644 index 000000000000..2e186e5134a8 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecommendationsDataTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.RecommendationsData; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class RecommendationsDataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecommendationsData model = BinaryData.fromString( + "{\"highAvailability\":{\"enabledResourceCount\":1399930855243571300,\"notEnabledResourceCount\":8979743707933229736,\"notEvaluatedResourceCount\":7691666189017111236,\"evaluationDateTime\":\"2021-11-07T11:22:10Z\"}}") + .toObject(RecommendationsData.class); + Assertions.assertEquals(1399930855243571300L, model.highAvailability().enabledResourceCount()); + Assertions.assertEquals(8979743707933229736L, model.highAvailability().notEnabledResourceCount()); + Assertions.assertEquals(7691666189017111236L, model.highAvailability().notEvaluatedResourceCount()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-07T11:22:10Z"), + model.highAvailability().evaluationDateTime()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecommendationsHighAvailabilityDataTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecommendationsHighAvailabilityDataTests.java new file mode 100644 index 000000000000..6e9e1f7c706d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecommendationsHighAvailabilityDataTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.RecommendationsHighAvailabilityData; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class RecommendationsHighAvailabilityDataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecommendationsHighAvailabilityData model = BinaryData.fromString( + "{\"enabledResourceCount\":5101321379524774238,\"notEnabledResourceCount\":2188871657256003362,\"notEvaluatedResourceCount\":8523217824411164403,\"evaluationDateTime\":\"2021-12-06T10:12:51Z\"}") + .toObject(RecommendationsHighAvailabilityData.class); + Assertions.assertEquals(5101321379524774238L, model.enabledResourceCount()); + Assertions.assertEquals(2188871657256003362L, model.notEnabledResourceCount()); + Assertions.assertEquals(8523217824411164403L, model.notEvaluatedResourceCount()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-06T10:12:51Z"), model.evaluationDateTime()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryActionRequestTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryActionRequestTests.java new file mode 100644 index 000000000000..c3f010ce26bf --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryActionRequestTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryActionRequest; +import org.junit.jupiter.api.Assertions; + +public final class RecoveryActionRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecoveryActionRequest model + = BinaryData.fromString("{\"description\":\"cizsjqlhkrribdei\"}").toObject(RecoveryActionRequest.class); + Assertions.assertEquals("cizsjqlhkrribdei", model.description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RecoveryActionRequest model = new RecoveryActionRequest().withDescription("cizsjqlhkrribdei"); + model = BinaryData.fromObject(model).toObject(RecoveryActionRequest.class); + Assertions.assertEquals("cizsjqlhkrribdei", model.description()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupActionSettingsTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupActionSettingsTests.java new file mode 100644 index 000000000000..1f9a10cc8542 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupActionSettingsTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupActionSettings; + +public final class RecoveryGroupActionSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecoveryGroupActionSettings model = BinaryData.fromString( + "{\"actionTask\":\"None\",\"actionSequence\":522033644,\"recoveryGroupActionType\":\"ManualAction\",\"actionName\":\"smwutwbdsrezpd\",\"actionDescription\":\"neuyow\"}") + .toObject(RecoveryGroupActionSettings.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupBaseActionTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupBaseActionTests.java new file mode 100644 index 000000000000..df97f49db8fc --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupBaseActionTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupBaseAction; +import org.junit.jupiter.api.Assertions; + +public final class RecoveryGroupBaseActionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecoveryGroupBaseAction model = BinaryData.fromString( + "{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"nehmpvecx\",\"description\":\"debfqkkrbmpukgri\",\"timeoutInMinutes\":765258772}") + .toObject(RecoveryGroupBaseAction.class); + Assertions.assertEquals("nehmpvecx", model.name()); + Assertions.assertEquals("debfqkkrbmpukgri", model.description()); + Assertions.assertEquals(765258772, model.timeoutInMinutes()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RecoveryGroupBaseAction model = new RecoveryGroupBaseAction().withName("nehmpvecx") + .withDescription("debfqkkrbmpukgri") + .withTimeoutInMinutes(765258772); + model = BinaryData.fromObject(model).toObject(RecoveryGroupBaseAction.class); + Assertions.assertEquals("nehmpvecx", model.name()); + Assertions.assertEquals("debfqkkrbmpukgri", model.description()); + Assertions.assertEquals(765258772, model.timeoutInMinutes()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupCustomRunbookActionTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupCustomRunbookActionTests.java new file mode 100644 index 000000000000..ad7b6f5ef379 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupCustomRunbookActionTests.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.AssociatedIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupCustomRunbookAction; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class RecoveryGroupCustomRunbookActionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecoveryGroupCustomRunbookAction model = BinaryData.fromString( + "{\"type\":\"CustomRunbook\",\"actionResourceId\":\"hibnuqqkpika\",\"parameters\":{\"gnbuy\":\"vtq\",\"fsiarbutr\":\"hijggme\",\"jrunmpxtt\":\"vpnazzm\"},\"associatedIdentity\":{\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentity\":\"bnlankxmyskpb\"},\"name\":\"enbtkcxywny\",\"description\":\"rsyn\",\"timeoutInMinutes\":1857239406}") + .toObject(RecoveryGroupCustomRunbookAction.class); + Assertions.assertEquals("enbtkcxywny", model.name()); + Assertions.assertEquals("rsyn", model.description()); + Assertions.assertEquals(1857239406, model.timeoutInMinutes()); + Assertions.assertEquals("hibnuqqkpika", model.actionResourceId()); + Assertions.assertEquals("vtq", model.parameters().get("gnbuy")); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, + model.associatedIdentity().type()); + Assertions.assertEquals("bnlankxmyskpb", model.associatedIdentity().userAssignedIdentity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RecoveryGroupCustomRunbookAction model = new RecoveryGroupCustomRunbookAction().withName("enbtkcxywny") + .withDescription("rsyn") + .withTimeoutInMinutes(1857239406) + .withActionResourceId("hibnuqqkpika") + .withParameters(mapOf("gnbuy", "vtq", "fsiarbutr", "hijggme", "jrunmpxtt", "vpnazzm")) + .withAssociatedIdentity( + new AssociatedIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentity("bnlankxmyskpb")); + model = BinaryData.fromObject(model).toObject(RecoveryGroupCustomRunbookAction.class); + Assertions.assertEquals("enbtkcxywny", model.name()); + Assertions.assertEquals("rsyn", model.description()); + Assertions.assertEquals(1857239406, model.timeoutInMinutes()); + Assertions.assertEquals("hibnuqqkpika", model.actionResourceId()); + Assertions.assertEquals("vtq", model.parameters().get("gnbuy")); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, + model.associatedIdentity().type()); + Assertions.assertEquals("bnlankxmyskpb", model.associatedIdentity().userAssignedIdentity()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupManualActionTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupManualActionTests.java new file mode 100644 index 000000000000..c9fd00d27865 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupManualActionTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupManualAction; +import org.junit.jupiter.api.Assertions; + +public final class RecoveryGroupManualActionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecoveryGroupManualAction model = BinaryData.fromString( + "{\"type\":\"ManualAction\",\"name\":\"lzlfbxzpuz\",\"description\":\"ispnqzahmgkbrp\",\"timeoutInMinutes\":188498280}") + .toObject(RecoveryGroupManualAction.class); + Assertions.assertEquals("lzlfbxzpuz", model.name()); + Assertions.assertEquals("ispnqzahmgkbrp", model.description()); + Assertions.assertEquals(188498280, model.timeoutInMinutes()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RecoveryGroupManualAction model = new RecoveryGroupManualAction().withName("lzlfbxzpuz") + .withDescription("ispnqzahmgkbrp") + .withTimeoutInMinutes(188498280); + model = BinaryData.fromObject(model).toObject(RecoveryGroupManualAction.class); + Assertions.assertEquals("lzlfbxzpuz", model.name()); + Assertions.assertEquals("ispnqzahmgkbrp", model.description()); + Assertions.assertEquals(188498280, model.timeoutInMinutes()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupPropertiesTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupPropertiesTests.java new file mode 100644 index 000000000000..c7d5a3abc6b3 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupPropertiesTests.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupBaseAction; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class RecoveryGroupPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecoveryGroupProperties model = BinaryData.fromString( + "{\"groupUniqueId\":\"zf\",\"orderId\":585426916,\"description\":\"eyp\",\"preActions\":[{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"mjmwvvjektcx\",\"description\":\"nhwlrsffrzpwvl\",\"timeoutInMinutes\":1792150681},{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"q\",\"description\":\"iqylihkaetck\",\"timeoutInMinutes\":1163515198},{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"fcivfsnkym\",\"description\":\"tqhjfbebrjcx\",\"timeoutInMinutes\":1688727412}],\"postActions\":[{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"wutttxfvjrbi\",\"description\":\"hxepcyvahfnlj\",\"timeoutInMinutes\":442214208},{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"qxj\",\"description\":\"ujqgidok\",\"timeoutInMinutes\":2084359484},{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"ljyoxgvcltb\",\"description\":\"ncghkje\",\"timeoutInMinutes\":331647248},{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"zhbijhtxfv\",\"description\":\"bfs\",\"timeoutInMinutes\":195417612}]}") + .toObject(RecoveryGroupProperties.class); + Assertions.assertEquals("zf", model.groupUniqueId()); + Assertions.assertEquals(585426916, model.orderId()); + Assertions.assertEquals("eyp", model.description()); + Assertions.assertEquals("mjmwvvjektcx", model.preActions().get(0).name()); + Assertions.assertEquals("nhwlrsffrzpwvl", model.preActions().get(0).description()); + Assertions.assertEquals(1792150681, model.preActions().get(0).timeoutInMinutes()); + Assertions.assertEquals("wutttxfvjrbi", model.postActions().get(0).name()); + Assertions.assertEquals("hxepcyvahfnlj", model.postActions().get(0).description()); + Assertions.assertEquals(442214208, model.postActions().get(0).timeoutInMinutes()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RecoveryGroupProperties model = new RecoveryGroupProperties().withGroupUniqueId("zf") + .withOrderId(585426916) + .withDescription("eyp") + .withPreActions(Arrays.asList( + new RecoveryGroupBaseAction().withName("mjmwvvjektcx") + .withDescription("nhwlrsffrzpwvl") + .withTimeoutInMinutes(1792150681), + new RecoveryGroupBaseAction().withName("q") + .withDescription("iqylihkaetck") + .withTimeoutInMinutes(1163515198), + new RecoveryGroupBaseAction().withName("fcivfsnkym") + .withDescription("tqhjfbebrjcx") + .withTimeoutInMinutes(1688727412))) + .withPostActions(Arrays.asList( + new RecoveryGroupBaseAction().withName("wutttxfvjrbi") + .withDescription("hxepcyvahfnlj") + .withTimeoutInMinutes(442214208), + new RecoveryGroupBaseAction().withName("qxj") + .withDescription("ujqgidok") + .withTimeoutInMinutes(2084359484), + new RecoveryGroupBaseAction().withName("ljyoxgvcltb") + .withDescription("ncghkje") + .withTimeoutInMinutes(331647248), + new RecoveryGroupBaseAction().withName("zhbijhtxfv") + .withDescription("bfs") + .withTimeoutInMinutes(195417612))); + model = BinaryData.fromObject(model).toObject(RecoveryGroupProperties.class); + Assertions.assertEquals("zf", model.groupUniqueId()); + Assertions.assertEquals(585426916, model.orderId()); + Assertions.assertEquals("eyp", model.description()); + Assertions.assertEquals("mjmwvvjektcx", model.preActions().get(0).name()); + Assertions.assertEquals("nhwlrsffrzpwvl", model.preActions().get(0).description()); + Assertions.assertEquals(1792150681, model.preActions().get(0).timeoutInMinutes()); + Assertions.assertEquals("wutttxfvjrbi", model.postActions().get(0).name()); + Assertions.assertEquals("hxepcyvahfnlj", model.postActions().get(0).description()); + Assertions.assertEquals(442214208, model.postActions().get(0).timeoutInMinutes()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupTests.java new file mode 100644 index 000000000000..20918e9b8428 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupTests.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroup; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupBaseAction; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class RecoveryGroupTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecoveryGroup model = BinaryData.fromString( + "{\"properties\":{\"groupUniqueId\":\"dptkoenkouk\",\"orderId\":1110747875,\"description\":\"udwtiukbl\",\"preActions\":[{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"kpoc\",\"description\":\"azyxoegukg\",\"timeoutInMinutes\":1764023919},{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"piu\",\"description\":\"ygevqzntypmrbpiz\",\"timeoutInMinutes\":2078386445},{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"r\",\"description\":\"sdpydnfyhxdeoejz\",\"timeoutInMinutes\":947981025},{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"w\",\"description\":\"sjttgzfbish\",\"timeoutInMinutes\":643021552}],\"postActions\":[{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"ajdeyeamdphaga\",\"description\":\"buxwgip\",\"timeoutInMinutes\":1260987021},{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"onowk\",\"description\":\"hwankixzbinjepu\",\"timeoutInMinutes\":1086025239},{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"mryw\",\"description\":\"zoqftiyqzrnkcqvy\",\"timeoutInMinutes\":541571882},{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"whzlsicohoq\",\"description\":\"wvl\",\"timeoutInMinutes\":759862878}]},\"id\":\"vwhheunmmqhgyx\",\"name\":\"konocu\",\"type\":\"oklyaxuconuq\"}") + .toObject(RecoveryGroup.class); + Assertions.assertEquals("dptkoenkouk", model.properties().groupUniqueId()); + Assertions.assertEquals(1110747875, model.properties().orderId()); + Assertions.assertEquals("udwtiukbl", model.properties().description()); + Assertions.assertEquals("kpoc", model.properties().preActions().get(0).name()); + Assertions.assertEquals("azyxoegukg", model.properties().preActions().get(0).description()); + Assertions.assertEquals(1764023919, model.properties().preActions().get(0).timeoutInMinutes()); + Assertions.assertEquals("ajdeyeamdphaga", model.properties().postActions().get(0).name()); + Assertions.assertEquals("buxwgip", model.properties().postActions().get(0).description()); + Assertions.assertEquals(1260987021, model.properties().postActions().get(0).timeoutInMinutes()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RecoveryGroup model + = new RecoveryGroup().withProperties(new RecoveryGroupProperties().withGroupUniqueId("dptkoenkouk") + .withOrderId(1110747875) + .withDescription("udwtiukbl") + .withPreActions(Arrays.asList( + new RecoveryGroupBaseAction().withName("kpoc") + .withDescription("azyxoegukg") + .withTimeoutInMinutes(1764023919), + new RecoveryGroupBaseAction().withName("piu") + .withDescription("ygevqzntypmrbpiz") + .withTimeoutInMinutes(2078386445), + new RecoveryGroupBaseAction().withName("r") + .withDescription("sdpydnfyhxdeoejz") + .withTimeoutInMinutes(947981025), + new RecoveryGroupBaseAction().withName("w") + .withDescription("sjttgzfbish") + .withTimeoutInMinutes(643021552))) + .withPostActions(Arrays.asList( + new RecoveryGroupBaseAction().withName("ajdeyeamdphaga") + .withDescription("buxwgip") + .withTimeoutInMinutes(1260987021), + new RecoveryGroupBaseAction().withName("onowk") + .withDescription("hwankixzbinjepu") + .withTimeoutInMinutes(1086025239), + new RecoveryGroupBaseAction().withName("mryw") + .withDescription("zoqftiyqzrnkcqvy") + .withTimeoutInMinutes(541571882), + new RecoveryGroupBaseAction().withName("whzlsicohoq") + .withDescription("wvl") + .withTimeoutInMinutes(759862878)))); + model = BinaryData.fromObject(model).toObject(RecoveryGroup.class); + Assertions.assertEquals("dptkoenkouk", model.properties().groupUniqueId()); + Assertions.assertEquals(1110747875, model.properties().orderId()); + Assertions.assertEquals("udwtiukbl", model.properties().description()); + Assertions.assertEquals("kpoc", model.properties().preActions().get(0).name()); + Assertions.assertEquals("azyxoegukg", model.properties().preActions().get(0).description()); + Assertions.assertEquals(1764023919, model.properties().preActions().get(0).timeoutInMinutes()); + Assertions.assertEquals("ajdeyeamdphaga", model.properties().postActions().get(0).name()); + Assertions.assertEquals("buxwgip", model.properties().postActions().get(0).description()); + Assertions.assertEquals(1260987021, model.properties().postActions().get(0).timeoutInMinutes()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupsSettingTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupsSettingTests.java new file mode 100644 index 000000000000..344ef31567a7 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryGroupsSettingTests.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroup; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupBaseAction; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupProperties; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryGroupsSetting; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class RecoveryGroupsSettingTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecoveryGroupsSetting model = BinaryData.fromString( + "{\"defaultGroup\":{\"properties\":{\"groupUniqueId\":\"wqsmbsur\",\"orderId\":760240945,\"description\":\"imoryocfsfksym\",\"preActions\":[{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"stkiiuxhqyud\",\"description\":\"rrqnbpoczvyifqrv\",\"timeoutInMinutes\":1066949673}],\"postActions\":[{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"sllr\",\"description\":\"vdfwatkpn\",\"timeoutInMinutes\":676639191},{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"lexxbczwtru\",\"description\":\"qzbqjvsov\",\"timeoutInMinutes\":79438477}]},\"id\":\"kacspkw\",\"name\":\"hzdobpxjmflbvvnc\",\"type\":\"rkcciwwzjuqk\"},\"additionalGroups\":[{\"properties\":{\"groupUniqueId\":\"jiwkuofoskghsau\",\"orderId\":1010728460,\"description\":\"mjmvxieduugidyjr\",\"preActions\":[{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"y\",\"description\":\"svexcsonpclhoco\",\"timeoutInMinutes\":1856393411}],\"postActions\":[{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"ev\",\"description\":\"ggzfbu\",\"timeoutInMinutes\":1146785059},{\"type\":\"RecoveryGroupBaseAction\",\"name\":\"mvfaxkffeiith\",\"description\":\"m\",\"timeoutInMinutes\":511745945}]},\"id\":\"v\",\"name\":\"hxmzsbbzoggig\",\"type\":\"xwburvjxxjns\"}]}") + .toObject(RecoveryGroupsSetting.class); + Assertions.assertEquals("wqsmbsur", model.defaultGroup().properties().groupUniqueId()); + Assertions.assertEquals(760240945, model.defaultGroup().properties().orderId()); + Assertions.assertEquals("imoryocfsfksym", model.defaultGroup().properties().description()); + Assertions.assertEquals("stkiiuxhqyud", model.defaultGroup().properties().preActions().get(0).name()); + Assertions.assertEquals("rrqnbpoczvyifqrv", + model.defaultGroup().properties().preActions().get(0).description()); + Assertions.assertEquals(1066949673, model.defaultGroup().properties().preActions().get(0).timeoutInMinutes()); + Assertions.assertEquals("sllr", model.defaultGroup().properties().postActions().get(0).name()); + Assertions.assertEquals("vdfwatkpn", model.defaultGroup().properties().postActions().get(0).description()); + Assertions.assertEquals(676639191, model.defaultGroup().properties().postActions().get(0).timeoutInMinutes()); + Assertions.assertEquals("jiwkuofoskghsau", model.additionalGroups().get(0).properties().groupUniqueId()); + Assertions.assertEquals(1010728460, model.additionalGroups().get(0).properties().orderId()); + Assertions.assertEquals("mjmvxieduugidyjr", model.additionalGroups().get(0).properties().description()); + Assertions.assertEquals("y", model.additionalGroups().get(0).properties().preActions().get(0).name()); + Assertions.assertEquals("svexcsonpclhoco", + model.additionalGroups().get(0).properties().preActions().get(0).description()); + Assertions.assertEquals(1856393411, + model.additionalGroups().get(0).properties().preActions().get(0).timeoutInMinutes()); + Assertions.assertEquals("ev", model.additionalGroups().get(0).properties().postActions().get(0).name()); + Assertions.assertEquals("ggzfbu", + model.additionalGroups().get(0).properties().postActions().get(0).description()); + Assertions.assertEquals(1146785059, + model.additionalGroups().get(0).properties().postActions().get(0).timeoutInMinutes()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RecoveryGroupsSetting model = new RecoveryGroupsSetting() + .withDefaultGroup( + new RecoveryGroup().withProperties(new RecoveryGroupProperties().withGroupUniqueId("wqsmbsur") + .withOrderId(760240945) + .withDescription("imoryocfsfksym") + .withPreActions(Arrays.asList(new RecoveryGroupBaseAction().withName("stkiiuxhqyud") + .withDescription("rrqnbpoczvyifqrv") + .withTimeoutInMinutes(1066949673))) + .withPostActions(Arrays.asList( + new RecoveryGroupBaseAction().withName("sllr") + .withDescription("vdfwatkpn") + .withTimeoutInMinutes(676639191), + new RecoveryGroupBaseAction().withName("lexxbczwtru") + .withDescription("qzbqjvsov") + .withTimeoutInMinutes(79438477))))) + .withAdditionalGroups(Arrays.asList( + new RecoveryGroup().withProperties(new RecoveryGroupProperties().withGroupUniqueId("jiwkuofoskghsau") + .withOrderId(1010728460) + .withDescription("mjmvxieduugidyjr") + .withPreActions(Arrays.asList(new RecoveryGroupBaseAction().withName("y") + .withDescription("svexcsonpclhoco") + .withTimeoutInMinutes(1856393411))) + .withPostActions(Arrays.asList( + new RecoveryGroupBaseAction().withName("ev") + .withDescription("ggzfbu") + .withTimeoutInMinutes(1146785059), + new RecoveryGroupBaseAction().withName("mvfaxkffeiith") + .withDescription("m") + .withTimeoutInMinutes(511745945)))))); + model = BinaryData.fromObject(model).toObject(RecoveryGroupsSetting.class); + Assertions.assertEquals("wqsmbsur", model.defaultGroup().properties().groupUniqueId()); + Assertions.assertEquals(760240945, model.defaultGroup().properties().orderId()); + Assertions.assertEquals("imoryocfsfksym", model.defaultGroup().properties().description()); + Assertions.assertEquals("stkiiuxhqyud", model.defaultGroup().properties().preActions().get(0).name()); + Assertions.assertEquals("rrqnbpoczvyifqrv", + model.defaultGroup().properties().preActions().get(0).description()); + Assertions.assertEquals(1066949673, model.defaultGroup().properties().preActions().get(0).timeoutInMinutes()); + Assertions.assertEquals("sllr", model.defaultGroup().properties().postActions().get(0).name()); + Assertions.assertEquals("vdfwatkpn", model.defaultGroup().properties().postActions().get(0).description()); + Assertions.assertEquals(676639191, model.defaultGroup().properties().postActions().get(0).timeoutInMinutes()); + Assertions.assertEquals("jiwkuofoskghsau", model.additionalGroups().get(0).properties().groupUniqueId()); + Assertions.assertEquals(1010728460, model.additionalGroups().get(0).properties().orderId()); + Assertions.assertEquals("mjmvxieduugidyjr", model.additionalGroups().get(0).properties().description()); + Assertions.assertEquals("y", model.additionalGroups().get(0).properties().preActions().get(0).name()); + Assertions.assertEquals("svexcsonpclhoco", + model.additionalGroups().get(0).properties().preActions().get(0).description()); + Assertions.assertEquals(1856393411, + model.additionalGroups().get(0).properties().preActions().get(0).timeoutInMinutes()); + Assertions.assertEquals("ev", model.additionalGroups().get(0).properties().postActions().get(0).name()); + Assertions.assertEquals("ggzfbu", + model.additionalGroups().get(0).properties().postActions().get(0).description()); + Assertions.assertEquals(1146785059, + model.additionalGroups().get(0).properties().postActions().get(0).timeoutInMinutes()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionBaseResponseInnerTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionBaseResponseInnerTests.java new file mode 100644 index 000000000000..70df7897bcaf --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionBaseResponseInnerTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.RecoveryPlanActionBaseResponseInner; +import org.junit.jupiter.api.Assertions; + +public final class RecoveryPlanActionBaseResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecoveryPlanActionBaseResponseInner model = BinaryData.fromString("{\"jobId\":\"lwnwxuqlcvydyp\"}") + .toObject(RecoveryPlanActionBaseResponseInner.class); + Assertions.assertEquals("lwnwxuqlcvydyp", model.jobId()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsCheckReadinessMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsCheckReadinessMockTests.java new file mode 100644 index 000000000000..cb9d4bedf23c --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsCheckReadinessMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class RecoveryPlanActionsCheckReadinessMockTests { + @Test + public void testCheckReadiness() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.recoveryPlanActions() + .checkReadiness("rrp", "jttbstv", "eaqnrmvvfkoxm", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsFailoverCommitMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsFailoverCommitMockTests.java new file mode 100644 index 000000000000..7fba92ec10a2 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsFailoverCommitMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanActionBaseResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class RecoveryPlanActionsFailoverCommitMockTests { + @Test + public void testFailoverCommit() throws Exception { + String responseStr = "{\"jobId\":\"vnwsw\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + RecoveryPlanActionBaseResponse response = manager.recoveryPlanActions() + .failoverCommit("hajlfn", "hiqfyuttdiy", "b", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("vnwsw", response.jobId()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsFailoverMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsFailoverMockTests.java new file mode 100644 index 000000000000..f4e0077f3038 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsFailoverMockTests.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.ExecutionConfigurations; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverDirectionTypes; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequestProperties; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanActionBaseResponse; +import com.azure.resourcemanager.resiliencemanagement.models.UserConsent; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class RecoveryPlanActionsFailoverMockTests { + @Test + public void testFailover() throws Exception { + String responseStr = "{\"jobId\":\"wzfgbrttuiaclkie\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + RecoveryPlanActionBaseResponse response = manager.recoveryPlanActions() + .failover("ghktuidvrm", "zlpdwwex", "mzvlazipbh", + new FailoverRequest().withFailoverDirection(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS) + .withFailoverRequestProperties( + new FailoverRequestProperties().withSourceLocations(Arrays.asList("sgnyyuuzivensrp")) + .withSelectedResourceIds(Arrays.asList("yvpkpatlbijpzgsk", "rfhfvo", "mknbnxwcdommpv")) + .withExecutionConfigurations( + new ExecutionConfigurations().withUserConsent(UserConsent.UNSPECIFIED))), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("wzfgbrttuiaclkie", response.jobId()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsReprotectMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsReprotectMockTests.java new file mode 100644 index 000000000000..d0afa830fb26 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsReprotectMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanActionBaseResponse; +import com.azure.resourcemanager.resiliencemanagement.models.ReprotectRequest; +import com.azure.resourcemanager.resiliencemanagement.models.ReprotectRequestProperties; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class RecoveryPlanActionsReprotectMockTests { + @Test + public void testReprotect() throws Exception { + String responseStr = "{\"jobId\":\"vnynkb\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + RecoveryPlanActionBaseResponse response = manager.recoveryPlanActions() + .reprotect("txkyctwwgzwxjlm", "cvogygzyvne", "zaifghtmoqqtlff", + new ReprotectRequest().withReprotectRequestProperties(new ReprotectRequestProperties() + .withSelectedResourceIds(Arrays.asList("rkjjjavfqnvhnq", "ewdogiyetesy", "vidbztjhqtfb"))), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("vnynkb", response.jobId()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsTestFailoverCleanupMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsTestFailoverCleanupMockTests.java new file mode 100644 index 000000000000..b6eb2d62d4f7 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsTestFailoverCleanupMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanActionBaseResponse; +import com.azure.resourcemanager.resiliencemanagement.models.TestFailoverCleanupRequest; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class RecoveryPlanActionsTestFailoverCleanupMockTests { + @Test + public void testTestFailoverCleanup() throws Exception { + String responseStr = "{\"jobId\":\"cecfehuwaoaguh\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + RecoveryPlanActionBaseResponse response = manager.recoveryPlanActions() + .testFailoverCleanup("tce", "kdqkkyihzt", "eq", + new TestFailoverCleanupRequest().withComments("qzgwldoychil"), com.azure.core.util.Context.NONE); + + Assertions.assertEquals("cecfehuwaoaguh", response.jobId()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsTestFailoverMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsTestFailoverMockTests.java new file mode 100644 index 000000000000..319125b586f4 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsTestFailoverMockTests.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.ExecutionConfigurations; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverDirectionTypes; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequestProperties; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanActionBaseResponse; +import com.azure.resourcemanager.resiliencemanagement.models.UserConsent; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class RecoveryPlanActionsTestFailoverMockTests { + @Test + public void testTestFailover() throws Exception { + String responseStr = "{\"jobId\":\"ccyd\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + RecoveryPlanActionBaseResponse response = manager.recoveryPlanActions() + .testFailover("etnjuhpsprkz", "aupia", "cxnafbwqrooh", new FailoverRequest() + .withFailoverDirection(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS) + .withFailoverRequestProperties(new FailoverRequestProperties() + .withSourceLocations(Arrays.asList("maonurj", "umghihpvecmsl", "lbl")) + .withSelectedResourceIds(Arrays.asList("lt", "sjuscvsfxigctmg", "uupb")) + .withExecutionConfigurations(new ExecutionConfigurations().withUserConsent(UserConsent.ALLOWED))), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ccyd", response.jobId()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForFailoverCommitMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForFailoverCommitMockTests.java new file mode 100644 index 000000000000..e9f6f064499d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForFailoverCommitMockTests.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.QualificationState; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceInclusionState; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceProtectionSolutionType; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForRecoveryOperationBaseResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class RecoveryPlanActionsValidateForFailoverCommitMockTests { + @Test + public void testValidateForFailoverCommit() throws Exception { + String responseStr + = "{\"recoveryResourceQualifications\":[{\"recoveryResource\":{\"properties\":{\"recoveryResourceUniqueId\":\"qhnlbqnbld\",\"provisioningState\":\"Updating\",\"resourceId\":\"lgsc\",\"resourceLocation\":\"ri\",\"resourcePhysicalZones\":[\"srrm\",\"ucsofldpuviyf\",\"aabeolhbhlvbmxuq\",\"bsxtkcudfbsfarfs\"],\"inclusionState\":\"Included\",\"needsAttention\":true,\"attentionReasons\":[\"nqpvwgfstmhqykiz\"],\"protectionStatus\":\"HighlyAvailable\",\"resourceProtectionSolutions\":[{\"isAutoFailover\":true}],\"selectedProtectionSolutionType\":\"AzureNative\",\"selectedProtectionSolutionSetting\":{\"protectionSolutionType\":\"ResourceBaseProtectionSolutionSetting\"},\"recoveryGroupId\":\"uqvoxmycjimryv\",\"associatedIdentity\":{\"type\":\"None\"},\"errorDetails\":{}},\"id\":\"pbmz\",\"name\":\"w\",\"type\":\"sydsxwefohe\"},\"operationQualificationDetails\":{\"qualificationState\":\"NotQualified\",\"notQualifiedReasons\":[\"pwndyqlea\",\"lklmtkhlo\",\"kxxpvbrd\",\"jmzsyzfh\"]}},{\"recoveryResource\":{\"properties\":{\"recoveryResourceUniqueId\":\"lhikcyychunsj\",\"provisioningState\":\"Succeeded\",\"resourceId\":\"twszhvvuic\",\"resourceLocation\":\"vtrrmhwrbfdpyflu\",\"resourcePhysicalZones\":[\"jgl\",\"ocu\",\"zlwhhmemhooclu\",\"n\"],\"inclusionState\":\"Excluded\",\"needsAttention\":false,\"attentionReasons\":[\"jk\",\"mykyujxsglhs\",\"rryejylmbkzudnig\"],\"protectionStatus\":\"HighlyAvailable\",\"resourceProtectionSolutions\":[{\"isAutoFailover\":true},{\"isAutoFailover\":true},{\"isAutoFailover\":false},{\"isAutoFailover\":true}],\"selectedProtectionSolutionType\":\"AzureNative\",\"selectedProtectionSolutionSetting\":{\"protectionSolutionType\":\"ResourceBaseProtectionSolutionSetting\"},\"recoveryGroupId\":\"zzjgnr\",\"associatedIdentity\":{\"type\":\"SystemAssigned\"},\"errorDetails\":{}},\"id\":\"qotoihiqakydiwfb\",\"name\":\"kwpzdqtvh\",\"type\":\"spodaqax\"},\"operationQualificationDetails\":{\"qualificationState\":\"Qualified\",\"notQualifiedReasons\":[\"etgbebjfulb\",\"oichdlpnfpubnt\",\"batzviqsows\"]}}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ValidateForRecoveryOperationBaseResponse response = manager.recoveryPlanActions() + .validateForFailoverCommit("gahxkumasjcaa", "fdmmcpug", "ehqepvufhbzehe", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("qhnlbqnbld", + response.recoveryResourceQualifications() + .get(0) + .recoveryResource() + .properties() + .recoveryResourceUniqueId()); + Assertions.assertEquals(ResourceInclusionState.INCLUDED, + response.recoveryResourceQualifications().get(0).recoveryResource().properties().inclusionState()); + Assertions.assertEquals(ResourceProtectionSolutionType.AZURE_NATIVE, + response.recoveryResourceQualifications() + .get(0) + .recoveryResource() + .properties() + .selectedProtectionSolutionType()); + Assertions.assertEquals("uqvoxmycjimryv", + response.recoveryResourceQualifications().get(0).recoveryResource().properties().recoveryGroupId()); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, + response.recoveryResourceQualifications() + .get(0) + .recoveryResource() + .properties() + .associatedIdentity() + .type()); + Assertions.assertEquals(QualificationState.NOT_QUALIFIED, + response.recoveryResourceQualifications().get(0).operationQualificationDetails().qualificationState()); + Assertions.assertEquals("pwndyqlea", + response.recoveryResourceQualifications() + .get(0) + .operationQualificationDetails() + .notQualifiedReasons() + .get(0)); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForFailoverMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForFailoverMockTests.java new file mode 100644 index 000000000000..8556c6c24fb5 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForFailoverMockTests.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.ExecutionConfigurations; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverDirectionTypes; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequestProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.QualificationState; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceInclusionState; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceProtectionSolutionType; +import com.azure.resourcemanager.resiliencemanagement.models.UserConsent; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForRecoveryOperationBaseResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class RecoveryPlanActionsValidateForFailoverMockTests { + @Test + public void testValidateForFailover() throws Exception { + String responseStr + = "{\"recoveryResourceQualifications\":[{\"recoveryResource\":{\"properties\":{\"recoveryResourceUniqueId\":\"djk\",\"provisioningState\":\"Deleting\",\"resourceId\":\"idfv\",\"resourceLocation\":\"g\",\"resourcePhysicalZones\":[\"fuijtkbus\"],\"inclusionState\":\"Excluded\",\"needsAttention\":true,\"attentionReasons\":[\"ayiansharujtji\"],\"protectionStatus\":\"Protected\",\"resourceProtectionSolutions\":[{\"isAutoFailover\":false},{\"isAutoFailover\":false}],\"selectedProtectionSolutionType\":\"AzureSiteRecovery\",\"selectedProtectionSolutionSetting\":{\"protectionSolutionType\":\"ResourceBaseProtectionSolutionSetting\"},\"recoveryGroupId\":\"kpqhjpenuygbq\",\"associatedIdentity\":{\"type\":\"UserAssigned\"},\"errorDetails\":{}},\"id\":\"ewvnqvcdlgu\",\"name\":\"ucmfdj\",\"type\":\"nlaxpunjqikcz\"},\"operationQualificationDetails\":{\"qualificationState\":\"Qualified\",\"notQualifiedReasons\":[\"acgxmfcsse\",\"x\"]}},{\"recoveryResource\":{\"properties\":{\"recoveryResourceUniqueId\":\"vs\",\"provisioningState\":\"Failed\",\"resourceId\":\"wntsjgqrsxy\",\"resourceLocation\":\"uuuybnchrsziz\",\"resourcePhysicalZones\":[\"elyetndnbf\",\"yggagflnlgmt\",\"wahzjmucftbyr\"],\"inclusionState\":\"Excluded\",\"needsAttention\":true,\"attentionReasons\":[\"igqfusuc\",\"zmkw\",\"lsnoxaxmqeqalh\",\"jnhgwydyyn\"],\"protectionStatus\":\"Unknown\",\"resourceProtectionSolutions\":[{\"isAutoFailover\":false},{\"isAutoFailover\":false}],\"selectedProtectionSolutionType\":\"CrossZoneVMRecovery\",\"selectedProtectionSolutionSetting\":{\"protectionSolutionType\":\"ResourceBaseProtectionSolutionSetting\"},\"recoveryGroupId\":\"narfdlpukhpyrn\",\"associatedIdentity\":{\"type\":\"SystemAssigned\"},\"errorDetails\":{}},\"id\":\"pe\",\"name\":\"gkhnmgbrouxddbh\",\"type\":\"hpfpazjzoywjxhp\"},\"operationQualificationDetails\":{\"qualificationState\":\"Excluded\",\"notQualifiedReasons\":[\"ntacn\",\"qwtehtuevr\"]}},{\"recoveryResource\":{\"properties\":{\"recoveryResourceUniqueId\":\"ljyoogwx\",\"provisioningState\":\"Canceled\",\"resourceId\":\"uug\",\"resourceLocation\":\"sreurfqkfuare\",\"resourcePhysicalZones\":[\"hhtklnvnafvvkyfe\",\"ev\",\"bo\"],\"inclusionState\":\"Excluded\",\"needsAttention\":true,\"attentionReasons\":[\"okkhminq\"],\"protectionStatus\":\"Protected\",\"resourceProtectionSolutions\":[{\"isAutoFailover\":true}],\"selectedProtectionSolutionType\":\"CustomRunbook\",\"selectedProtectionSolutionSetting\":{\"protectionSolutionType\":\"ResourceBaseProtectionSolutionSetting\"},\"recoveryGroupId\":\"xxewu\",\"associatedIdentity\":{\"type\":\"SystemAssigned,UserAssigned\"},\"errorDetails\":{}},\"id\":\"db\",\"name\":\"h\",\"type\":\"qdtvqecrqctmxx\"},\"operationQualificationDetails\":{\"qualificationState\":\"Qualified\",\"notQualifiedReasons\":[\"mflhuytxzvtznapx\",\"annovvoxczytpr\",\"nwvroevytlyokrr\"]}},{\"recoveryResource\":{\"properties\":{\"recoveryResourceUniqueId\":\"uuxvnsasbcry\",\"provisioningState\":\"Accepted\",\"resourceId\":\"zrxklobd\",\"resourceLocation\":\"azpmkmlmv\",\"resourcePhysicalZones\":[\"xzopjhbzxl\"],\"inclusionState\":\"Included\",\"needsAttention\":false,\"attentionReasons\":[\"tfgxqbawpcb\",\"nzqcy\",\"napqo\",\"yuicdhzbdy\"],\"protectionStatus\":\"HighlyAvailable\",\"resourceProtectionSolutions\":[{\"isAutoFailover\":false},{\"isAutoFailover\":true},{\"isAutoFailover\":true},{\"isAutoFailover\":false}],\"selectedProtectionSolutionType\":\"CustomRunbook\",\"selectedProtectionSolutionSetting\":{\"protectionSolutionType\":\"ResourceBaseProtectionSolutionSetting\"},\"recoveryGroupId\":\"m\",\"associatedIdentity\":{\"type\":\"None\"},\"errorDetails\":{}},\"id\":\"fmuvapckccr\",\"name\":\"vwe\",\"type\":\"oxoyyukp\"},\"operationQualificationDetails\":{\"qualificationState\":\"NotQualified\",\"notQualifiedReasons\":[\"moiroqb\",\"shbraga\",\"yyrmfsvbp\",\"vbopfppdbwnu\"]}}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ValidateForRecoveryOperationBaseResponse response = manager.recoveryPlanActions() + .validateForFailover("qacsl", "otoebnfxofv", "jkgd", new FailoverRequest() + .withFailoverDirection(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS) + .withFailoverRequestProperties(new FailoverRequestProperties().withSourceLocations(Arrays.asList("f")) + .withSelectedResourceIds(Arrays.asList("jwabmd", "jtmvc", "pexcmjurbuhh", "kyqltqsrogt")) + .withExecutionConfigurations(new ExecutionConfigurations().withUserConsent(UserConsent.ALLOWED))), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("djk", + response.recoveryResourceQualifications() + .get(0) + .recoveryResource() + .properties() + .recoveryResourceUniqueId()); + Assertions.assertEquals(ResourceInclusionState.EXCLUDED, + response.recoveryResourceQualifications().get(0).recoveryResource().properties().inclusionState()); + Assertions.assertEquals(ResourceProtectionSolutionType.AZURE_SITE_RECOVERY, + response.recoveryResourceQualifications() + .get(0) + .recoveryResource() + .properties() + .selectedProtectionSolutionType()); + Assertions.assertEquals("kpqhjpenuygbq", + response.recoveryResourceQualifications().get(0).recoveryResource().properties().recoveryGroupId()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, + response.recoveryResourceQualifications() + .get(0) + .recoveryResource() + .properties() + .associatedIdentity() + .type()); + Assertions.assertEquals(QualificationState.QUALIFIED, + response.recoveryResourceQualifications().get(0).operationQualificationDetails().qualificationState()); + Assertions.assertEquals("acgxmfcsse", + response.recoveryResourceQualifications() + .get(0) + .operationQualificationDetails() + .notQualifiedReasons() + .get(0)); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForReprotectMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForReprotectMockTests.java new file mode 100644 index 000000000000..98ffc453b5d8 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForReprotectMockTests.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.QualificationState; +import com.azure.resourcemanager.resiliencemanagement.models.ReprotectRequest; +import com.azure.resourcemanager.resiliencemanagement.models.ReprotectRequestProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceInclusionState; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceProtectionSolutionType; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForRecoveryOperationBaseResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class RecoveryPlanActionsValidateForReprotectMockTests { + @Test + public void testValidateForReprotect() throws Exception { + String responseStr + = "{\"recoveryResourceQualifications\":[{\"recoveryResource\":{\"properties\":{\"recoveryResourceUniqueId\":\"qagnepzwakl\",\"provisioningState\":\"Succeeded\",\"resourceId\":\"qqqagwwrxaomzi\",\"resourceLocation\":\"lrrcz\",\"resourcePhysicalZones\":[\"hhltnjadhqo\"],\"inclusionState\":\"Excluded\",\"needsAttention\":true,\"attentionReasons\":[\"eayfbpcmspl\",\"yrrueqth\",\"mg\",\"mbscbbx\"],\"protectionStatus\":\"HighlyAvailable\",\"resourceProtectionSolutions\":[{\"isAutoFailover\":false},{\"isAutoFailover\":true},{\"isAutoFailover\":false}],\"selectedProtectionSolutionType\":\"AzureSiteRecovery\",\"selectedProtectionSolutionSetting\":{\"protectionSolutionType\":\"ResourceBaseProtectionSolutionSetting\"},\"recoveryGroupId\":\"dbwdpyqyybxubmdn\",\"associatedIdentity\":{\"type\":\"None\"},\"errorDetails\":{}},\"id\":\"wremjel\",\"name\":\"qacigeleo\",\"type\":\"d\"},\"operationQualificationDetails\":{\"qualificationState\":\"NotQualified\",\"notQualifiedReasons\":[\"wzkjopwbeonrlkw\",\"dqybx\"]}},{\"recoveryResource\":{\"properties\":{\"recoveryResourceUniqueId\":\"akxcptsoqfyiaseq\",\"provisioningState\":\"Updating\",\"resourceId\":\"ttzrazisgyki\",\"resourceLocation\":\"mvanbwzo\",\"resourcePhysicalZones\":[\"rx\",\"bsojk\",\"inhmdptys\"],\"inclusionState\":\"Excluded\",\"needsAttention\":true,\"attentionReasons\":[\"xojpslsvjgp\",\"iufiqwo\",\"xqvapcohh\"],\"protectionStatus\":\"HighlyAvailable\",\"resourceProtectionSolutions\":[{\"isAutoFailover\":false},{\"isAutoFailover\":false}],\"selectedProtectionSolutionType\":\"CrossZoneVMRecovery\",\"selectedProtectionSolutionSetting\":{\"protectionSolutionType\":\"ResourceBaseProtectionSolutionSetting\"},\"recoveryGroupId\":\"zrzdcgd\",\"associatedIdentity\":{\"type\":\"SystemAssigned\"},\"errorDetails\":{}},\"id\":\"ibcawetzqddtjw\",\"name\":\"ljhznamtuatmzwcj\",\"type\":\"nc\"},\"operationQualificationDetails\":{\"qualificationState\":\"Qualified\",\"notQualifiedReasons\":[\"mizvgbgatzuuvbx\"]}},{\"recoveryResource\":{\"properties\":{\"recoveryResourceUniqueId\":\"rebwggahtt\",\"provisioningState\":\"Deleting\",\"resourceId\":\"v\",\"resourceLocation\":\"qfutlxjo\",\"resourcePhysicalZones\":[\"sunwqrjzfrgqhaoh\",\"mbuocnjrohmbp\",\"ryxameblydyvkfkm\",\"ocxnehvsmtodl\"],\"inclusionState\":\"Excluded\",\"needsAttention\":true,\"attentionReasons\":[\"ygvoavyunssxlgh\",\"ee\",\"jlgvvpase\",\"sgb\"],\"protectionStatus\":\"HighlyAvailable\",\"resourceProtectionSolutions\":[{\"isAutoFailover\":true}],\"selectedProtectionSolutionType\":\"CrossZoneVMRecovery\",\"selectedProtectionSolutionSetting\":{\"protectionSolutionType\":\"ResourceBaseProtectionSolutionSetting\"},\"recoveryGroupId\":\"gaqi\",\"associatedIdentity\":{\"type\":\"UserAssigned\"},\"errorDetails\":{}},\"id\":\"wrq\",\"name\":\"fulopmjnlexwhcb\",\"type\":\"pibkephuu\"},\"operationQualificationDetails\":{\"qualificationState\":\"NotQualified\",\"notQualifiedReasons\":[\"t\",\"toyint\",\"pbrlcyrduczkgofx\",\"fsrucv\"]}}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ValidateForRecoveryOperationBaseResponse response = manager.recoveryPlanActions() + .validateForReprotect("urnnqbnqbpiz", "qltgrd", "gypxrxvbfihwuhvc", + new ReprotectRequest().withReprotectRequestProperties( + new ReprotectRequestProperties().withSelectedResourceIds(Arrays.asList("rbxrblmliowxihsp"))), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("qagnepzwakl", + response.recoveryResourceQualifications() + .get(0) + .recoveryResource() + .properties() + .recoveryResourceUniqueId()); + Assertions.assertEquals(ResourceInclusionState.EXCLUDED, + response.recoveryResourceQualifications().get(0).recoveryResource().properties().inclusionState()); + Assertions.assertEquals(ResourceProtectionSolutionType.AZURE_SITE_RECOVERY, + response.recoveryResourceQualifications() + .get(0) + .recoveryResource() + .properties() + .selectedProtectionSolutionType()); + Assertions.assertEquals("dbwdpyqyybxubmdn", + response.recoveryResourceQualifications().get(0).recoveryResource().properties().recoveryGroupId()); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, + response.recoveryResourceQualifications() + .get(0) + .recoveryResource() + .properties() + .associatedIdentity() + .type()); + Assertions.assertEquals(QualificationState.NOT_QUALIFIED, + response.recoveryResourceQualifications().get(0).operationQualificationDetails().qualificationState()); + Assertions.assertEquals("wzkjopwbeonrlkw", + response.recoveryResourceQualifications() + .get(0) + .operationQualificationDetails() + .notQualifiedReasons() + .get(0)); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForTestFailoverCleanupMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForTestFailoverCleanupMockTests.java new file mode 100644 index 000000000000..2e5df6158fd7 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForTestFailoverCleanupMockTests.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.QualificationState; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceInclusionState; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceProtectionSolutionType; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForRecoveryOperationBaseResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class RecoveryPlanActionsValidateForTestFailoverCleanupMockTests { + @Test + public void testValidateForTestFailoverCleanup() throws Exception { + String responseStr + = "{\"recoveryResourceQualifications\":[{\"recoveryResource\":{\"properties\":{\"recoveryResourceUniqueId\":\"wankltytmhdroznn\",\"provisioningState\":\"Provisioning\",\"resourceId\":\"ktgj\",\"resourceLocation\":\"gguxhemlwyw\",\"resourcePhysicalZones\":[\"czg\",\"bukklels\"],\"inclusionState\":\"Excluded\",\"needsAttention\":false,\"attentionReasons\":[\"xzujksrlsm\"],\"protectionStatus\":\"NotProtected\",\"resourceProtectionSolutions\":[{\"isAutoFailover\":true},{\"isAutoFailover\":true}],\"selectedProtectionSolutionType\":\"CustomRunbook\",\"selectedProtectionSolutionSetting\":{\"protectionSolutionType\":\"ResourceBaseProtectionSolutionSetting\"},\"recoveryGroupId\":\"doewbidyvt\",\"associatedIdentity\":{\"type\":\"SystemAssigned,UserAssigned\"},\"errorDetails\":{}},\"id\":\"gpiudeug\",\"name\":\"sxze\",\"type\":\"paxwkufyk\"},\"operationQualificationDetails\":{\"qualificationState\":\"Unknown\",\"notQualifiedReasons\":[\"xepmrut\",\"nabaobnslujd\",\"ltymkmvguihywart\"]}},{\"recoveryResource\":{\"properties\":{\"recoveryResourceUniqueId\":\"phkixkykxdssjpe\",\"provisioningState\":\"Accepted\",\"resourceId\":\"fxhikkflrmymyi\",\"resourceLocation\":\"qlhris\",\"resourcePhysicalZones\":[\"miii\",\"v\"],\"inclusionState\":\"Excluded\",\"needsAttention\":false,\"attentionReasons\":[\"gqkctotiowlxte\",\"dptjgwdtgukranb\",\"wphqlkccuzgygqw\",\"hoi\"],\"protectionStatus\":\"Protected\",\"resourceProtectionSolutions\":[{\"isAutoFailover\":false},{\"isAutoFailover\":true},{\"isAutoFailover\":true}],\"selectedProtectionSolutionType\":\"None\",\"selectedProtectionSolutionSetting\":{\"protectionSolutionType\":\"ResourceBaseProtectionSolutionSetting\"},\"recoveryGroupId\":\"awuwzdufypivls\",\"associatedIdentity\":{\"type\":\"SystemAssigned\"},\"errorDetails\":{}},\"id\":\"cubkmi\",\"name\":\"oxxkubvp\",\"type\":\"avp\"},\"operationQualificationDetails\":{\"qualificationState\":\"Unknown\",\"notQualifiedReasons\":[\"bqgvgovpbbtte\",\"joknssqyzqedik\"]}},{\"recoveryResource\":{\"properties\":{\"recoveryResourceUniqueId\":\"rdbiqmrjge\",\"provisioningState\":\"Canceled\",\"resourceId\":\"lg\",\"resourceLocation\":\"fiwzcxmjpbyep\",\"resourcePhysicalZones\":[\"t\"],\"inclusionState\":\"Included\",\"needsAttention\":false,\"attentionReasons\":[\"yfqi\"],\"protectionStatus\":\"Protected\",\"resourceProtectionSolutions\":[{\"isAutoFailover\":true},{\"isAutoFailover\":true}],\"selectedProtectionSolutionType\":\"AzureNative\",\"selectedProtectionSolutionSetting\":{\"protectionSolutionType\":\"ResourceBaseProtectionSolutionSetting\"},\"recoveryGroupId\":\"cabvnuil\",\"associatedIdentity\":{\"type\":\"UserAssigned\"},\"errorDetails\":{}},\"id\":\"wlpaugmrmfjlrxwt\",\"name\":\"aukhfkvcisiz\",\"type\":\"oaedsxjwuivedwcg\"},\"operationQualificationDetails\":{\"qualificationState\":\"NotQualified\",\"notQualifiedReasons\":[\"xeiqbpsmg\",\"mguaml\",\"dlrgms\",\"lzgaufcshhvnew\"]}},{\"recoveryResource\":{\"properties\":{\"recoveryResourceUniqueId\":\"xkym\",\"provisioningState\":\"Deleting\",\"resourceId\":\"xrjkixtwb\",\"resourceLocation\":\"oypnyg\",\"resourcePhysicalZones\":[\"xcy\",\"hkgmnsg\",\"pxycphdr\"],\"inclusionState\":\"Excluded\",\"needsAttention\":false,\"attentionReasons\":[\"omacluzvxnqmhr\",\"qpd\",\"wmkoisq\",\"ssffxuifmc\"],\"protectionStatus\":\"Unknown\",\"resourceProtectionSolutions\":[{\"isAutoFailover\":true}],\"selectedProtectionSolutionType\":\"AzureSiteRecovery\",\"selectedProtectionSolutionSetting\":{\"protectionSolutionType\":\"ResourceBaseProtectionSolutionSetting\"},\"recoveryGroupId\":\"dzsylollgtrczz\",\"associatedIdentity\":{\"type\":\"UserAssigned\"},\"errorDetails\":{}},\"id\":\"ji\",\"name\":\"p\",\"type\":\"uaurkihcir\"},\"operationQualificationDetails\":{\"qualificationState\":\"Qualified\",\"notQualifiedReasons\":[\"xrdcoxnbkkja\"]}}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ValidateForRecoveryOperationBaseResponse response = manager.recoveryPlanActions() + .validateForTestFailoverCleanup("xt", "ddpqt", "ehnmnaoyankco", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("wankltytmhdroznn", + response.recoveryResourceQualifications() + .get(0) + .recoveryResource() + .properties() + .recoveryResourceUniqueId()); + Assertions.assertEquals(ResourceInclusionState.EXCLUDED, + response.recoveryResourceQualifications().get(0).recoveryResource().properties().inclusionState()); + Assertions.assertEquals(ResourceProtectionSolutionType.CUSTOM_RUNBOOK, + response.recoveryResourceQualifications() + .get(0) + .recoveryResource() + .properties() + .selectedProtectionSolutionType()); + Assertions.assertEquals("doewbidyvt", + response.recoveryResourceQualifications().get(0).recoveryResource().properties().recoveryGroupId()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, + response.recoveryResourceQualifications() + .get(0) + .recoveryResource() + .properties() + .associatedIdentity() + .type()); + Assertions.assertEquals(QualificationState.UNKNOWN, + response.recoveryResourceQualifications().get(0).operationQualificationDetails().qualificationState()); + Assertions.assertEquals("xepmrut", + response.recoveryResourceQualifications() + .get(0) + .operationQualificationDetails() + .notQualifiedReasons() + .get(0)); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForTestFailoverMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForTestFailoverMockTests.java new file mode 100644 index 000000000000..4f79681c92ca --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanActionsValidateForTestFailoverMockTests.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.ExecutionConfigurations; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverDirectionTypes; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequest; +import com.azure.resourcemanager.resiliencemanagement.models.FailoverRequestProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.QualificationState; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceInclusionState; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceProtectionSolutionType; +import com.azure.resourcemanager.resiliencemanagement.models.UserConsent; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForRecoveryOperationBaseResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class RecoveryPlanActionsValidateForTestFailoverMockTests { + @Test + public void testValidateForTestFailover() throws Exception { + String responseStr + = "{\"recoveryResourceQualifications\":[{\"recoveryResource\":{\"properties\":{\"recoveryResourceUniqueId\":\"ujr\",\"provisioningState\":\"Updating\",\"resourceId\":\"juid\",\"resourceLocation\":\"uuyjucejikz\",\"resourcePhysicalZones\":[\"vvtzejetjkl\",\"tikyj\",\"zkdbqzolx\",\"zvhqjwtrhtgvg\"],\"inclusionState\":\"Included\",\"needsAttention\":false,\"attentionReasons\":[\"lawjmjsmwrok\",\"dxfzzzwyjaf\",\"tlhguynuchl\",\"mltx\"],\"protectionStatus\":\"Unknown\",\"resourceProtectionSolutions\":[{\"isAutoFailover\":false},{\"isAutoFailover\":false}],\"selectedProtectionSolutionType\":\"CrossZoneVMRecovery\",\"selectedProtectionSolutionSetting\":{\"protectionSolutionType\":\"ResourceBaseProtectionSolutionSetting\"},\"recoveryGroupId\":\"ln\",\"associatedIdentity\":{\"type\":\"None\"},\"errorDetails\":{}},\"id\":\"fpafolpymwamxq\",\"name\":\"rag\",\"type\":\"gdphtvdula\"},\"operationQualificationDetails\":{\"qualificationState\":\"Unknown\",\"notQualifiedReasons\":[\"jchcsrlzknmzla\",\"rupdwvnphcnzq\",\"pjhmqrhvthl\"]}},{\"recoveryResource\":{\"properties\":{\"recoveryResourceUniqueId\":\"wdcxsmlzzhz\",\"provisioningState\":\"Failed\",\"resourceId\":\"tlgy\",\"resourceLocation\":\"hqvlnnpxybafiqg\",\"resourcePhysicalZones\":[\"rbgjekglkl\",\"yulidwcwvm\",\"eg\"],\"inclusionState\":\"Excluded\",\"needsAttention\":false,\"attentionReasons\":[\"rwgdnqzbrfks\",\"zhzmtksjci\",\"digsxcdgl\"],\"protectionStatus\":\"Protected\",\"resourceProtectionSolutions\":[{\"isAutoFailover\":false},{\"isAutoFailover\":false},{\"isAutoFailover\":true}],\"selectedProtectionSolutionType\":\"CustomRunbook\",\"selectedProtectionSolutionSetting\":{\"protectionSolutionType\":\"ResourceBaseProtectionSolutionSetting\"},\"recoveryGroupId\":\"flrytswfpfm\",\"associatedIdentity\":{\"type\":\"SystemAssigned\"},\"errorDetails\":{}},\"id\":\"nmskwhqj\",\"name\":\"yslu\",\"type\":\"lpshhkvpedwqslsr\"},\"operationQualificationDetails\":{\"qualificationState\":\"Qualified\",\"notQualifiedReasons\":[\"vwwskondcbr\",\"imuvqejosovyrrl\"]}},{\"recoveryResource\":{\"properties\":{\"recoveryResourceUniqueId\":\"esi\",\"provisioningState\":\"Provisioning\",\"resourceId\":\"ljqobbpihehcecyb\",\"resourceLocation\":\"qbr\",\"resourcePhysicalZones\":[\"mpxdlvy\",\"frexcrseqw\",\"ksghudgzhxogjgg\",\"voujkxibdafhrk\"],\"inclusionState\":\"Excluded\",\"needsAttention\":true,\"attentionReasons\":[\"fbvfbhdy\",\"rhpw\"],\"protectionStatus\":\"Unknown\",\"resourceProtectionSolutions\":[{\"isAutoFailover\":false},{\"isAutoFailover\":false},{\"isAutoFailover\":false},{\"isAutoFailover\":false}],\"selectedProtectionSolutionType\":\"CustomRunbook\",\"selectedProtectionSolutionSetting\":{\"protectionSolutionType\":\"ResourceBaseProtectionSolutionSetting\"},\"recoveryGroupId\":\"kkum\",\"associatedIdentity\":{\"type\":\"SystemAssigned,UserAssigned\"},\"errorDetails\":{}},\"id\":\"jcazt\",\"name\":\"wsnsqowx\",\"type\":\"comlikytwvczc\"},\"operationQualificationDetails\":{\"qualificationState\":\"Unknown\",\"notQualifiedReasons\":[\"cvejyfdvlvhbwrn\"]}}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ValidateForRecoveryOperationBaseResponse response = manager.recoveryPlanActions() + .validateForTestFailover("aelcat", "cjuhplrvkm", "cwmjvlg", new FailoverRequest() + .withFailoverDirection(FailoverDirectionTypes.FROM_SPECIFIC_LOCATIONS) + .withFailoverRequestProperties(new FailoverRequestProperties() + .withSourceLocations(Arrays.asList("vkyylizrzbjpsf", "sfuztlvtmv", "gbwidqlvh")) + .withSelectedResourceIds(Arrays.asList("veo", "i", "rvjfnmjmvlw", "z")) + .withExecutionConfigurations(new ExecutionConfigurations().withUserConsent(UserConsent.ALLOWED))), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ujr", + response.recoveryResourceQualifications() + .get(0) + .recoveryResource() + .properties() + .recoveryResourceUniqueId()); + Assertions.assertEquals(ResourceInclusionState.INCLUDED, + response.recoveryResourceQualifications().get(0).recoveryResource().properties().inclusionState()); + Assertions.assertEquals(ResourceProtectionSolutionType.CROSS_ZONE_VMRECOVERY, + response.recoveryResourceQualifications() + .get(0) + .recoveryResource() + .properties() + .selectedProtectionSolutionType()); + Assertions.assertEquals("ln", + response.recoveryResourceQualifications().get(0).recoveryResource().properties().recoveryGroupId()); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, + response.recoveryResourceQualifications() + .get(0) + .recoveryResource() + .properties() + .associatedIdentity() + .type()); + Assertions.assertEquals(QualificationState.UNKNOWN, + response.recoveryResourceQualifications().get(0).operationQualificationDetails().qualificationState()); + Assertions.assertEquals("jchcsrlzknmzla", + response.recoveryResourceQualifications() + .get(0) + .operationQualificationDetails() + .notQualifiedReasons() + .get(0)); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanPropertiesOfDrillTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanPropertiesOfDrillTests.java new file mode 100644 index 000000000000..2a8fbae1d595 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/RecoveryPlanPropertiesOfDrillTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.AssociatedIdentity; +import com.azure.resourcemanager.resiliencemanagement.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryPlanPropertiesOfDrill; +import org.junit.jupiter.api.Assertions; + +public final class RecoveryPlanPropertiesOfDrillTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecoveryPlanPropertiesOfDrill model = BinaryData.fromString( + "{\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"ond\"},\"recoveryPlanId\":\"luudfdlwggytsb\",\"recoveryPlanResourceExcludedCount\":1284513946}") + .toObject(RecoveryPlanPropertiesOfDrill.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); + Assertions.assertEquals("ond", model.identity().userAssignedIdentity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RecoveryPlanPropertiesOfDrill model = new RecoveryPlanPropertiesOfDrill() + .withIdentity(new AssociatedIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentity("ond")); + model = BinaryData.fromObject(model).toObject(RecoveryPlanPropertiesOfDrill.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); + Assertions.assertEquals("ond", model.identity().userAssignedIdentity()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ReprotectRequestPropertiesTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ReprotectRequestPropertiesTests.java new file mode 100644 index 000000000000..c7252eb9eaa6 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ReprotectRequestPropertiesTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.ReprotectRequestProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ReprotectRequestPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ReprotectRequestProperties model = BinaryData.fromString("{\"selectedResourceIds\":[\"fxrxxle\",\"tramxjez\"]}") + .toObject(ReprotectRequestProperties.class); + Assertions.assertEquals("fxrxxle", model.selectedResourceIds().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ReprotectRequestProperties model + = new ReprotectRequestProperties().withSelectedResourceIds(Arrays.asList("fxrxxle", "tramxjez")); + model = BinaryData.fromObject(model).toObject(ReprotectRequestProperties.class); + Assertions.assertEquals("fxrxxle", model.selectedResourceIds().get(0)); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ReprotectRequestTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ReprotectRequestTests.java new file mode 100644 index 000000000000..6243441d5b3b --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ReprotectRequestTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.ReprotectRequest; +import com.azure.resourcemanager.resiliencemanagement.models.ReprotectRequestProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ReprotectRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ReprotectRequest model + = BinaryData.fromString("{\"reprotectRequestProperties\":{\"selectedResourceIds\":[\"zfgs\"]}}") + .toObject(ReprotectRequest.class); + Assertions.assertEquals("zfgs", model.reprotectRequestProperties().selectedResourceIds().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ReprotectRequest model = new ReprotectRequest().withReprotectRequestProperties( + new ReprotectRequestProperties().withSelectedResourceIds(Arrays.asList("zfgs"))); + model = BinaryData.fromObject(model).toObject(ReprotectRequest.class); + Assertions.assertEquals("zfgs", model.reprotectRequestProperties().selectedResourceIds().get(0)); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceBaseProtectionSolutionSettingTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceBaseProtectionSolutionSettingTests.java new file mode 100644 index 000000000000..7b6d352b7565 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceBaseProtectionSolutionSettingTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceBaseProtectionSolutionSetting; + +public final class ResourceBaseProtectionSolutionSettingTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceBaseProtectionSolutionSetting model + = BinaryData.fromString("{\"protectionSolutionType\":\"ResourceBaseProtectionSolutionSetting\"}") + .toObject(ResourceBaseProtectionSolutionSetting.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceBaseProtectionSolutionSetting model = new ResourceBaseProtectionSolutionSetting(); + model = BinaryData.fromObject(model).toObject(ResourceBaseProtectionSolutionSetting.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceCustomProtectionActionTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceCustomProtectionActionTests.java new file mode 100644 index 000000000000..e3d05f415789 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceCustomProtectionActionTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceCustomProtectionAction; +import org.junit.jupiter.api.Assertions; + +public final class ResourceCustomProtectionActionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceCustomProtectionAction model = BinaryData.fromString("{\"resourceId\":\"lkzgxhuriplbp\"}") + .toObject(ResourceCustomProtectionAction.class); + Assertions.assertEquals("lkzgxhuriplbp", model.resourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceCustomProtectionAction model = new ResourceCustomProtectionAction().withResourceId("lkzgxhuriplbp"); + model = BinaryData.fromObject(model).toObject(ResourceCustomProtectionAction.class); + Assertions.assertEquals("lkzgxhuriplbp", model.resourceId()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceCustomProtectionSettingTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceCustomProtectionSettingTests.java new file mode 100644 index 000000000000..c1e922b021c6 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceCustomProtectionSettingTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceCustomProtectionAction; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceCustomProtectionSetting; +import org.junit.jupiter.api.Assertions; + +public final class ResourceCustomProtectionSettingTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceCustomProtectionSetting model = BinaryData.fromString( + "{\"protectionSolutionType\":\"CustomRunbook\",\"failoverAction\":{\"resourceId\":\"kqze\"},\"failoverCommitAction\":{\"resourceId\":\"kdltfzxmhhvhg\"},\"testFailoverAction\":{\"resourceId\":\"eodkwobda\"},\"testFailoverCleanupAction\":{\"resourceId\":\"tibqdxbxwakb\"},\"reprotectAction\":{\"resourceId\":\"qxn\"}}") + .toObject(ResourceCustomProtectionSetting.class); + Assertions.assertEquals("kqze", model.failoverAction().resourceId()); + Assertions.assertEquals("kdltfzxmhhvhg", model.failoverCommitAction().resourceId()); + Assertions.assertEquals("eodkwobda", model.testFailoverAction().resourceId()); + Assertions.assertEquals("tibqdxbxwakb", model.testFailoverCleanupAction().resourceId()); + Assertions.assertEquals("qxn", model.reprotectAction().resourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceCustomProtectionSetting model = new ResourceCustomProtectionSetting() + .withFailoverAction(new ResourceCustomProtectionAction().withResourceId("kqze")) + .withFailoverCommitAction(new ResourceCustomProtectionAction().withResourceId("kdltfzxmhhvhg")) + .withTestFailoverAction(new ResourceCustomProtectionAction().withResourceId("eodkwobda")) + .withTestFailoverCleanupAction(new ResourceCustomProtectionAction().withResourceId("tibqdxbxwakb")) + .withReprotectAction(new ResourceCustomProtectionAction().withResourceId("qxn")); + model = BinaryData.fromObject(model).toObject(ResourceCustomProtectionSetting.class); + Assertions.assertEquals("kqze", model.failoverAction().resourceId()); + Assertions.assertEquals("kdltfzxmhhvhg", model.failoverCommitAction().resourceId()); + Assertions.assertEquals("eodkwobda", model.testFailoverAction().resourceId()); + Assertions.assertEquals("tibqdxbxwakb", model.testFailoverCleanupAction().resourceId()); + Assertions.assertEquals("qxn", model.reprotectAction().resourceId()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceListsTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceListsTests.java new file mode 100644 index 000000000000..03cce7fc5fbd --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceListsTests.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.CustomFaultDetails; +import com.azure.resourcemanager.resiliencemanagement.models.FaultDetails; +import com.azure.resourcemanager.resiliencemanagement.models.FaultProperties; +import com.azure.resourcemanager.resiliencemanagement.models.IncludeOrUpdateResource; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceLists; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ResourceListsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceLists model = BinaryData.fromString( + "{\"includeResources\":[{\"id\":\"mflvest\",\"faultProperties\":{\"availableFaults\":[{\"faultUrn\":\"rriloz\",\"faultName\":\"peewchpxlkt\",\"targetResourceId\":\"kuziycsle\"},{\"faultUrn\":\"ufuztcktyhjtq\",\"faultName\":\"dcgzul\",\"targetResourceId\":\"mmrqz\"},{\"faultUrn\":\"rr\",\"faultName\":\"vpglydz\",\"targetResourceId\":\"krvq\"}],\"defaultFault\":{\"faultUrn\":\"vtoepryutnw\",\"faultName\":\"tpzdmovzvfvaawzq\",\"targetResourceId\":\"dflgzuri\"},\"overriddenDefaultFault\":{\"faultUrn\":\"aecxndtic\",\"faultName\":\"kpvzmlq\",\"targetResourceId\":\"mldgxobfirc\"},\"customFault\":{\"faultName\":\"pkc\",\"scriptResourceId\":\"ayzri\"}}},{\"id\":\"khyawfvjlboxqv\",\"faultProperties\":{\"availableFaults\":[{\"faultUrn\":\"xhom\",\"faultName\":\"ynhdwdigum\",\"targetResourceId\":\"nraauzz\"}],\"defaultFault\":{\"faultUrn\":\"jazysdzhezwwvaiq\",\"faultName\":\"uvvfonkp\",\"targetResourceId\":\"hqyikvy\"},\"overriddenDefaultFault\":{\"faultUrn\":\"uyav\",\"faultName\":\"uwmncs\",\"targetResourceId\":\"tijfybvp\"},\"customFault\":{\"faultName\":\"krsgsgb\",\"scriptResourceId\":\"huzqgn\"}}}],\"excludeResources\":[\"kynscliqhzv\",\"xnkomtkubo\",\"ppnvdxz\"],\"updateResources\":[{\"id\":\"hfrbbc\",\"faultProperties\":{\"availableFaults\":[{\"faultUrn\":\"gtltdhlf\",\"faultName\":\"qojpy\",\"targetResourceId\":\"vgtrdcnifmzzs\"},{\"faultUrn\":\"ymbrnysuxmpraf\",\"faultName\":\"g\",\"targetResourceId\":\"khocxvdfffwaf\"},{\"faultUrn\":\"roud\",\"faultName\":\"spave\",\"targetResourceId\":\"hrv\"},{\"faultUrn\":\"bunzozudh\",\"faultName\":\"xg\",\"targetResourceId\":\"moy\"}],\"defaultFault\":{\"faultUrn\":\"dyuib\",\"faultName\":\"mfdn\",\"targetResourceId\":\"zydvfvf\"},\"overriddenDefaultFault\":{\"faultUrn\":\"naeo\",\"faultName\":\"srvhmgorffuki\",\"targetResourceId\":\"cvwmzhwplefa\"},\"customFault\":{\"faultName\":\"xilcbtgnhnzey\",\"scriptResourceId\":\"xtjjfzqlqhycav\"}}},{\"id\":\"dggxdbeesmi\",\"faultProperties\":{\"availableFaults\":[{\"faultUrn\":\"ra\",\"faultName\":\"iaa\",\"targetResourceId\":\"iuagydwqfbylyrfg\"},{\"faultUrn\":\"agt\",\"faultName\":\"ojocqwogf\",\"targetResourceId\":\"zjvusfzldmo\"},{\"faultUrn\":\"uxylfsbtkadpy\",\"faultName\":\"own\",\"targetResourceId\":\"tgkbugrjqctojc\"}],\"defaultFault\":{\"faultUrn\":\"sofieypefojyqd\",\"faultName\":\"cuplcplcwkhih\",\"targetResourceId\":\"hlhzdsqtzbsrgno\"},\"overriddenDefaultFault\":{\"faultUrn\":\"jhf\",\"faultName\":\"mvec\",\"targetResourceId\":\"ctxmwoteyowcluq\"},\"customFault\":{\"faultName\":\"ekqvgqouwif\",\"scriptResourceId\":\"mpjw\"}}},{\"id\":\"ivqikfxcvhr\",\"faultProperties\":{\"availableFaults\":[{\"faultUrn\":\"uagrttikteusqc\",\"faultName\":\"kvyklxubyjaffmm\",\"targetResourceId\":\"bl\"},{\"faultUrn\":\"qcuubgqibrta\",\"faultName\":\"metttwgd\",\"targetResourceId\":\"lqxihhrmooiz\"},{\"faultUrn\":\"seypxiutcxapz\",\"faultName\":\"y\",\"targetResourceId\":\"petogebjox\"},{\"faultUrn\":\"lhvnhlab\",\"faultName\":\"q\",\"targetResourceId\":\"kkzjcjbtrga\"}],\"defaultFault\":{\"faultUrn\":\"vvib\",\"faultName\":\"xjjs\",\"targetResourceId\":\"oqbeitpkxzt\"},\"overriddenDefaultFault\":{\"faultUrn\":\"ob\",\"faultName\":\"lftidgfcwqmpim\",\"targetResourceId\":\"qxzhem\"},\"customFault\":{\"faultName\":\"h\",\"scriptResourceId\":\"hujswtwkozzwcul\"}}}]}") + .toObject(ResourceLists.class); + Assertions.assertEquals("mflvest", model.includeResources().get(0).id()); + Assertions.assertEquals("aecxndtic", + model.includeResources().get(0).faultProperties().overriddenDefaultFault().faultUrn()); + Assertions.assertEquals("kpvzmlq", + model.includeResources().get(0).faultProperties().overriddenDefaultFault().faultName()); + Assertions.assertEquals("mldgxobfirc", + model.includeResources().get(0).faultProperties().overriddenDefaultFault().targetResourceId()); + Assertions.assertEquals("pkc", model.includeResources().get(0).faultProperties().customFault().faultName()); + Assertions.assertEquals("ayzri", + model.includeResources().get(0).faultProperties().customFault().scriptResourceId()); + Assertions.assertEquals("kynscliqhzv", model.excludeResources().get(0)); + Assertions.assertEquals("hfrbbc", model.updateResources().get(0).id()); + Assertions.assertEquals("naeo", + model.updateResources().get(0).faultProperties().overriddenDefaultFault().faultUrn()); + Assertions.assertEquals("srvhmgorffuki", + model.updateResources().get(0).faultProperties().overriddenDefaultFault().faultName()); + Assertions.assertEquals("cvwmzhwplefa", + model.updateResources().get(0).faultProperties().overriddenDefaultFault().targetResourceId()); + Assertions.assertEquals("xilcbtgnhnzey", + model.updateResources().get(0).faultProperties().customFault().faultName()); + Assertions.assertEquals("xtjjfzqlqhycav", + model.updateResources().get(0).faultProperties().customFault().scriptResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceLists model = new ResourceLists() + .withIncludeResources(Arrays.asList( + new IncludeOrUpdateResource().withId("mflvest") + .withFaultProperties(new FaultProperties() + .withOverriddenDefaultFault(new FaultDetails().withFaultUrn("aecxndtic") + .withFaultName("kpvzmlq") + .withTargetResourceId("mldgxobfirc")) + .withCustomFault(new CustomFaultDetails().withFaultName("pkc").withScriptResourceId("ayzri"))), + new IncludeOrUpdateResource().withId("khyawfvjlboxqv") + .withFaultProperties(new FaultProperties() + .withOverriddenDefaultFault(new FaultDetails().withFaultUrn("uyav") + .withFaultName("uwmncs") + .withTargetResourceId("tijfybvp")) + .withCustomFault( + new CustomFaultDetails().withFaultName("krsgsgb").withScriptResourceId("huzqgn"))))) + .withExcludeResources(Arrays.asList("kynscliqhzv", "xnkomtkubo", "ppnvdxz")) + .withUpdateResources(Arrays.asList( + new IncludeOrUpdateResource().withId("hfrbbc") + .withFaultProperties(new FaultProperties() + .withOverriddenDefaultFault(new FaultDetails().withFaultUrn("naeo") + .withFaultName("srvhmgorffuki") + .withTargetResourceId("cvwmzhwplefa")) + .withCustomFault(new CustomFaultDetails().withFaultName("xilcbtgnhnzey") + .withScriptResourceId("xtjjfzqlqhycav"))), + new IncludeOrUpdateResource().withId("dggxdbeesmi") + .withFaultProperties(new FaultProperties() + .withOverriddenDefaultFault(new FaultDetails().withFaultUrn("jhf") + .withFaultName("mvec") + .withTargetResourceId("ctxmwoteyowcluq")) + .withCustomFault( + new CustomFaultDetails().withFaultName("ekqvgqouwif").withScriptResourceId("mpjw"))), + new IncludeOrUpdateResource().withId("ivqikfxcvhr") + .withFaultProperties(new FaultProperties() + .withOverriddenDefaultFault(new FaultDetails().withFaultUrn("ob") + .withFaultName("lftidgfcwqmpim") + .withTargetResourceId("qxzhem")) + .withCustomFault( + new CustomFaultDetails().withFaultName("h").withScriptResourceId("hujswtwkozzwcul"))))); + model = BinaryData.fromObject(model).toObject(ResourceLists.class); + Assertions.assertEquals("mflvest", model.includeResources().get(0).id()); + Assertions.assertEquals("aecxndtic", + model.includeResources().get(0).faultProperties().overriddenDefaultFault().faultUrn()); + Assertions.assertEquals("kpvzmlq", + model.includeResources().get(0).faultProperties().overriddenDefaultFault().faultName()); + Assertions.assertEquals("mldgxobfirc", + model.includeResources().get(0).faultProperties().overriddenDefaultFault().targetResourceId()); + Assertions.assertEquals("pkc", model.includeResources().get(0).faultProperties().customFault().faultName()); + Assertions.assertEquals("ayzri", + model.includeResources().get(0).faultProperties().customFault().scriptResourceId()); + Assertions.assertEquals("kynscliqhzv", model.excludeResources().get(0)); + Assertions.assertEquals("hfrbbc", model.updateResources().get(0).id()); + Assertions.assertEquals("naeo", + model.updateResources().get(0).faultProperties().overriddenDefaultFault().faultUrn()); + Assertions.assertEquals("srvhmgorffuki", + model.updateResources().get(0).faultProperties().overriddenDefaultFault().faultName()); + Assertions.assertEquals("cvwmzhwplefa", + model.updateResources().get(0).faultProperties().overriddenDefaultFault().targetResourceId()); + Assertions.assertEquals("xilcbtgnhnzey", + model.updateResources().get(0).faultProperties().customFault().faultName()); + Assertions.assertEquals("xtjjfzqlqhycav", + model.updateResources().get(0).faultProperties().customFault().scriptResourceId()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceNativeProtectionSolutionSettingTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceNativeProtectionSolutionSettingTests.java new file mode 100644 index 000000000000..a28e5e19678d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceNativeProtectionSolutionSettingTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceNativeProtectionSolutionSetting; + +public final class ResourceNativeProtectionSolutionSettingTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceNativeProtectionSolutionSetting model + = BinaryData.fromString("{\"protectionSolutionType\":\"AzureNative\"}") + .toObject(ResourceNativeProtectionSolutionSetting.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceNativeProtectionSolutionSetting model = new ResourceNativeProtectionSolutionSetting(); + model = BinaryData.fromObject(model).toObject(ResourceNativeProtectionSolutionSetting.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceProtectionSolutionSettingsTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceProtectionSolutionSettingsTests.java new file mode 100644 index 000000000000..9194ae2f672c --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceProtectionSolutionSettingsTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceProtectionSolutionSettings; + +public final class ResourceProtectionSolutionSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceProtectionSolutionSettings model = BinaryData.fromString( + "{\"protectionSolutionType\":\"CrossZoneVMRecovery\",\"protectionStatus\":\"Unknown\",\"resourceId\":\"ud\",\"activeLocation\":\"dvxzbncblylpst\",\"activeLocations\":[\"hxsrzdzucersc\"],\"activePhysicalZones\":[\"nevf\"],\"recoveryLocations\":[\"mygtdssls\",\"tmweriofzpyq\",\"emwabnet\",\"hhszh\"],\"replicationRole\":\"Replica\",\"primaryResource\":\"vwiwubmwmbesld\",\"replicaResources\":[\"wtppjflcxogaoko\",\"z\"],\"isAutoFailover\":true,\"failoverState\":\"FailedOverCommitPending\",\"testFailoverState\":\"None\"}") + .toObject(ResourceProtectionSolutionSettings.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceSiteRecoveryProtectionSettingTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceSiteRecoveryProtectionSettingTests.java new file mode 100644 index 000000000000..a46ee9406dc3 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceSiteRecoveryProtectionSettingTests.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.DiskReprotectInputDetails; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceSiteRecoveryProtectionSetting; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceSiteRecoveryReprotectParams; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceSiteRecoveryTestFailoverCleanupParams; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceSiteRecoveryTestFailoverParams; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ResourceSiteRecoveryProtectionSettingTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceSiteRecoveryProtectionSetting model = BinaryData.fromString( + "{\"protectionSolutionType\":\"AzureSiteRecovery\",\"testFailoverParams\":{\"networkResourceId\":\"unkbebx\"},\"testFailoverCleanupParams\":{\"comments\":\"yyntwl\"},\"reprotectParams\":{\"diskReprotectInputDetails\":[{\"diskResourceId\":\"oievseotgqrlltm\",\"stagingStorageAccountResourceId\":\"lauwzizxbmpgcjef\"},{\"diskResourceId\":\"muvp\",\"stagingStorageAccountResourceId\":\"tdum\"},{\"diskResourceId\":\"p\",\"stagingStorageAccountResourceId\":\"ebmnzbtbhjpglk\"}]}}") + .toObject(ResourceSiteRecoveryProtectionSetting.class); + Assertions.assertEquals("unkbebx", model.testFailoverParams().networkResourceId()); + Assertions.assertEquals("yyntwl", model.testFailoverCleanupParams().comments()); + Assertions.assertEquals("oievseotgqrlltm", + model.reprotectParams().diskReprotectInputDetails().get(0).diskResourceId()); + Assertions.assertEquals("lauwzizxbmpgcjef", + model.reprotectParams().diskReprotectInputDetails().get(0).stagingStorageAccountResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceSiteRecoveryProtectionSetting model = new ResourceSiteRecoveryProtectionSetting() + .withTestFailoverParams(new ResourceSiteRecoveryTestFailoverParams().withNetworkResourceId("unkbebx")) + .withTestFailoverCleanupParams(new ResourceSiteRecoveryTestFailoverCleanupParams().withComments("yyntwl")) + .withReprotectParams(new ResourceSiteRecoveryReprotectParams().withDiskReprotectInputDetails(Arrays.asList( + new DiskReprotectInputDetails().withDiskResourceId("oievseotgqrlltm") + .withStagingStorageAccountResourceId("lauwzizxbmpgcjef"), + new DiskReprotectInputDetails().withDiskResourceId("muvp").withStagingStorageAccountResourceId("tdum"), + new DiskReprotectInputDetails().withDiskResourceId("p") + .withStagingStorageAccountResourceId("ebmnzbtbhjpglk")))); + model = BinaryData.fromObject(model).toObject(ResourceSiteRecoveryProtectionSetting.class); + Assertions.assertEquals("unkbebx", model.testFailoverParams().networkResourceId()); + Assertions.assertEquals("yyntwl", model.testFailoverCleanupParams().comments()); + Assertions.assertEquals("oievseotgqrlltm", + model.reprotectParams().diskReprotectInputDetails().get(0).diskResourceId()); + Assertions.assertEquals("lauwzizxbmpgcjef", + model.reprotectParams().diskReprotectInputDetails().get(0).stagingStorageAccountResourceId()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceSiteRecoveryReprotectParamsTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceSiteRecoveryReprotectParamsTests.java new file mode 100644 index 000000000000..a3ca8eefcfea --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceSiteRecoveryReprotectParamsTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.DiskReprotectInputDetails; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceSiteRecoveryReprotectParams; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ResourceSiteRecoveryReprotectParamsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceSiteRecoveryReprotectParams model = BinaryData.fromString( + "{\"diskReprotectInputDetails\":[{\"diskResourceId\":\"zfikd\",\"stagingStorageAccountResourceId\":\"wq\"}]}") + .toObject(ResourceSiteRecoveryReprotectParams.class); + Assertions.assertEquals("zfikd", model.diskReprotectInputDetails().get(0).diskResourceId()); + Assertions.assertEquals("wq", model.diskReprotectInputDetails().get(0).stagingStorageAccountResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceSiteRecoveryReprotectParams model + = new ResourceSiteRecoveryReprotectParams().withDiskReprotectInputDetails(Arrays.asList( + new DiskReprotectInputDetails().withDiskResourceId("zfikd").withStagingStorageAccountResourceId("wq"))); + model = BinaryData.fromObject(model).toObject(ResourceSiteRecoveryReprotectParams.class); + Assertions.assertEquals("zfikd", model.diskReprotectInputDetails().get(0).diskResourceId()); + Assertions.assertEquals("wq", model.diskReprotectInputDetails().get(0).stagingStorageAccountResourceId()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceSiteRecoveryTestFailoverCleanupParamsTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceSiteRecoveryTestFailoverCleanupParamsTests.java new file mode 100644 index 000000000000..35cca3b25659 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceSiteRecoveryTestFailoverCleanupParamsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceSiteRecoveryTestFailoverCleanupParams; +import org.junit.jupiter.api.Assertions; + +public final class ResourceSiteRecoveryTestFailoverCleanupParamsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceSiteRecoveryTestFailoverCleanupParams model = BinaryData.fromString("{\"comments\":\"hsd\"}") + .toObject(ResourceSiteRecoveryTestFailoverCleanupParams.class); + Assertions.assertEquals("hsd", model.comments()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceSiteRecoveryTestFailoverCleanupParams model + = new ResourceSiteRecoveryTestFailoverCleanupParams().withComments("hsd"); + model = BinaryData.fromObject(model).toObject(ResourceSiteRecoveryTestFailoverCleanupParams.class); + Assertions.assertEquals("hsd", model.comments()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceSiteRecoveryTestFailoverParamsTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceSiteRecoveryTestFailoverParamsTests.java new file mode 100644 index 000000000000..dfeb1d0e2393 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ResourceSiteRecoveryTestFailoverParamsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.ResourceSiteRecoveryTestFailoverParams; +import org.junit.jupiter.api.Assertions; + +public final class ResourceSiteRecoveryTestFailoverParamsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceSiteRecoveryTestFailoverParams model = BinaryData.fromString("{\"networkResourceId\":\"ohdneuel\"}") + .toObject(ResourceSiteRecoveryTestFailoverParams.class); + Assertions.assertEquals("ohdneuel", model.networkResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceSiteRecoveryTestFailoverParams model + = new ResourceSiteRecoveryTestFailoverParams().withNetworkResourceId("ohdneuel"); + model = BinaryData.fromObject(model).toObject(ResourceSiteRecoveryTestFailoverParams.class); + Assertions.assertEquals("ohdneuel", model.networkResourceId()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ServiceGroupMembershipTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ServiceGroupMembershipTests.java new file mode 100644 index 000000000000..453d95b482e3 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ServiceGroupMembershipTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.MembershipType; +import com.azure.resourcemanager.resiliencemanagement.models.ServiceGroupMembership; +import org.junit.jupiter.api.Assertions; + +public final class ServiceGroupMembershipTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ServiceGroupMembership model + = BinaryData.fromString("{\"serviceGroupId\":\"ypl\",\"membershipType\":\"Direct\"}") + .toObject(ServiceGroupMembership.class); + Assertions.assertEquals("ypl", model.serviceGroupId()); + Assertions.assertEquals(MembershipType.DIRECT, model.membershipType()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ServiceLevelResourceTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ServiceLevelResourceTests.java new file mode 100644 index 000000000000..59a0cd892552 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ServiceLevelResourceTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.ServiceLevelResource; +import org.junit.jupiter.api.Assertions; + +public final class ServiceLevelResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ServiceLevelResource model = BinaryData.fromString( + "{\"serviceLevelIndicatorResourceId\":\"vdphlxaolthqtr\",\"serviceLevelObjectiveResourceId\":\"qjbpfzfsin\"}") + .toObject(ServiceLevelResource.class); + Assertions.assertEquals("vdphlxaolthqtr", model.serviceLevelIndicatorResourceId()); + Assertions.assertEquals("qjbpfzfsin", model.serviceLevelObjectiveResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ServiceLevelResource model = new ServiceLevelResource().withServiceLevelIndicatorResourceId("vdphlxaolthqtr") + .withServiceLevelObjectiveResourceId("qjbpfzfsin"); + model = BinaryData.fromObject(model).toObject(ServiceLevelResource.class); + Assertions.assertEquals("vdphlxaolthqtr", model.serviceLevelIndicatorResourceId()); + Assertions.assertEquals("qjbpfzfsin", model.serviceLevelObjectiveResourceId()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/SupportedVerbsForStageTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/SupportedVerbsForStageTests.java new file mode 100644 index 000000000000..6171d9f6c342 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/SupportedVerbsForStageTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunOperationVerbs; +import com.azure.resourcemanager.resiliencemanagement.models.DrillRunSubtasks; +import com.azure.resourcemanager.resiliencemanagement.models.SupportedVerbsForStage; +import org.junit.jupiter.api.Assertions; + +public final class SupportedVerbsForStageTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SupportedVerbsForStage model + = BinaryData.fromString("{\"drillRunStage\":\"ReprotectReverse\",\"supportedVerbs\":[\"Start\",\"Start\"]}") + .toObject(SupportedVerbsForStage.class); + Assertions.assertEquals(DrillRunSubtasks.REPROTECT_REVERSE, model.drillRunStage()); + Assertions.assertEquals(DrillRunOperationVerbs.START, model.supportedVerbs().get(0)); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/SystemMetadataTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/SystemMetadataTests.java new file mode 100644 index 000000000000..a8a4a21ef685 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/SystemMetadataTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.InitialConfig; +import com.azure.resourcemanager.resiliencemanagement.models.SystemMetadata; +import org.junit.jupiter.api.Assertions; + +public final class SystemMetadataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SystemMetadata model = BinaryData + .fromString("{\"initialConfig\":\"Complete\",\"resourceTypeCategories\":[\"AzureSiteRecoveryVMsPresent\"]}") + .toObject(SystemMetadata.class); + Assertions.assertEquals(InitialConfig.COMPLETE, model.initialConfig()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/TestFailoverCleanupRequestTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/TestFailoverCleanupRequestTests.java new file mode 100644 index 000000000000..b61149f67467 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/TestFailoverCleanupRequestTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.TestFailoverCleanupRequest; +import org.junit.jupiter.api.Assertions; + +public final class TestFailoverCleanupRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TestFailoverCleanupRequest model + = BinaryData.fromString("{\"comments\":\"dooaojkniodko\"}").toObject(TestFailoverCleanupRequest.class); + Assertions.assertEquals("dooaojkniodko", model.comments()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TestFailoverCleanupRequest model = new TestFailoverCleanupRequest().withComments("dooaojkniodko"); + model = BinaryData.fromObject(model).toObject(TestFailoverCleanupRequest.class); + Assertions.assertEquals("dooaojkniodko", model.comments()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemInnerTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemInnerTests.java new file mode 100644 index 000000000000..d11d709c708e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemInnerTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.UnifiedResilienceItemInner; +import com.azure.resourcemanager.resiliencemanagement.models.IsoDuration; +import com.azure.resourcemanager.resiliencemanagement.models.ResilienceHealthStatus; +import com.azure.resourcemanager.resiliencemanagement.models.UnifiedResilienceItemRequirementSelected; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class UnifiedResilienceItemInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UnifiedResilienceItemInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Canceled\",\"goals\":{\"templateId\":\"tzenk\",\"assignmentId\":\"if\",\"regionalRecoveryPointObjectiveInMinutes\":\"PT4H\",\"regionalRecoveryPointEstimatedInMinutes\":\"PT24H\",\"regionalRecoveryPointObjectiveStatus\":\"NotEvaluated\",\"regionalRecoveryTimeObjectiveInMinutes\":\"PT24H\",\"regionalRecoveryTimeActualInMinutes\":\"PT15M\",\"regionalRecoveryTimeObjectiveStatus\":\"Unhealthy\",\"requireHighAvailability\":\"Required\",\"requireDisasterRecovery\":\"NotSelected\"},\"recommendations\":{\"highAvailability\":{\"enabledResourceCount\":8398981277368133209,\"notEnabledResourceCount\":4274066940795001367,\"notEvaluatedResourceCount\":4176254181399781756,\"evaluationDateTime\":\"2021-02-18T14:19:33Z\"}},\"lastModifiedTime\":\"2021-04-19T13:21:36Z\"},\"id\":\"forobwjlv\",\"name\":\"zbfhfovvac\",\"type\":\"pbt\"}") + .toObject(UnifiedResilienceItemInner.class); + Assertions.assertEquals("tzenk", model.properties().goals().templateId()); + Assertions.assertEquals("if", model.properties().goals().assignmentId()); + Assertions.assertEquals(IsoDuration.PT4H, model.properties().goals().regionalRecoveryPointObjectiveInMinutes()); + Assertions.assertEquals(IsoDuration.PT24H, + model.properties().goals().regionalRecoveryPointEstimatedInMinutes()); + Assertions.assertEquals(ResilienceHealthStatus.NOT_EVALUATED, + model.properties().goals().regionalRecoveryPointObjectiveStatus()); + Assertions.assertEquals(IsoDuration.PT24H, model.properties().goals().regionalRecoveryTimeObjectiveInMinutes()); + Assertions.assertEquals(IsoDuration.PT15M, model.properties().goals().regionalRecoveryTimeActualInMinutes()); + Assertions.assertEquals(ResilienceHealthStatus.UNHEALTHY, + model.properties().goals().regionalRecoveryTimeObjectiveStatus()); + Assertions.assertEquals(UnifiedResilienceItemRequirementSelected.REQUIRED, + model.properties().goals().requireHighAvailability()); + Assertions.assertEquals(UnifiedResilienceItemRequirementSelected.NOT_SELECTED, + model.properties().goals().requireDisasterRecovery()); + Assertions.assertEquals(8398981277368133209L, + model.properties().recommendations().highAvailability().enabledResourceCount()); + Assertions.assertEquals(4274066940795001367L, + model.properties().recommendations().highAvailability().notEnabledResourceCount()); + Assertions.assertEquals(4176254181399781756L, + model.properties().recommendations().highAvailability().notEvaluatedResourceCount()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-18T14:19:33Z"), + model.properties().recommendations().highAvailability().evaluationDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-19T13:21:36Z"), model.properties().lastModifiedTime()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemListResultTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemListResultTests.java new file mode 100644 index 000000000000..e9d70e90a354 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemListResultTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.implementation.models.UnifiedResilienceItemListResult; +import com.azure.resourcemanager.resiliencemanagement.models.IsoDuration; +import com.azure.resourcemanager.resiliencemanagement.models.ResilienceHealthStatus; +import com.azure.resourcemanager.resiliencemanagement.models.UnifiedResilienceItemRequirementSelected; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class UnifiedResilienceItemListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UnifiedResilienceItemListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"goals\":{\"templateId\":\"jibnxmysu\",\"assignmentId\":\"swqrntvlwijp\",\"regionalRecoveryPointObjectiveInMinutes\":\"PT4H\",\"regionalRecoveryPointEstimatedInMinutes\":\"PT24H\",\"regionalRecoveryPointObjectiveStatus\":\"Unhealthy\",\"regionalRecoveryTimeObjectiveInMinutes\":\"PT4H\",\"regionalRecoveryTimeActualInMinutes\":\"PT24H\",\"regionalRecoveryTimeObjectiveStatus\":\"NotEvaluated\",\"requireHighAvailability\":\"NotSelected\",\"requireDisasterRecovery\":\"NotSelected\"},\"recommendations\":{\"highAvailability\":{\"enabledResourceCount\":558858532162137863,\"notEnabledResourceCount\":1940530152318069855,\"notEvaluatedResourceCount\":3686288365721871145,\"evaluationDateTime\":\"2021-09-21T10:04:50Z\"}},\"lastModifiedTime\":\"2021-11-18T23:48:24Z\"},\"id\":\"cdqzhlctddu\",\"name\":\"qn\",\"type\":\"yfp\"}],\"nextLink\":\"rqbnjjrc\"}") + .toObject(UnifiedResilienceItemListResult.class); + Assertions.assertEquals("jibnxmysu", model.value().get(0).properties().goals().templateId()); + Assertions.assertEquals("swqrntvlwijp", model.value().get(0).properties().goals().assignmentId()); + Assertions.assertEquals(IsoDuration.PT4H, + model.value().get(0).properties().goals().regionalRecoveryPointObjectiveInMinutes()); + Assertions.assertEquals(IsoDuration.PT24H, + model.value().get(0).properties().goals().regionalRecoveryPointEstimatedInMinutes()); + Assertions.assertEquals(ResilienceHealthStatus.UNHEALTHY, + model.value().get(0).properties().goals().regionalRecoveryPointObjectiveStatus()); + Assertions.assertEquals(IsoDuration.PT4H, + model.value().get(0).properties().goals().regionalRecoveryTimeObjectiveInMinutes()); + Assertions.assertEquals(IsoDuration.PT24H, + model.value().get(0).properties().goals().regionalRecoveryTimeActualInMinutes()); + Assertions.assertEquals(ResilienceHealthStatus.NOT_EVALUATED, + model.value().get(0).properties().goals().regionalRecoveryTimeObjectiveStatus()); + Assertions.assertEquals(UnifiedResilienceItemRequirementSelected.NOT_SELECTED, + model.value().get(0).properties().goals().requireHighAvailability()); + Assertions.assertEquals(UnifiedResilienceItemRequirementSelected.NOT_SELECTED, + model.value().get(0).properties().goals().requireDisasterRecovery()); + Assertions.assertEquals(558858532162137863L, + model.value().get(0).properties().recommendations().highAvailability().enabledResourceCount()); + Assertions.assertEquals(1940530152318069855L, + model.value().get(0).properties().recommendations().highAvailability().notEnabledResourceCount()); + Assertions.assertEquals(3686288365721871145L, + model.value().get(0).properties().recommendations().highAvailability().notEvaluatedResourceCount()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-21T10:04:50Z"), + model.value().get(0).properties().recommendations().highAvailability().evaluationDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-18T23:48:24Z"), + model.value().get(0).properties().lastModifiedTime()); + Assertions.assertEquals("rqbnjjrc", model.nextLink()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemPropertiesTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemPropertiesTests.java new file mode 100644 index 000000000000..ef3a0b2df019 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemPropertiesTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.IsoDuration; +import com.azure.resourcemanager.resiliencemanagement.models.ResilienceHealthStatus; +import com.azure.resourcemanager.resiliencemanagement.models.UnifiedResilienceItemProperties; +import com.azure.resourcemanager.resiliencemanagement.models.UnifiedResilienceItemRequirementSelected; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class UnifiedResilienceItemPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UnifiedResilienceItemProperties model = BinaryData.fromString( + "{\"provisioningState\":\"Deleting\",\"goals\":{\"templateId\":\"xesz\",\"assignmentId\":\"bbelawumuaslzk\",\"regionalRecoveryPointObjectiveInMinutes\":\"PT4H\",\"regionalRecoveryPointEstimatedInMinutes\":\"PT1H\",\"regionalRecoveryPointObjectiveStatus\":\"Unhealthy\",\"regionalRecoveryTimeObjectiveInMinutes\":\"PT4H\",\"regionalRecoveryTimeActualInMinutes\":\"PT1H\",\"regionalRecoveryTimeObjectiveStatus\":\"NotEvaluated\",\"requireHighAvailability\":\"NotSelected\",\"requireDisasterRecovery\":\"NotRequired\"},\"recommendations\":{\"highAvailability\":{\"enabledResourceCount\":2467395859679855860,\"notEnabledResourceCount\":4040051734148684026,\"notEvaluatedResourceCount\":1957768448844019553,\"evaluationDateTime\":\"2021-01-06T20:17:19Z\"}},\"lastModifiedTime\":\"2021-01-31T02:42:07Z\"}") + .toObject(UnifiedResilienceItemProperties.class); + Assertions.assertEquals("xesz", model.goals().templateId()); + Assertions.assertEquals("bbelawumuaslzk", model.goals().assignmentId()); + Assertions.assertEquals(IsoDuration.PT4H, model.goals().regionalRecoveryPointObjectiveInMinutes()); + Assertions.assertEquals(IsoDuration.PT1H, model.goals().regionalRecoveryPointEstimatedInMinutes()); + Assertions.assertEquals(ResilienceHealthStatus.UNHEALTHY, model.goals().regionalRecoveryPointObjectiveStatus()); + Assertions.assertEquals(IsoDuration.PT4H, model.goals().regionalRecoveryTimeObjectiveInMinutes()); + Assertions.assertEquals(IsoDuration.PT1H, model.goals().regionalRecoveryTimeActualInMinutes()); + Assertions.assertEquals(ResilienceHealthStatus.NOT_EVALUATED, + model.goals().regionalRecoveryTimeObjectiveStatus()); + Assertions.assertEquals(UnifiedResilienceItemRequirementSelected.NOT_SELECTED, + model.goals().requireHighAvailability()); + Assertions.assertEquals(UnifiedResilienceItemRequirementSelected.NOT_REQUIRED, + model.goals().requireDisasterRecovery()); + Assertions.assertEquals(2467395859679855860L, + model.recommendations().highAvailability().enabledResourceCount()); + Assertions.assertEquals(4040051734148684026L, + model.recommendations().highAvailability().notEnabledResourceCount()); + Assertions.assertEquals(1957768448844019553L, + model.recommendations().highAvailability().notEvaluatedResourceCount()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-06T20:17:19Z"), + model.recommendations().highAvailability().evaluationDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T02:42:07Z"), model.lastModifiedTime()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemsGetWithResponseMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemsGetWithResponseMockTests.java new file mode 100644 index 000000000000..8c804777b1b7 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemsGetWithResponseMockTests.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.IsoDuration; +import com.azure.resourcemanager.resiliencemanagement.models.ResilienceHealthStatus; +import com.azure.resourcemanager.resiliencemanagement.models.UnifiedResilienceItem; +import com.azure.resourcemanager.resiliencemanagement.models.UnifiedResilienceItemRequirementSelected; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class UnifiedResilienceItemsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Canceled\",\"goals\":{\"templateId\":\"s\",\"assignmentId\":\"oswoqiqazugamx\",\"regionalRecoveryPointObjectiveInMinutes\":\"PT1H\",\"regionalRecoveryPointEstimatedInMinutes\":\"PT24H\",\"regionalRecoveryPointObjectiveStatus\":\"Healthy\",\"regionalRecoveryTimeObjectiveInMinutes\":\"PT4H\",\"regionalRecoveryTimeActualInMinutes\":\"PT1H\",\"regionalRecoveryTimeObjectiveStatus\":\"Unhealthy\",\"requireHighAvailability\":\"NotSelected\",\"requireDisasterRecovery\":\"Required\"},\"recommendations\":{\"highAvailability\":{\"enabledResourceCount\":5630136548807311881,\"notEnabledResourceCount\":27826704330710904,\"notEvaluatedResourceCount\":1281520358620814891,\"evaluationDateTime\":\"2021-01-07T18:31:11Z\"}},\"lastModifiedTime\":\"2021-12-10T23:13:06Z\"},\"id\":\"xyfukzxuizhyhn\",\"name\":\"pkpetiarxqiu\",\"type\":\"xdukecpxd\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + UnifiedResilienceItem response = manager.unifiedResilienceItems() + .getWithResponse("mmwiuawvcmjz", "xiid", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("s", response.properties().goals().templateId()); + Assertions.assertEquals("oswoqiqazugamx", response.properties().goals().assignmentId()); + Assertions.assertEquals(IsoDuration.PT1H, + response.properties().goals().regionalRecoveryPointObjectiveInMinutes()); + Assertions.assertEquals(IsoDuration.PT24H, + response.properties().goals().regionalRecoveryPointEstimatedInMinutes()); + Assertions.assertEquals(ResilienceHealthStatus.HEALTHY, + response.properties().goals().regionalRecoveryPointObjectiveStatus()); + Assertions.assertEquals(IsoDuration.PT4H, + response.properties().goals().regionalRecoveryTimeObjectiveInMinutes()); + Assertions.assertEquals(IsoDuration.PT1H, response.properties().goals().regionalRecoveryTimeActualInMinutes()); + Assertions.assertEquals(ResilienceHealthStatus.UNHEALTHY, + response.properties().goals().regionalRecoveryTimeObjectiveStatus()); + Assertions.assertEquals(UnifiedResilienceItemRequirementSelected.NOT_SELECTED, + response.properties().goals().requireHighAvailability()); + Assertions.assertEquals(UnifiedResilienceItemRequirementSelected.REQUIRED, + response.properties().goals().requireDisasterRecovery()); + Assertions.assertEquals(5630136548807311881L, + response.properties().recommendations().highAvailability().enabledResourceCount()); + Assertions.assertEquals(27826704330710904L, + response.properties().recommendations().highAvailability().notEnabledResourceCount()); + Assertions.assertEquals(1281520358620814891L, + response.properties().recommendations().highAvailability().notEvaluatedResourceCount()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-07T18:31:11Z"), + response.properties().recommendations().highAvailability().evaluationDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-10T23:13:06Z"), response.properties().lastModifiedTime()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemsListMockTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemsListMockTests.java new file mode 100644 index 000000000000..e5c26ced2f6e --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UnifiedResilienceItemsListMockTests.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.resiliencemanagement.ResilienceManagementManager; +import com.azure.resourcemanager.resiliencemanagement.models.IsoDuration; +import com.azure.resourcemanager.resiliencemanagement.models.ResilienceHealthStatus; +import com.azure.resourcemanager.resiliencemanagement.models.UnifiedResilienceItem; +import com.azure.resourcemanager.resiliencemanagement.models.UnifiedResilienceItemRequirementSelected; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class UnifiedResilienceItemsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Provisioning\",\"goals\":{\"templateId\":\"ofkbtf\",\"assignmentId\":\"hklbnldpvcbh\",\"regionalRecoveryPointObjectiveInMinutes\":\"PT15M\",\"regionalRecoveryPointEstimatedInMinutes\":\"PT1H\",\"regionalRecoveryPointObjectiveStatus\":\"Healthy\",\"regionalRecoveryTimeObjectiveInMinutes\":\"PT4H\",\"regionalRecoveryTimeActualInMinutes\":\"PT24H\",\"regionalRecoveryTimeObjectiveStatus\":\"Healthy\",\"requireHighAvailability\":\"NotSelected\",\"requireDisasterRecovery\":\"Required\"},\"recommendations\":{\"highAvailability\":{\"enabledResourceCount\":6604160426977658502,\"notEnabledResourceCount\":8161445288905142925,\"notEvaluatedResourceCount\":5297987659739275685,\"evaluationDateTime\":\"2021-10-20T05:29:41Z\"}},\"lastModifiedTime\":\"2021-03-09T16:13:55Z\"},\"id\":\"jwcolbm\",\"name\":\"lbnwtpcpahp\",\"type\":\"z\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ResilienceManagementManager manager = ResilienceManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.unifiedResilienceItems() + .list("zvdhctmmkosz", "dblnsntrp", 1969698229, com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ofkbtf", response.iterator().next().properties().goals().templateId()); + Assertions.assertEquals("hklbnldpvcbh", response.iterator().next().properties().goals().assignmentId()); + Assertions.assertEquals(IsoDuration.PT15M, + response.iterator().next().properties().goals().regionalRecoveryPointObjectiveInMinutes()); + Assertions.assertEquals(IsoDuration.PT1H, + response.iterator().next().properties().goals().regionalRecoveryPointEstimatedInMinutes()); + Assertions.assertEquals(ResilienceHealthStatus.HEALTHY, + response.iterator().next().properties().goals().regionalRecoveryPointObjectiveStatus()); + Assertions.assertEquals(IsoDuration.PT4H, + response.iterator().next().properties().goals().regionalRecoveryTimeObjectiveInMinutes()); + Assertions.assertEquals(IsoDuration.PT24H, + response.iterator().next().properties().goals().regionalRecoveryTimeActualInMinutes()); + Assertions.assertEquals(ResilienceHealthStatus.HEALTHY, + response.iterator().next().properties().goals().regionalRecoveryTimeObjectiveStatus()); + Assertions.assertEquals(UnifiedResilienceItemRequirementSelected.NOT_SELECTED, + response.iterator().next().properties().goals().requireHighAvailability()); + Assertions.assertEquals(UnifiedResilienceItemRequirementSelected.REQUIRED, + response.iterator().next().properties().goals().requireDisasterRecovery()); + Assertions.assertEquals(6604160426977658502L, + response.iterator().next().properties().recommendations().highAvailability().enabledResourceCount()); + Assertions.assertEquals(8161445288905142925L, + response.iterator().next().properties().recommendations().highAvailability().notEnabledResourceCount()); + Assertions.assertEquals(5297987659739275685L, + response.iterator().next().properties().recommendations().highAvailability().notEvaluatedResourceCount()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-20T05:29:41Z"), + response.iterator().next().properties().recommendations().highAvailability().evaluationDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-09T16:13:55Z"), + response.iterator().next().properties().lastModifiedTime()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UpdateGoalResourceRequestTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UpdateGoalResourceRequestTests.java new file mode 100644 index 000000000000..b48373738ca6 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UpdateGoalResourceRequestTests.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.fluent.models.GoalResourceInner; +import com.azure.resourcemanager.resiliencemanagement.models.AttestationState; +import com.azure.resourcemanager.resiliencemanagement.models.ConfirmationStatus; +import com.azure.resourcemanager.resiliencemanagement.models.ExclusionState; +import com.azure.resourcemanager.resiliencemanagement.models.GoalResourceProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ReasonForRequestingConfirmation; +import com.azure.resourcemanager.resiliencemanagement.models.SolutionDisplayName; +import com.azure.resourcemanager.resiliencemanagement.models.UpdateGoalResourceRequest; +import com.azure.resourcemanager.resiliencemanagement.models.UserConfirmationForHighAvailabilityItem; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class UpdateGoalResourceRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpdateGoalResourceRequest model = BinaryData.fromString( + "{\"resources\":[{\"properties\":{\"resourceArmId\":\"f\",\"highAvailabilityGoalParticipation\":\"Excluded\",\"highAvailabilityAttestationStatus\":\"ManuallyAttested\",\"disasterRecoveryGoalParticipation\":\"Excluded\",\"disasterRecoveryAttestationStatus\":\"NotAttested\",\"exclusionReasonForHighAvailabilityGoals\":\"FailedOverResource\",\"exclusionReasonForDisasterRecoveryGoals\":\"FailedOverResource\",\"userConfirmationForHighAvailability\":[{\"solutionDisplayName\":\"VmInMultiZoneVmss\",\"confirmationStatus\":\"ApprovalNotNeeded\",\"reasonForRequestingConfirmation\":\"ZonePinnedZrsDataDisksConditional\"},{\"solutionDisplayName\":\"VmInMultiZoneVmss\",\"confirmationStatus\":\"ApprovedByUser\",\"reasonForRequestingConfirmation\":\"VmInMultiZoneScaleSetStatelessOnly\"},{\"solutionDisplayName\":\"ZonePinnedVmWithZrsDisk\",\"confirmationStatus\":\"ApprovalNotNeeded\",\"reasonForRequestingConfirmation\":\"ZonePinnedZrsDataDisksConditional\"},{\"solutionDisplayName\":\"VmInMultiZoneVmss\",\"confirmationStatus\":\"ApprovalNotNeeded\",\"reasonForRequestingConfirmation\":\"VmInMultiZoneScaleSetStatelessOnly\"}],\"serviceGroupMemberships\":[{\"serviceGroupId\":\"xofpdvhpfxxypi\",\"membershipType\":\"ThroughSubscription\"},{\"serviceGroupId\":\"nmayhuybb\",\"membershipType\":\"Direct\"},{\"serviceGroupId\":\"odepoogin\",\"membershipType\":\"ThroughResourceGroup\"},{\"serviceGroupId\":\"amiheognarxz\",\"membershipType\":\"ThroughResourceGroup\"}],\"provisioningState\":\"Provisioning\"},\"id\":\"tusivyevcciqihn\",\"name\":\"un\",\"type\":\"bwjzr\"},{\"properties\":{\"resourceArmId\":\"ygxgispemvtz\",\"highAvailabilityGoalParticipation\":\"Excluded\",\"highAvailabilityAttestationStatus\":\"NotAttested\",\"disasterRecoveryGoalParticipation\":\"Included\",\"disasterRecoveryAttestationStatus\":\"ManuallyAttested\",\"exclusionReasonForHighAvailabilityGoals\":\"UserSelectedExclusion\",\"exclusionReasonForDisasterRecoveryGoals\":\"UserSelectedExclusion\",\"userConfirmationForHighAvailability\":[{\"solutionDisplayName\":\"VmInMultiZoneVmss\",\"confirmationStatus\":\"ApprovalPending\",\"reasonForRequestingConfirmation\":\"VmInMultiZoneScaleSetStatelessOnly\"},{\"solutionDisplayName\":\"ZonePinnedVmWithZrsDisk\",\"confirmationStatus\":\"ApprovalPending\",\"reasonForRequestingConfirmation\":\"VmInMultiZoneScaleSetStatelessOnly\"},{\"solutionDisplayName\":\"ZonePinnedVmWithZrsDisk\",\"confirmationStatus\":\"RejectedByUser\",\"reasonForRequestingConfirmation\":\"ZonePinnedZrsDataDisksConditional\"}],\"serviceGroupMemberships\":[{\"serviceGroupId\":\"msmjqulngsntn\",\"membershipType\":\"Direct\"}],\"provisioningState\":\"Accepted\"},\"id\":\"gc\",\"name\":\"rwclxxwrljdo\",\"type\":\"skcqvkocrcjd\"}]}") + .toObject(UpdateGoalResourceRequest.class); + Assertions.assertEquals("f", model.resources().get(0).properties().resourceArmId()); + Assertions.assertEquals(ExclusionState.EXCLUDED, + model.resources().get(0).properties().highAvailabilityGoalParticipation()); + Assertions.assertEquals(AttestationState.MANUALLY_ATTESTED, + model.resources().get(0).properties().highAvailabilityAttestationStatus()); + Assertions.assertEquals(ExclusionState.EXCLUDED, + model.resources().get(0).properties().disasterRecoveryGoalParticipation()); + Assertions.assertEquals(AttestationState.NOT_ATTESTED, + model.resources().get(0).properties().disasterRecoveryAttestationStatus()); + Assertions.assertEquals(SolutionDisplayName.VM_IN_MULTI_ZONE_VMSS, + model.resources().get(0).properties().userConfirmationForHighAvailability().get(0).solutionDisplayName()); + Assertions.assertEquals(ConfirmationStatus.APPROVAL_NOT_NEEDED, + model.resources().get(0).properties().userConfirmationForHighAvailability().get(0).confirmationStatus()); + Assertions.assertEquals(ReasonForRequestingConfirmation.ZONE_PINNED_ZRS_DATA_DISKS_CONDITIONAL, + model.resources() + .get(0) + .properties() + .userConfirmationForHighAvailability() + .get(0) + .reasonForRequestingConfirmation()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UpdateGoalResourceRequest model = new UpdateGoalResourceRequest().withResources(Arrays.asList( + new GoalResourceInner().withProperties(new GoalResourceProperties().withResourceArmId("f") + .withHighAvailabilityGoalParticipation(ExclusionState.EXCLUDED) + .withHighAvailabilityAttestationStatus(AttestationState.MANUALLY_ATTESTED) + .withDisasterRecoveryGoalParticipation(ExclusionState.EXCLUDED) + .withDisasterRecoveryAttestationStatus(AttestationState.NOT_ATTESTED) + .withUserConfirmationForHighAvailability(Arrays.asList( + new UserConfirmationForHighAvailabilityItem() + .withSolutionDisplayName(SolutionDisplayName.VM_IN_MULTI_ZONE_VMSS) + .withConfirmationStatus(ConfirmationStatus.APPROVAL_NOT_NEEDED) + .withReasonForRequestingConfirmation( + ReasonForRequestingConfirmation.ZONE_PINNED_ZRS_DATA_DISKS_CONDITIONAL), + new UserConfirmationForHighAvailabilityItem() + .withSolutionDisplayName(SolutionDisplayName.VM_IN_MULTI_ZONE_VMSS) + .withConfirmationStatus(ConfirmationStatus.APPROVED_BY_USER) + .withReasonForRequestingConfirmation( + ReasonForRequestingConfirmation.VM_IN_MULTI_ZONE_SCALE_SET_STATELESS_ONLY), + new UserConfirmationForHighAvailabilityItem() + .withSolutionDisplayName(SolutionDisplayName.ZONE_PINNED_VM_WITH_ZRS_DISK) + .withConfirmationStatus(ConfirmationStatus.APPROVAL_NOT_NEEDED) + .withReasonForRequestingConfirmation( + ReasonForRequestingConfirmation.ZONE_PINNED_ZRS_DATA_DISKS_CONDITIONAL), + new UserConfirmationForHighAvailabilityItem() + .withSolutionDisplayName(SolutionDisplayName.VM_IN_MULTI_ZONE_VMSS) + .withConfirmationStatus(ConfirmationStatus.APPROVAL_NOT_NEEDED) + .withReasonForRequestingConfirmation( + ReasonForRequestingConfirmation.VM_IN_MULTI_ZONE_SCALE_SET_STATELESS_ONLY)))), + new GoalResourceInner().withProperties(new GoalResourceProperties().withResourceArmId("ygxgispemvtz") + .withHighAvailabilityGoalParticipation(ExclusionState.EXCLUDED) + .withHighAvailabilityAttestationStatus(AttestationState.NOT_ATTESTED) + .withDisasterRecoveryGoalParticipation(ExclusionState.INCLUDED) + .withDisasterRecoveryAttestationStatus(AttestationState.MANUALLY_ATTESTED) + .withUserConfirmationForHighAvailability(Arrays.asList( + new UserConfirmationForHighAvailabilityItem() + .withSolutionDisplayName(SolutionDisplayName.VM_IN_MULTI_ZONE_VMSS) + .withConfirmationStatus(ConfirmationStatus.APPROVAL_PENDING) + .withReasonForRequestingConfirmation( + ReasonForRequestingConfirmation.VM_IN_MULTI_ZONE_SCALE_SET_STATELESS_ONLY), + new UserConfirmationForHighAvailabilityItem() + .withSolutionDisplayName(SolutionDisplayName.ZONE_PINNED_VM_WITH_ZRS_DISK) + .withConfirmationStatus(ConfirmationStatus.APPROVAL_PENDING) + .withReasonForRequestingConfirmation( + ReasonForRequestingConfirmation.VM_IN_MULTI_ZONE_SCALE_SET_STATELESS_ONLY), + new UserConfirmationForHighAvailabilityItem() + .withSolutionDisplayName(SolutionDisplayName.ZONE_PINNED_VM_WITH_ZRS_DISK) + .withConfirmationStatus(ConfirmationStatus.REJECTED_BY_USER) + .withReasonForRequestingConfirmation( + ReasonForRequestingConfirmation.ZONE_PINNED_ZRS_DATA_DISKS_CONDITIONAL)))))); + model = BinaryData.fromObject(model).toObject(UpdateGoalResourceRequest.class); + Assertions.assertEquals("f", model.resources().get(0).properties().resourceArmId()); + Assertions.assertEquals(ExclusionState.EXCLUDED, + model.resources().get(0).properties().highAvailabilityGoalParticipation()); + Assertions.assertEquals(AttestationState.MANUALLY_ATTESTED, + model.resources().get(0).properties().highAvailabilityAttestationStatus()); + Assertions.assertEquals(ExclusionState.EXCLUDED, + model.resources().get(0).properties().disasterRecoveryGoalParticipation()); + Assertions.assertEquals(AttestationState.NOT_ATTESTED, + model.resources().get(0).properties().disasterRecoveryAttestationStatus()); + Assertions.assertEquals(SolutionDisplayName.VM_IN_MULTI_ZONE_VMSS, + model.resources().get(0).properties().userConfirmationForHighAvailability().get(0).solutionDisplayName()); + Assertions.assertEquals(ConfirmationStatus.APPROVAL_NOT_NEEDED, + model.resources().get(0).properties().userConfirmationForHighAvailability().get(0).confirmationStatus()); + Assertions.assertEquals(ReasonForRequestingConfirmation.ZONE_PINNED_ZRS_DATA_DISKS_CONDITIONAL, + model.resources() + .get(0) + .properties() + .userConfirmationForHighAvailability() + .get(0) + .reasonForRequestingConfirmation()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlanTagsUpdateTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlanTagsUpdateTests.java new file mode 100644 index 000000000000..685188838cbc --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UsagePlanTagsUpdateTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.UsagePlanTagsUpdate; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class UsagePlanTagsUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UsagePlanTagsUpdate model = BinaryData.fromString("{\"tags\":{\"iflrzpasccbiu\":\"tloqxfuojrn\"}}") + .toObject(UsagePlanTagsUpdate.class); + Assertions.assertEquals("tloqxfuojrn", model.tags().get("iflrzpasccbiu")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UsagePlanTagsUpdate model = new UsagePlanTagsUpdate().withTags(mapOf("iflrzpasccbiu", "tloqxfuojrn")); + model = BinaryData.fromObject(model).toObject(UsagePlanTagsUpdate.class); + Assertions.assertEquals("tloqxfuojrn", model.tags().get("iflrzpasccbiu")); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UserAssignedIdentityTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UserAssignedIdentityTests.java new file mode 100644 index 000000000000..5ce8e56b1eb5 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UserAssignedIdentityTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.UserAssignedIdentity; + +public final class UserAssignedIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserAssignedIdentity model = BinaryData.fromString("{\"principalId\":\"cuh\",\"clientId\":\"tcty\"}") + .toObject(UserAssignedIdentity.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserAssignedIdentity model = new UserAssignedIdentity(); + model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UserConfirmationForHighAvailabilityItemTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UserConfirmationForHighAvailabilityItemTests.java new file mode 100644 index 000000000000..0733123dd622 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/UserConfirmationForHighAvailabilityItemTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.ConfirmationStatus; +import com.azure.resourcemanager.resiliencemanagement.models.ReasonForRequestingConfirmation; +import com.azure.resourcemanager.resiliencemanagement.models.SolutionDisplayName; +import com.azure.resourcemanager.resiliencemanagement.models.UserConfirmationForHighAvailabilityItem; +import org.junit.jupiter.api.Assertions; + +public final class UserConfirmationForHighAvailabilityItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserConfirmationForHighAvailabilityItem model = BinaryData.fromString( + "{\"solutionDisplayName\":\"ZonePinnedVmWithZrsDisk\",\"confirmationStatus\":\"ApprovalNotNeeded\",\"reasonForRequestingConfirmation\":\"VmInMultiZoneScaleSetStatelessOnly\"}") + .toObject(UserConfirmationForHighAvailabilityItem.class); + Assertions.assertEquals(SolutionDisplayName.ZONE_PINNED_VM_WITH_ZRS_DISK, model.solutionDisplayName()); + Assertions.assertEquals(ConfirmationStatus.APPROVAL_NOT_NEEDED, model.confirmationStatus()); + Assertions.assertEquals(ReasonForRequestingConfirmation.VM_IN_MULTI_ZONE_SCALE_SET_STATELESS_ONLY, + model.reasonForRequestingConfirmation()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserConfirmationForHighAvailabilityItem model = new UserConfirmationForHighAvailabilityItem() + .withSolutionDisplayName(SolutionDisplayName.ZONE_PINNED_VM_WITH_ZRS_DISK) + .withConfirmationStatus(ConfirmationStatus.APPROVAL_NOT_NEEDED) + .withReasonForRequestingConfirmation( + ReasonForRequestingConfirmation.VM_IN_MULTI_ZONE_SCALE_SET_STATELESS_ONLY); + model = BinaryData.fromObject(model).toObject(UserConfirmationForHighAvailabilityItem.class); + Assertions.assertEquals(SolutionDisplayName.ZONE_PINNED_VM_WITH_ZRS_DISK, model.solutionDisplayName()); + Assertions.assertEquals(ConfirmationStatus.APPROVAL_NOT_NEEDED, model.confirmationStatus()); + Assertions.assertEquals(ReasonForRequestingConfirmation.VM_IN_MULTI_ZONE_SCALE_SET_STATELESS_ONLY, + model.reasonForRequestingConfirmation()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ValidateForExecutionPropertiesTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ValidateForExecutionPropertiesTests.java new file mode 100644 index 000000000000..ee21e20543b1 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ValidateForExecutionPropertiesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForExecutionProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ValidateForExecutionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ValidateForExecutionProperties model + = BinaryData.fromString("{\"sourceLocations\":[\"m\",\"cpmguaadraufact\"]}") + .toObject(ValidateForExecutionProperties.class); + Assertions.assertEquals("m", model.sourceLocations().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ValidateForExecutionProperties model + = new ValidateForExecutionProperties().withSourceLocations(Arrays.asList("m", "cpmguaadraufact")); + model = BinaryData.fromObject(model).toObject(ValidateForExecutionProperties.class); + Assertions.assertEquals("m", model.sourceLocations().get(0)); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ValidateForExecutionRequestTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ValidateForExecutionRequestTests.java new file mode 100644 index 000000000000..e280cdbb337d --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ValidateForExecutionRequestTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForExecutionProperties; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForExecutionRequest; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ValidateForExecutionRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ValidateForExecutionRequest model = BinaryData.fromString( + "{\"validateForExecutionProperties\":{\"sourceLocations\":[\"wagohbuffk\",\"rqemvvhmxt\",\"rjfut\",\"coebjvewzcj\"]}}") + .toObject(ValidateForExecutionRequest.class); + Assertions.assertEquals("wagohbuffk", model.validateForExecutionProperties().sourceLocations().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ValidateForExecutionRequest model + = new ValidateForExecutionRequest().withValidateForExecutionProperties(new ValidateForExecutionProperties() + .withSourceLocations(Arrays.asList("wagohbuffk", "rqemvvhmxt", "rjfut", "coebjvewzcj"))); + model = BinaryData.fromObject(model).toObject(ValidateForExecutionRequest.class); + Assertions.assertEquals("wagohbuffk", model.validateForExecutionProperties().sourceLocations().get(0)); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ValidateForOperationRequestTests.java b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ValidateForOperationRequestTests.java new file mode 100644 index 000000000000..90159b4a1957 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/src/test/java/com/azure/resourcemanager/resiliencemanagement/generated/ValidateForOperationRequestTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resiliencemanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resiliencemanagement.models.RecoveryOperationNames; +import com.azure.resourcemanager.resiliencemanagement.models.ValidateForOperationRequest; +import org.junit.jupiter.api.Assertions; + +public final class ValidateForOperationRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ValidateForOperationRequest model + = BinaryData.fromString("{\"operationName\":\"Reprotect\"}").toObject(ValidateForOperationRequest.class); + Assertions.assertEquals(RecoveryOperationNames.REPROTECT, model.operationName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ValidateForOperationRequest model + = new ValidateForOperationRequest().withOperationName(RecoveryOperationNames.REPROTECT); + model = BinaryData.fromObject(model).toObject(ValidateForOperationRequest.class); + Assertions.assertEquals(RecoveryOperationNames.REPROTECT, model.operationName()); + } +} diff --git a/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/tsp-location.yaml b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/tsp-location.yaml new file mode 100644 index 000000000000..bc4b0aed8b33 --- /dev/null +++ b/sdk/azureresiliencemanagement/azure-resourcemanager-resiliencemanagement/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/azureresiliencemanagement/resource-manager/Microsoft.AzureResilienceManagement/AzureResilienceManagement +commit: 10a2d90aac +repo: LavishSingal/azure-rest-api-specs +additionalDirectories: From e3042a3b18ff1b4f3f303e7d83d99675e1a0ed2b Mon Sep 17 00:00:00 2001 From: Lavish Singal Date: Wed, 3 Jun 2026 11:41:41 +0530 Subject: [PATCH 2/2] eng: register azure-resourcemanager-resiliencemanagement in version_client.txt Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/versioning/version_client.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index e00f0be96c4b..5ac6a0d0500b 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -531,6 +531,7 @@ com.azure.resourcemanager:azure-resourcemanager-relationships;1.0.0-beta.1;1.0.0 com.azure.resourcemanager:azure-resourcemanager-fileshares;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-monitor-slis;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-monitor-workspaces;1.0.0-beta.1;1.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-resiliencemanagement;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;1.1.0-beta.1 com.azure.v2:azure-client-sdk-parent;2.0.0-beta.2;2.0.0-beta.2