From d55ebaab627644f1d3b4f04bf9c2ff67f52f08b0 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 23 Oct 2023 10:10:14 +0000 Subject: [PATCH] CodeGen from PR 25655 in Azure/azure-rest-api-specs Merge 240750e047f68a7fec2992b508661b23aadc18a7 into 7c906b15744aaf7b782dfb82ccefcbef05cbf20b --- .../CHANGELOG.md | 4 +- .../azure-resourcemanager-security/README.md | 8 +- .../azure-resourcemanager-security/SAMPLE.md | 2129 +++++++++---- .../azure-resourcemanager-security/pom.xml | 1 + .../security/SecurityManager.java | 338 +- .../ApiCollectionOnboardingsClient.java | 52 - .../security/fluent/ApiCollectionsClient.java | 247 +- .../fluent/AzureDevOpsOrgsClient.java | 251 ++ .../fluent/AzureDevOpsProjectsClient.java | 256 ++ .../fluent/AzureDevOpsReposClient.java | 282 ++ .../fluent/DefenderForStoragesClient.java | 79 + .../fluent/DevOpsConfigurationsClient.java | 262 ++ ...java => DevOpsOperationResultsClient.java} | 34 +- .../security/fluent/GitHubOwnersClient.java | 101 + .../security/fluent/GitHubReposClient.java | 78 + .../security/fluent/GitLabGroupsClient.java | 101 + .../security/fluent/GitLabProjectsClient.java | 84 + .../fluent/GitLabSubgroupsClient.java | 44 + .../security/fluent/HealthReportsClient.java | 28 + .../fluent/IngestionSettingsClient.java | 169 - .../fluent/ResourceProvidersClient.java | 63 + .../security/fluent/SecurityCenter.java | 132 +- ...nt.java => SensitivitySettingsClient.java} | 23 +- ...ulnerabilityAssessmentsSettingsClient.java | 126 + .../fluent/models/ApiCollectionInner.java | 142 + .../models/ApiCollectionProperties.java | 157 +- .../models/ApiCollectionResponseInner.java | 90 - .../fluent/models/AzureDevOpsOrgInner.java | 71 + .../AzureDevOpsOrgListResponseInner.java | 80 + .../models/AzureDevOpsProjectInner.java | 71 + .../models/AzureDevOpsRepositoryInner.java | 71 + .../fluent/models/ConnectionStringsInner.java | 62 - .../DefenderForStorageSettingInner.java | 218 ++ .../DefenderForStorageSettingProperties.java | 234 ++ .../models/DevOpsConfigurationInner.java | 71 + ...tSensitivitySettingsListResponseInner.java | 54 + .../GetSensitivitySettingsResponseInner.java | 55 + .../fluent/models/GitHubOwnerInner.java | 71 + .../models/GitHubOwnerListResponseInner.java | 80 + .../fluent/models/GitHubRepositoryInner.java | 71 + .../fluent/models/GitLabGroupInner.java | 71 + .../models/GitLabGroupListResponseInner.java | 80 + .../fluent/models/GitLabProjectInner.java | 71 + .../fluent/models/HealthReportInner.java | 34 + .../fluent/models/HealthReportProperties.java | 46 + .../fluent/models/IngestionSettingInner.java | 51 - .../models/IngestionSettingTokenInner.java | 40 - .../models/MalwareScanningProperties.java | 137 + .../fluent/models/MdeOnboardingDataInner.java | 6 +- .../fluent/models/OnUploadProperties.java | 76 + .../models/OperationStatusResultInner.java | 247 ++ .../SensitiveDataDiscoveryProperties.java | 70 + ...lityAssessmentsAzureSettingProperties.java | 65 + ...rVulnerabilityAssessmentsSettingInner.java | 52 + .../implementation/ApiCollectionImpl.java | 81 + .../ApiCollectionOffboardingsImpl.java | 43 - .../ApiCollectionOnboardingsImpl.java | 60 - .../ApiCollectionResponseImpl.java | 55 - .../ApiCollectionsClientImpl.java | 1411 ++++++++- .../implementation/ApiCollectionsImpl.java | 91 +- .../implementation/AzureDevOpsOrgImpl.java | 141 + .../AzureDevOpsOrgListResponseImpl.java | 52 + .../AzureDevOpsOrgsClientImpl.java | 1346 ++++++++ .../implementation/AzureDevOpsOrgsImpl.java | 161 + .../AzureDevOpsProjectImpl.java | 150 + .../AzureDevOpsProjectsClientImpl.java | 1330 ++++++++ .../AzureDevOpsProjectsImpl.java | 157 + .../AzureDevOpsReposClientImpl.java | 1484 +++++++++ .../implementation/AzureDevOpsReposImpl.java | 176 ++ .../AzureDevOpsRepositoryImpl.java | 179 ++ .../implementation/ConnectionStringsImpl.java | 40 - .../DefenderForStorageSettingImpl.java | 166 + .../DefenderForStoragesClientImpl.java | 362 +++ .../DefenderForStoragesImpl.java | 129 + .../DevOpsConfigurationImpl.java | 50 + .../DevOpsConfigurationsClientImpl.java | 1384 ++++++++ .../DevOpsConfigurationsImpl.java | 132 + ... => DevOpsOperationResultsClientImpl.java} | 159 +- .../DevOpsOperationResultsImpl.java | 61 + ...etSensitivitySettingsListResponseImpl.java | 48 + .../GetSensitivitySettingsResponseImpl.java | 46 + .../implementation/GitHubOwnerImpl.java | 49 + .../GitHubOwnerListResponseImpl.java | 51 + .../GitHubOwnersClientImpl.java | 682 ++++ .../implementation/GitHubOwnersImpl.java | 99 + .../implementation/GitHubReposClientImpl.java | 551 ++++ .../implementation/GitHubReposImpl.java | 79 + .../implementation/GitHubRepositoryImpl.java | 50 + .../implementation/GitLabGroupImpl.java | 49 + .../GitLabGroupListResponseImpl.java | 51 + .../GitLabGroupsClientImpl.java | 683 ++++ .../implementation/GitLabGroupsImpl.java | 99 + .../implementation/GitLabProjectImpl.java | 50 + .../GitLabProjectsClientImpl.java | 565 ++++ .../implementation/GitLabProjectsImpl.java | 83 + ...pl.java => GitLabSubgroupsClientImpl.java} | 163 +- .../implementation/GitLabSubgroupsImpl.java | 61 + .../implementation/HealthReportImpl.java | 19 + .../HealthReportOperationsClientImpl.java | 180 -- .../HealthReportOperationsImpl.java | 58 - .../HealthReportsClientImpl.java | 129 +- .../implementation/HealthReportsImpl.java | 24 + .../implementation/IngestionSettingImpl.java | 117 - .../IngestionSettingTokenImpl.java | 32 - .../IngestionSettingsClientImpl.java | 1030 ------ .../implementation/IngestionSettingsImpl.java | 183 -- .../OperationStatusResultImpl.java | 75 + .../ResourceProvidersClientImpl.java | 280 ++ .../implementation/ResourceProvidersImpl.java | 85 + .../implementation/SecurityCenterBuilder.java | 2 +- .../implementation/SecurityCenterImpl.java | 280 +- .../SecurityConnectorsClientImpl.java | 24 +- .../SensitivitySettingsClientImpl.java | 148 + .../SensitivitySettingsImpl.java | 58 + ...erVulnerabilityAssessmentsSettingImpl.java | 46 + ...rabilityAssessmentsSettingsClientImpl.java | 762 +++++ ...rVulnerabilityAssessmentsSettingsImpl.java | 113 + .../security/implementation/Utils.java | 22 +- .../models/ActionableRemediation.java | 149 + .../models/ActionableRemediationState.java | 53 + .../AdaptiveApplicationControlGroup.java | 13 + .../AdvancedThreatProtectionSetting.java | 5 + .../models/AnnotateDefaultBranchState.java | 52 + .../security/models/ApiCollection.java | 114 + ...sponseList.java => ApiCollectionList.java} | 14 +- .../models/ApiCollectionOffboardings.java | 46 - .../models/ApiCollectionOnboardings.java | 47 - .../security/models/ApiCollections.java | 194 +- .../security/models/Application.java | 12 + .../security/models/Authorization.java | 56 + .../security/models/AutoDiscovery.java | 50 + .../models/AutoProvisioningSetting.java | 4 + .../security/models/Automation.java | 18 + .../security/models/AwsEnvironmentData.java | 26 + .../security/models/AzureDevOpsOrg.java | 171 + .../models/AzureDevOpsOrgListResponse.java | 32 + .../models/AzureDevOpsOrgProperties.java | 168 + .../security/models/AzureDevOpsOrgs.java | 122 + .../security/models/AzureDevOpsProject.java | 173 + .../AzureDevOpsProjectListResponse.java | 81 + .../models/AzureDevOpsProjectProperties.java | 209 ++ .../security/models/AzureDevOpsProjects.java | 101 + .../security/models/AzureDevOpsRepos.java | 112 + .../models/AzureDevOpsRepository.java | 174 + .../AzureDevOpsRepositoryListResponse.java | 81 + .../AzureDevOpsRepositoryProperties.java | 266 ++ .../security/models/AzureServersSetting.java | 77 + .../security/models/BuiltInInfoType.java | 103 + .../models/CategoryConfiguration.java | 84 + .../security/models/ConnectionStrings.java | 25 - .../security/models/ConnectorSetting.java | 8 + .../models/CustomAssessmentAutomation.java | 10 + .../models/CustomEntityStoreAssignment.java | 5 + .../models/DefenderCspmAwsOffering.java | 91 + .../models/DefenderCspmAwsOfferingCiem.java | 82 + .../DefenderCspmAwsOfferingCiemDiscovery.java | 50 + .../DefenderCspmAwsOfferingCiemOidc.java | 78 + ...ingMdcContainersAgentlessDiscoveryK8S.java | 76 + ...sOfferingMdcContainersImageAssessment.java | 76 + .../models/DefenderCspmGcpOffering.java | 157 +- .../DefenderCspmGcpOfferingCiemDiscovery.java | 106 + ...pmGcpOfferingDataSensitivityDiscovery.java | 104 + ...ingMdcContainersAgentlessDiscoveryK8S.java | 104 + ...pOfferingMdcContainersImageAssessment.java | 104 + .../DefenderCspmGcpOfferingVmScanners.java | 80 + ...spmGcpOfferingVmScannersConfiguration.java | 79 + .../DefenderForContainersAwsOffering.java | 62 + ...ingMdcContainersAgentlessDiscoveryK8S.java | 76 + ...sOfferingMdcContainersImageAssessment.java | 76 + .../DefenderForContainersGcpOffering.java | 62 + ...ingMdcContainersAgentlessDiscoveryK8S.java | 104 + ...pOfferingMdcContainersImageAssessment.java | 104 + .../models/DefenderForStorageSetting.java | 250 ++ .../security/models/DefenderForStorages.java | 68 + .../security/models/DevOpsConfiguration.java | 53 + .../DevOpsConfigurationListResponse.java | 81 + .../models/DevOpsConfigurationProperties.java | 182 ++ .../security/models/DevOpsConfigurations.java | 151 + .../models/DevOpsOperationResults.java | 39 + .../models/DevOpsProvisioningState.java | 68 + .../security/models/DeviceSecurityGroup.java | 13 + .../models/GcpProjectEnvironmentData.java | 26 + .../GetSensitivitySettingsListResponse.java | 25 + .../GetSensitivitySettingsResponse.java | 45 + ...SensitivitySettingsResponseProperties.java | 142 + ...tingsResponsePropertiesMipInformation.java | 140 + ...llectionResponse.java => GitHubOwner.java} | 24 +- .../models/GitHubOwnerListResponse.java | 32 + .../models/GitHubOwnerProperties.java | 169 + .../security/models/GitHubOwners.java | 91 + .../security/models/GitHubRepos.java | 70 + .../security/models/GitHubRepository.java | 53 + .../models/GitHubRepositoryListResponse.java | 81 + .../models/GitHubRepositoryProperties.java | 234 ++ .../security/models/GitLabGroup.java | 53 + .../models/GitLabGroupListResponse.java | 32 + .../models/GitLabGroupProperties.java | 195 ++ .../security/models/GitLabGroups.java | 91 + .../security/models/GitLabProject.java | 53 + .../models/GitLabProjectListResponse.java | 81 + .../models/GitLabProjectProperties.java | 215 ++ .../security/models/GitLabProjects.java | 76 + .../security/models/GitLabSubgroups.java | 39 + .../security/models/GovernanceAssignment.java | 17 + .../security/models/GovernanceRule.java | 33 + .../models/HealthDataClassification.java | 6 +- .../security/models/HealthReport.java | 16 + .../security/models/HealthReports.java | 26 + .../security/models/InfoType.java | 103 + .../models/InformationProtectionPolicy.java | 9 + .../models/IngestionConnectionString.java | 54 - .../security/models/IngestionSetting.java | 142 - .../models/IngestionSettingToken.java | 25 - .../security/models/IngestionSettings.java | 180 -- .../models/InheritFromParentState.java | 52 + .../models/IoTSecuritySolutionModel.java | 20 + .../models/JitNetworkAccessPolicy.java | 11 + .../security/models/Label.java | 105 + .../security/models/MipIntegrationStatus.java | 53 + .../security/models/OnboardingState.java | 60 + .../models/OperationStatusAutoGenerated.java | 76 + .../models/OperationStatusResult.java | 76 + .../security/models/ResourceProviders.java | 55 + .../security/models/RuleCategory.java | 62 + .../security/models/RuleResults.java | 10 + .../security/models/ScopeName.java | 53 - ...SecurityAssessmentMetadataPartnerData.java | 2 +- .../SecurityAssessmentMetadataResponse.java | 18 + .../models/SecurityAssessmentPartnerData.java | 2 +- .../models/SecurityAssessmentResponse.java | 15 + .../security/models/SecurityConnector.java | 16 + .../security/models/SecurityContact.java | 7 + ...erations.java => SensitivitySettings.java} | 21 +- ...sessmentsAzureSettingSelectedProvider.java | 45 + ...ServerVulnerabilityAssessmentsSetting.java | 47 + ...erVulnerabilityAssessmentsSettingKind.java | 46 + ...lnerabilityAssessmentsSettingKindName.java | 46 + ...erverVulnerabilityAssessmentsSettings.java | 112 + ...VulnerabilityAssessmentsSettingsList.java} | 20 +- .../models/SettingNameAutoGenerated.java | 44 + .../security/models/StatusAutoGenerated.java | 30 + .../models/TargetBranchConfiguration.java | 86 + .../UpdateSensitivitySettingsRequest.java | 118 + .../security/models/WorkspaceSetting.java | 8 + .../proxy-config.json | 1 + .../reflect-config.json | 2811 +++++++++++++++++ .../AlertsSuppressionRulesUpdateSamples.java | 1 + ...ApiCollectionOffboardingDeleteSamples.java | 23 - .../ApiCollectionOnboardingCreateSamples.java | 23 - ...etByAzureApiManagementServiceSamples.java} | 15 +- ...stByAzureApiManagementServiceSamples.java} | 14 +- ...CollectionsListByResourceGroupSamples.java | 22 + .../generated/ApiCollectionsListSamples.java | 22 + ...sOffboardAzureApiManagementApiSamples.java | 24 + ...nsOnboardAzureApiManagementApiSamples.java | 23 + .../AutomationsCreateOrUpdateSamples.java | 1 + .../generated/AutomationsValidateSamples.java | 1 + .../AzureDevOpsOrgsCreateOrUpdateSamples.java | 34 + .../generated/AzureDevOpsOrgsGetSamples.java | 22 + .../AzureDevOpsOrgsListAvailableSamples.java | 22 + .../generated/AzureDevOpsOrgsListSamples.java | 20 + .../AzureDevOpsOrgsUpdateSamples.java | 38 + ...reDevOpsProjectsCreateOrUpdateSamples.java | 34 + .../AzureDevOpsProjectsGetSamples.java | 27 + .../AzureDevOpsProjectsListSamples.java | 22 + .../AzureDevOpsProjectsUpdateSamples.java | 43 + ...AzureDevOpsReposCreateOrUpdateSamples.java | 34 + .../generated/AzureDevOpsReposGetSamples.java | 28 + .../AzureDevOpsReposListSamples.java | 27 + .../AzureDevOpsReposUpdateSamples.java | 44 + .../DefenderForStorageCreateSamples.java | 35 + .../DefenderForStorageGetSamples.java | 28 + ...psConfigurationsCreateOrUpdateSamples.java | 84 + .../DevOpsConfigurationsDeleteSamples.java | 20 + .../DevOpsConfigurationsGetSamples.java | 22 + .../DevOpsConfigurationsListSamples.java | 20 + .../DevOpsConfigurationsUpdateSamples.java | 31 + .../DevOpsOperationResultsGetSamples.java | 44 + .../generated/GitHubOwnersGetSamples.java | 22 + .../GitHubOwnersListAvailableSamples.java | 22 + .../generated/GitHubOwnersListSamples.java | 20 + .../generated/GitHubReposGetSamples.java | 23 + .../generated/GitHubReposListSamples.java | 22 + .../generated/GitLabGroupsGetSamples.java | 23 + .../GitLabGroupsListAvailableSamples.java | 22 + .../generated/GitLabGroupsListSamples.java | 20 + .../generated/GitLabProjectsGetSamples.java | 27 + .../generated/GitLabProjectsListSamples.java | 22 + .../generated/GitLabSubgroupsListSamples.java | 22 + ...ples.java => HealthReportsGetSamples.java} | 8 +- .../generated/HealthReportsListSamples.java | 2 +- ...otectionPoliciesCreateOrUpdateSamples.java | 1 + .../IngestionSettingsDeleteSamples.java | 21 - .../IngestionSettingsGetSamples.java | 20 - ...nSettingsListConnectionStringsSamples.java | 21 - .../IngestionSettingsListSamples.java | 20 - .../IngestionSettingsListTokensSamples.java | 20 - ...SecuritySolutionCreateOrUpdateSamples.java | 1 + .../IotSecuritySolutionUpdateSamples.java | 1 + ...roviderGetSensitivitySettingsSamples.java} | 13 +- ...viderUpdateSensitivitySettingsSamples.java | 36 + ...curityConnectorsCreateOrUpdateSamples.java | 5 +- .../SecurityConnectorsDeleteSamples.java | 2 +- ...tyConnectorsGetByResourceGroupSamples.java | 2 +- ...yConnectorsListByResourceGroupSamples.java | 2 +- .../SecurityConnectorsListSamples.java | 2 +- .../SecurityConnectorsUpdateSamples.java | 3 +- .../SensitivitySettingsListSamples.java | 20 + ...essmentsSettingsCreateOrUpdateSamples.java | 31 + ...ilityAssessmentsSettingsDeleteSamples.java | 26 + ...rabilityAssessmentsSettingsGetSamples.java | 27 + ...abilityAssessmentsSettingsListSamples.java | 21 + ...lityAssessmentBaselineRulesAddSamples.java | 1 + ...adConnectivityStateAutoGeneratedTests.java | 29 - .../AadExternalSecuritySolutionTests.java | 44 - .../generated/AadSolutionPropertiesTests.java | 41 - ...tiveConnectionsNotInAllowedRangeTests.java | 40 - ...ptiveApplicationControlGroupDataTests.java | 113 - ...tiveApplicationControlGroupInnerTests.java | 113 - ...iveApplicationControlGroupsInnerTests.java | 51 - ...veApplicationControlIssueSummaryTests.java | 33 - ...eByResourceGroupWithResponseMockTests.java | 63 - ...ationControlsGetWithResponseMockTests.java | 75 - ...tionControlsListWithResponseMockTests.java | 67 - ...ationControlsPutWithResponseMockTests.java | 87 - ...veNetworkHardeningEnforceRequestTests.java | 54 - .../AdaptiveNetworkHardeningInnerTests.java | 79 - ...aptiveNetworkHardeningPropertiesTests.java | 85 - ...tiveNetworkHardeningsEnforceMockTests.java | 85 - ...orkHardeningsGetWithResponseMockTests.java | 70 - ...eningsListByExtendedResourceMockTests.java | 73 - .../AdaptiveNetworkHardeningsListTests.java | 48 - .../generated/AdditionalDataTests.java | 22 - .../AdditionalWorkspacesPropertiesTests.java | 39 - ...vancedThreatProtectionPropertiesTests.java | 25 - ...ncedThreatProtectionSettingInnerTests.java | 28 - ...rotectionsCreateWithResponseMockTests.java | 67 - ...atProtectionsGetWithResponseMockTests.java | 67 - .../security/generated/AlertEntityTests.java | 38 - ...lertPropertiesSupportingEvidenceTests.java | 39 - ...imulatorBundlesRequestPropertiesTests.java | 31 - .../AlertSimulatorRequestBodyTests.java | 43 - .../AlertSimulatorRequestPropertiesTests.java | 39 - .../AlertSyncSettingPropertiesTests.java | 25 - .../generated/AlertSyncSettingsTests.java | 28 - .../AlertsSuppressionRuleInnerTests.java | 47 - .../AlertsSuppressionRulePropertiesTests.java | 69 - ...ssionRulesDeleteWithResponseMockTests.java | 61 - ...pressionRulesGetWithResponseMockTests.java | 72 - .../AlertsSuppressionRulesListMockTests.java | 74 - .../AlertsSuppressionRulesListTests.java | 62 - ...ssionRulesUpdateWithResponseMockTests.java | 87 - ...lStateToActivateWithResponseMockTests.java | 64 - ...elStateToDismissWithResponseMockTests.java | 64 - ...tateToInProgressWithResponseMockTests.java | 64 - ...elStateToResolveWithResponseMockTests.java | 64 - ...lStateToActivateWithResponseMockTests.java | 63 - ...elStateToDismissWithResponseMockTests.java | 64 - ...tateToInProgressWithResponseMockTests.java | 63 - ...elStateToResolveWithResponseMockTests.java | 64 - ...edConnectionsGetWithResponseMockTests.java | 69 - ...dConnectionsListByHomeRegionMockTests.java | 65 - .../AllowedConnectionsListMockTests.java | 65 - .../AllowedConnectionsListTests.java | 25 - .../AllowedConnectionsResourceInnerTests.java | 25 - ...wedConnectionsResourcePropertiesTests.java | 25 - .../AllowlistCustomAlertRuleTests.java | 34 - ...AmqpC2DMessagesNotInAllowedRangeTests.java | 40 - ...ejectedMessagesNotInAllowedRangeTests.java | 40 - ...AmqpD2CMessagesNotInAllowedRangeTests.java | 40 - ...fboardingsDeleteWithResponseMockTests.java | 63 - ...nboardingsCreateWithResponseMockTests.java | 71 - .../ApiCollectionPropertiesTests.java | 48 - .../ApiCollectionResponseInnerTests.java | 46 - .../ApiCollectionResponseListTests.java | 25 - ...piCollectionsGetWithResponseMockTests.java | 71 - .../ApiCollectionsListMockTests.java | 69 - .../generated/ApplicationInnerTests.java | 39 - ...nsCreateOrUpdateWithResponseMockTests.java | 78 - ...OperationsDeleteWithResponseMockTests.java | 61 - ...ionOperationsGetWithResponseMockTests.java | 70 - .../generated/ApplicationPropertiesTests.java | 39 - .../generated/ApplicationsListMockTests.java | 71 - .../generated/ApplicationsListTests.java | 25 - .../generated/AscLocationInnerTests.java | 25 - .../generated/AscLocationListTests.java | 25 - .../generated/AssessmentLinksTests.java | 22 - ...eByResourceGroupWithResponseMockTests.java | 63 - ...teInSubscriptionWithResponseMockTests.java | 61 - .../AtaExternalSecuritySolutionTests.java | 43 - .../generated/AtaSolutionPropertiesTests.java | 40 - .../AuthenticationDetailsPropertiesTests.java | 25 - .../AutoProvisioningSettingInnerTests.java | 29 - .../AutoProvisioningSettingListTests.java | 38 - ...utoProvisioningSettingPropertiesTests.java | 27 - ...ngSettingsCreateWithResponseMockTests.java | 68 - ...oningSettingsGetWithResponseMockTests.java | 71 - ...AutoProvisioningSettingsListMockTests.java | 69 - .../AutomationActionEventHubTests.java | 33 - .../AutomationActionLogicAppTests.java | 30 - .../generated/AutomationActionTests.java | 22 - .../AutomationActionWorkspaceTests.java | 27 - .../generated/AutomationInnerTests.java | 79 - .../generated/AutomationListTests.java | 85 - .../generated/AutomationPropertiesTests.java | 71 - .../generated/AutomationRuleSetTests.java | 47 - .../generated/AutomationScopeTests.java | 29 - .../generated/AutomationSourceTests.java | 37 - .../AutomationTriggeringRuleTests.java | 41 - .../AutomationValidationStatusInnerTests.java | 30 - ...nsCreateOrUpdateWithResponseMockTests.java | 95 - ...eByResourceGroupWithResponseMockTests.java | 63 - ...tByResourceGroupWithResponseMockTests.java | 73 - ...tomationsListByResourceGroupMockTests.java | 71 - .../generated/AutomationsListMockTests.java | 70 - ...omationsValidateWithResponseMockTests.java | 97 - ...eAuthenticationDetailsPropertiesTests.java | 32 - .../generated/AwsEnvironmentDataTests.java | 33 - .../AwsOrganizationalDataMasterTests.java | 34 - .../AwsOrganizationalDataMemberTests.java | 27 - .../generated/AwsOrganizationalDataTests.java | 24 - .../AzureDevOpsScopeEnvironmentDataTests.java | 24 - .../generated/AzureResourceDetailsTests.java | 22 - .../AzureResourceIdentifierTests.java | 24 - .../generated/AzureResourceLinkTests.java | 22 - .../AzureTrackedResourceLocationTests.java | 25 - .../BaselineAdjustedResultTests.java | 58 - .../security/generated/BaselineTests.java | 41 - .../generated/BenchmarkReferenceTests.java | 29 - .../CefExternalSecuritySolutionTests.java | 49 - .../generated/CefSolutionPropertiesTests.java | 46 - .../generated/CloudOfferingTests.java | 24 - .../generated/ComplianceInnerTests.java | 25 - .../generated/ComplianceListTests.java | 35 - .../generated/CompliancePropertiesTests.java | 25 - .../generated/ComplianceResultInnerTests.java | 25 - .../generated/ComplianceResultListTests.java | 29 - .../ComplianceResultPropertiesTests.java | 22 - ...lianceResultsGetWithResponseMockTests.java | 64 - .../ComplianceResultsListMockTests.java | 65 - .../generated/ComplianceSegmentTests.java | 24 - .../CompliancesGetWithResponseMockTests.java | 64 - .../generated/CompliancesListMockTests.java | 65 - .../generated/ConnectableResourceTests.java | 25 - .../generated/ConnectedResourceTests.java | 24 - .../generated/ConnectedWorkspaceTests.java | 25 - .../ConnectionFromIpNotAllowedTests.java | 34 - .../ConnectionStringsInnerTests.java | 29 - .../ConnectionToIpNotAllowedTests.java | 34 - .../generated/ConnectorSettingInnerTests.java | 42 - .../generated/ConnectorSettingListTests.java | 35 - ...rsCreateOrUpdateWithResponseMockTests.java | 81 - ...ConnectorsDeleteWithResponseMockTests.java | 61 - .../ConnectorsGetWithResponseMockTests.java | 70 - .../generated/ConnectorsListMockTests.java | 70 - ...rRegistryVulnerabilityPropertiesTests.java | 25 - ...AwsOfferingNativeCloudConnectionTests.java | 28 - .../CspmMonitorAwsOfferingTests.java | 32 - .../CspmMonitorAzureDevOpsOfferingTests.java | 24 - ...GcpOfferingNativeCloudConnectionTests.java | 32 - .../CspmMonitorGcpOfferingTests.java | 36 - .../CspmMonitorGitLabOfferingTests.java | 24 - .../CspmMonitorGithubOfferingTests.java | 24 - .../generated/CustomAlertRuleTests.java | 28 - ...smentAutomationRequestPropertiesTests.java | 47 - ...ustomAssessmentAutomationRequestTests.java | 47 - ...eByResourceGroupWithResponseMockTests.java | 63 - ...CustomEntityStoreAssignmentInnerTests.java | 33 - ...mEntityStoreAssignmentPropertiesTests.java | 32 - ...StoreAssignmentRequestPropertiesTests.java | 28 - ...stomEntityStoreAssignmentRequestTests.java | 27 - ...ssignmentsCreateWithResponseMockTests.java | 73 - ...eByResourceGroupWithResponseMockTests.java | 63 - ...tByResourceGroupWithResponseMockTests.java | 71 - ...signmentsListByResourceGroupMockTests.java | 69 - ...omEntityStoreAssignmentsListMockTests.java | 69 - ...EntityStoreAssignmentsListResultTests.java | 29 - .../security/generated/CveTests.java | 21 - .../security/generated/CvssTests.java | 21 - .../DataExportSettingPropertiesTests.java | 25 - .../generated/DataExportSettingsTests.java | 28 - ...OfferingDataSensitivityDiscoveryTests.java | 30 - ...nderCspmAwsOfferingDatabasesDspmTests.java | 30 - .../DefenderCspmAwsOfferingTests.java | 75 - ...sOfferingVmScannersConfigurationTests.java | 50 - ...efenderCspmAwsOfferingVmScannersTests.java | 65 - .../DefenderCspmGcpOfferingTests.java | 24 - ...ArcAutoProvisioningConfigurationTests.java | 33 - ...esAwsOfferingArcAutoProvisioningTests.java | 42 - ...atabasesAwsOfferingDatabasesDspmTests.java | 30 - ...efenderFoDatabasesAwsOfferingRdsTests.java | 30 - .../DefenderFoDatabasesAwsOfferingTests.java | 60 - ...rsAwsOfferingCloudWatchToKinesisTests.java | 28 - ...ainerVulnerabilityAssessmentTaskTests.java | 32 - ...ContainerVulnerabilityAssessmentTests.java | 31 - ...ContainersAwsOfferingKinesisToS3Tests.java | 28 - ...AwsOfferingKubernetesScubaReaderTests.java | 28 - ...nersAwsOfferingKubernetesServiceTests.java | 28 - ...DefenderForContainersAwsOfferingTests.java | 69 - ...ataPipelineNativeCloudConnectionTests.java | 36 - ...GcpOfferingNativeCloudConnectionTests.java | 33 - ...DefenderForContainersGcpOfferingTests.java | 56 - ...ArcAutoProvisioningConfigurationTests.java | 35 - ...esGcpOfferingArcAutoProvisioningTests.java | 39 - ...rForDatabasesArcAutoProvisioningTests.java | 35 - .../DefenderForDatabasesGcpOfferingTests.java | 55 - ...nderForDevOpsAzureDevOpsOfferingTests.java | 24 - .../DefenderForDevOpsGitLabOfferingTests.java | 24 - .../DefenderForDevOpsGithubOfferingTests.java | 24 - ...ArcAutoProvisioningConfigurationTests.java | 33 - ...rsAwsOfferingArcAutoProvisioningTests.java | 42 - ...ersAwsOfferingDefenderForServersTests.java | 28 - ...rsAwsOfferingMdeAutoProvisioningTests.java | 28 - ...nderForServersAwsOfferingSubPlanTests.java | 26 - .../DefenderForServersAwsOfferingTests.java | 109 - ...gVaAutoProvisioningConfigurationTests.java | 30 - ...ersAwsOfferingVaAutoProvisioningTests.java | 35 - ...sOfferingVmScannersConfigurationTests.java | 59 - ...rForServersAwsOfferingVmScannersTests.java | 57 - ...ArcAutoProvisioningConfigurationTests.java | 33 - ...rsGcpOfferingArcAutoProvisioningTests.java | 39 - ...ersGcpOfferingDefenderForServersTests.java | 32 - ...rsGcpOfferingMdeAutoProvisioningTests.java | 28 - ...nderForServersGcpOfferingSubPlanTests.java | 26 - .../DefenderForServersGcpOfferingTests.java | 113 - ...gVaAutoProvisioningConfigurationTests.java | 30 - ...ersGcpOfferingVaAutoProvisioningTests.java | 35 - ...pOfferingVmScannersConfigurationTests.java | 48 - ...rForServersGcpOfferingVmScannersTests.java | 53 - .../DenylistCustomAlertRuleTests.java | 34 - .../DeviceSecurityGroupInnerTests.java | 90 - .../DeviceSecurityGroupListTests.java | 36 - .../DeviceSecurityGroupPropertiesTests.java | 88 - ...psCreateOrUpdateWithResponseMockTests.java | 73 - ...eByResourceGroupWithResponseMockTests.java | 63 - ...ecurityGroupsGetWithResponseMockTests.java | 67 - .../DeviceSecurityGroupsListMockTests.java | 65 - ...ctMethodInvokesNotInAllowedRangeTests.java | 40 - .../DiscoveredSecuritySolutionInnerTests.java | 40 - .../DiscoveredSecuritySolutionListTests.java | 61 - ...overedSecuritySolutionPropertiesTests.java | 40 - ...ritySolutionsGetWithResponseMockTests.java | 74 - ...itySolutionsListByHomeRegionMockTests.java | 72 - ...coveredSecuritySolutionsListMockTests.java | 72 - .../EffectiveNetworkSecurityGroupsTests.java | 34 - .../generated/EnvironmentDataTests.java | 22 - .../generated/EnvironmentDetailsTests.java | 42 - .../security/generated/EtagTests.java | 24 - .../ExecuteGovernanceRuleParamsTests.java | 25 - .../ExternalSecuritySolutionInnerTests.java | 25 - .../ExternalSecuritySolutionListTests.java | 29 - ...ternalSecuritySolutionPropertiesTests.java | 51 - ...ritySolutionsGetWithResponseMockTests.java | 67 - ...itySolutionsListByHomeRegionMockTests.java | 65 - ...xternalSecuritySolutionsListMockTests.java | 65 - ...iledLocalLoginsNotInAllowedRangeTests.java | 40 - .../FileUploadsNotInAllowedRangeTests.java | 40 - .../GcpOrganizationalDataMemberTests.java | 33 - ...cpOrganizationalDataOrganizationTests.java | 37 - .../generated/GcpOrganizationalDataTests.java | 24 - .../generated/GcpProjectDetailsTests.java | 31 - .../GcpProjectEnvironmentDataTests.java | 35 - .../GithubScopeEnvironmentDataTests.java | 22 - .../GitlabScopeEnvironmentDataTests.java | 22 - ...vernanceAssignmentAdditionalDataTests.java | 35 - .../GovernanceAssignmentInnerTests.java | 67 - .../GovernanceAssignmentPropertiesTests.java | 67 - ...tsCreateOrUpdateWithResponseMockTests.java | 99 - ...ssignmentsDeleteWithResponseMockTests.java | 61 - ...ceAssignmentsGetWithResponseMockTests.java | 79 - .../GovernanceAssignmentsListMockTests.java | 85 - .../GovernanceAssignmentsListTests.java | 25 - .../GovernanceEmailNotificationTests.java | 32 - .../GovernanceRuleEmailNotificationTests.java | 32 - .../generated/GovernanceRuleInnerTests.java | 82 - .../generated/GovernanceRuleListTests.java | 25 - .../GovernanceRuleMetadataTests.java | 25 - .../GovernanceRuleOwnerSourceTests.java | 31 - .../GovernanceRulePropertiesTests.java | 82 - ...esCreateOrUpdateWithResponseMockTests.java | 111 - .../GovernanceRulesDeleteMockTests.java | 61 - ...vernanceRulesGetWithResponseMockTests.java | 86 - .../GovernanceRulesListMockTests.java | 90 - ...OperationResultsWithResponseMockTests.java | 67 - .../HealthDataClassificationTests.java | 36 - .../generated/HealthReportsListTests.java | 25 - ...HttpC2DMessagesNotInAllowedRangeTests.java | 40 - ...ejectedMessagesNotInAllowedRangeTests.java | 40 - ...HttpD2CMessagesNotInAllowedRangeTests.java | 40 - .../security/generated/IdentityTests.java | 28 - ...AwsOfferingInformationProtectionTests.java | 28 - ...InformationProtectionAwsOfferingTests.java | 32 - .../InformationProtectionKeywordTests.java | 39 - ...esCreateOrUpdateWithResponseMockTests.java | 84 - ...ctionPoliciesGetWithResponseMockTests.java | 68 - ...mationProtectionPoliciesListMockTests.java | 65 - .../InformationProtectionPolicyListTests.java | 46 - .../IngestionConnectionStringTests.java | 24 - .../generated/IngestionSettingInnerTests.java | 24 - .../generated/IngestionSettingListTests.java | 25 - ...onSettingsCreateWithResponseMockTests.java | 63 - ...onSettingsDeleteWithResponseMockTests.java | 61 - ...stionSettingsGetWithResponseMockTests.java | 64 - ...onnectionStringsWithResponseMockTests.java | 67 - .../IngestionSettingsListMockTests.java | 64 - .../IoTSecurityAggregatedAlertInnerTests.java | 42 - .../IoTSecurityAggregatedAlertListTests.java | 49 - ...ecurityAggregatedAlertPropertiesTests.java | 25 - ...lertPropertiesTopDevicesListItemTests.java | 26 - ...ityAggregatedRecommendationInnerTests.java | 55 - ...rityAggregatedRecommendationListTests.java | 67 - ...gregatedRecommendationPropertiesTests.java | 29 - .../IoTSecurityAlertedDeviceTests.java | 24 - .../IoTSecurityDeviceAlertTests.java | 25 - .../IoTSecurityDeviceRecommendationTests.java | 25 - ...uritySolutionAnalyticsModelInnerTests.java | 44 - ...ySolutionAnalyticsModelListInnerTests.java | 39 - ...odelPropertiesDevicesMetricsItemTests.java | 44 - ...SolutionAnalyticsModelPropertiesTests.java | 46 - .../IoTSecuritySolutionModelInnerTests.java | 134 - .../IoTSecuritySolutionPropertiesTests.java | 144 - .../IoTSecuritySolutionsListTests.java | 95 - .../generated/IoTSeverityMetricsTests.java | 35 - ...tionAnalyticsGetWithResponseMockTests.java | 67 - ...ionAnalyticsListWithResponseMockTests.java | 67 - ...tedAlertsDismissWithResponseMockTests.java | 63 - ...regatedAlertsGetWithResponseMockTests.java | 70 - ...nalyticsAggregatedAlertsListMockTests.java | 70 - ...commendationsGetWithResponseMockTests.java | 71 - ...AnalyticsRecommendationsListMockTests.java | 71 - ...nsCreateOrUpdateWithResponseMockTests.java | 117 - ...eByResourceGroupWithResponseMockTests.java | 63 - ...tByResourceGroupWithResponseMockTests.java | 83 - ...SolutionsListByResourceGroupMockTests.java | 81 - .../IotSecuritySolutionsListMockTests.java | 81 - ...esCreateOrUpdateWithResponseMockTests.java | 75 - ...ssPoliciesDeleteWithResponseMockTests.java | 63 - ...ccessPoliciesGetWithResponseMockTests.java | 70 - ...PoliciesInitiateWithResponseMockTests.java | 97 - ...rkAccessPoliciesListByRegionMockTests.java | 68 - ...ListByResourceGroupAndRegionMockTests.java | 70 - ...sPoliciesListByResourceGroupMockTests.java | 70 - ...JitNetworkAccessPoliciesListMockTests.java | 68 - .../JitNetworkAccessPoliciesListTests.java | 42 - ...tNetworkAccessPolicyInitiatePortTests.java | 37 - ...tworkAccessPolicyInitiateRequestTests.java | 40 - ...cessPolicyInitiateVirtualMachineTests.java | 50 - .../JitNetworkAccessPolicyInnerTests.java | 64 - ...JitNetworkAccessPolicyPropertiesTests.java | 71 - ...etworkAccessPolicyVirtualMachineTests.java | 73 - .../JitNetworkAccessPortRuleTests.java | 44 - .../JitNetworkAccessRequestInnerTests.java | 48 - .../JitNetworkAccessRequestPortTests.java | 52 - ...tworkAccessRequestVirtualMachineTests.java | 77 - .../generated/KindAutoGeneratedTests.java | 24 - .../generated/ListCustomAlertRuleTests.java | 28 - .../generated/LocalUserNotAllowedTests.java | 34 - .../security/generated/LocationTests.java | 21 - .../LocationsGetWithResponseMockTests.java | 64 - .../generated/LocationsListMockTests.java | 64 - .../LogAnalyticsIdentifierTests.java | 25 - .../MdeOnboardingDataInnerTests.java | 25 - .../MdeOnboardingDataListInnerTests.java | 32 - .../MdeOnboardingDataPropertiesTests.java | 21 - ...deOnboardingsGetWithResponseMockTests.java | 63 - ...eOnboardingsListWithResponseMockTests.java | 63 - ...MqttC2DMessagesNotInAllowedRangeTests.java | 40 - ...ejectedMessagesNotInAllowedRangeTests.java | 40 - ...MqttD2CMessagesNotInAllowedRangeTests.java | 40 - .../OnPremiseResourceDetailsTests.java | 39 - .../OnPremiseSqlResourceDetailsTests.java | 45 - .../generated/OperationDisplayTests.java | 25 - .../generated/OperationInnerTests.java | 26 - .../generated/OperationListTests.java | 34 - ...perationResultAutoGeneratedInnerTests.java | 22 - .../generated/PathRecommendationTests.java | 82 - .../security/generated/PricingInnerTests.java | 61 - .../generated/PricingListInnerTests.java | 53 - .../PricingsGetWithResponseMockTests.java | 68 - .../PricingsListWithResponseMockTests.java | 63 - .../PricingsUpdateWithResponseMockTests.java | 80 - .../generated/ProcessNotAllowedTests.java | 32 - .../generated/ProtectionModeTests.java | 39 - .../generated/ProxyServerPropertiesTests.java | 27 - .../generated/PublisherInfoTests.java | 39 - .../security/generated/QueryCheckTests.java | 42 - .../QueuePurgesNotInAllowedRangeTests.java | 40 - ...mendationConfigurationPropertiesTests.java | 35 - ...ulatoryComplianceAssessmentInnerTests.java | 29 - ...gulatoryComplianceAssessmentListTests.java | 38 - ...ryComplianceAssessmentPropertiesTests.java | 30 - ...ceAssessmentsGetWithResponseMockTests.java | 71 - ...oryComplianceAssessmentsListMockTests.java | 71 - ...RegulatoryComplianceControlInnerTests.java | 29 - .../RegulatoryComplianceControlListTests.java | 33 - ...atoryComplianceControlPropertiesTests.java | 30 - ...ianceControlsGetWithResponseMockTests.java | 71 - ...latoryComplianceControlsListMockTests.java | 71 - ...egulatoryComplianceStandardInnerTests.java | 29 - ...RegulatoryComplianceStandardListTests.java | 38 - ...toryComplianceStandardPropertiesTests.java | 30 - ...anceStandardsGetWithResponseMockTests.java | 71 - ...atoryComplianceStandardsListMockTests.java | 69 - .../generated/RemediationEtaTests.java | 33 - .../security/generated/RemediationTests.java | 40 - .../ResourceDetailsAutoGeneratedTests.java | 28 - .../generated/ResourceDetailsTests.java | 22 - .../generated/ResourceIdentifierTests.java | 22 - .../generated/RuleResultsInnerTests.java | 34 - .../generated/RuleResultsInputTests.java | 33 - .../generated/RuleResultsPropertiesTests.java | 31 - .../security/generated/RuleTests.java | 45 - .../generated/RulesResultsInnerTests.java | 38 - .../generated/RulesResultsInputTests.java | 63 - .../security/generated/ScanInnerTests.java | 78 - .../generated/ScanPropertiesTests.java | 75 - .../generated/ScanResultInnerTests.java | 100 - .../generated/ScanResultPropertiesTests.java | 143 - .../generated/ScanResultsInnerTests.java | 54 - .../security/generated/ScansInnerTests.java | 92 - .../security/generated/ScopeElementTests.java | 41 - .../security/generated/ScoreDetailsTests.java | 24 - ...eScoreControlDefinitionItemInnerTests.java | 25 - ...eControlDefinitionItemPropertiesTests.java | 25 - ...SecureScoreControlDefinitionListTests.java | 25 - ...cureScoreControlDefinitionSourceTests.java | 27 - ...efinitionsListBySubscriptionMockTests.java | 65 - ...eScoreControlDefinitionsListMockTests.java | 65 - .../SecureScoreControlDetailsInnerTests.java | 27 - .../SecureScoreControlListTests.java | 25 - ...ureScoreControlScoreDetailsInnerTests.java | 27 - ...oreControlsListBySecureScoreMockTests.java | 68 - .../SecureScoreControlsListMockTests.java | 66 - .../generated/SecureScoreItemInnerTests.java | 25 - .../SecureScoreItemPropertiesTests.java | 25 - .../SecureScoresGetWithResponseMockTests.java | 64 - .../generated/SecureScoresListMockTests.java | 64 - .../generated/SecureScoresListTests.java | 25 - .../SecurityAssessmentListTests.java | 25 - ...taPropertiesResponsePublishDatesTests.java | 30 - ...tyAssessmentMetadataResponseListTests.java | 25 - ...nsCreateOrUpdateWithResponseMockTests.java | 84 - ...OperationsDeleteWithResponseMockTests.java | 63 - ...ionOperationsGetWithResponseMockTests.java | 73 - ...ityConnectorApplicationsListMockTests.java | 72 - .../SecurityConnectorInnerTests.java | 58 - .../SecurityConnectorPropertiesTests.java | 39 - ...rsCreateOrUpdateWithResponseMockTests.java | 96 - ...eByResourceGroupWithResponseMockTests.java | 63 - ...tByResourceGroupWithResponseMockTests.java | 74 - ...onnectorsListByResourceGroupMockTests.java | 72 - .../SecurityConnectorsListMockTests.java | 71 - .../SecurityConnectorsListTests.java | 75 - .../generated/SecurityContactInnerTests.java | 55 - .../generated/SecurityContactListTests.java | 25 - ...tactPropertiesAlertNotificationsTests.java | 34 - ...actPropertiesNotificationsByRoleTests.java | 35 - .../SecurityContactPropertiesTests.java | 55 - ...tyContactsCreateWithResponseMockTests.java | 89 - ...tyContactsDeleteWithResponseMockTests.java | 61 - ...urityContactsGetWithResponseMockTests.java | 73 - .../SecurityContactsListMockTests.java | 74 - .../generated/SecurityOperatorInnerTests.java | 31 - .../SecurityOperatorListInnerTests.java | 40 - ...rsCreateOrUpdateWithResponseMockTests.java | 71 - ...eByResourceGroupWithResponseMockTests.java | 63 - ...rityOperatorsGetWithResponseMockTests.java | 68 - ...ityOperatorsListWithResponseMockTests.java | 67 - .../generated/SecuritySolutionInnerTests.java | 41 - .../generated/SecuritySolutionListTests.java | 62 - .../SecuritySolutionPropertiesTests.java | 41 - ...ritySolutionsGetWithResponseMockTests.java | 75 - .../SecuritySolutionsListMockTests.java | 72 - ...ySolutionsReferenceDataListInnerTests.java | 55 - ...SolutionsReferenceDataPropertiesTests.java | 49 - .../SecuritySolutionsReferenceDataTests.java | 49 - ...ListByHomeRegionWithResponseMockTests.java | 67 - ...ferenceDatasListWithResponseMockTests.java | 64 - .../SecuritySubAssessmentListTests.java | 25 - .../generated/SecurityTaskInnerTests.java | 42 - .../generated/SecurityTaskListTests.java | 25 - .../SecurityTaskParametersTests.java | 39 - .../SecurityTaskPropertiesTests.java | 42 - .../generated/SensitivityLabelTests.java | 43 - ...rverVulnerabilityAssessmentInnerTests.java | 25 - ...ulnerabilityAssessmentPropertiesTests.java | 24 - ...tsCreateOrUpdateWithResponseMockTests.java | 68 - ...lnerabilityAssessmentsDeleteMockTests.java | 63 - ...tyAssessmentsGetWithResponseMockTests.java | 68 - ...ExtendedResourceWithResponseMockTests.java | 68 - ...ulnerabilityAssessmentsListInnerTests.java | 29 - .../ServerVulnerabilityPropertiesTests.java | 25 - .../security/generated/SettingInnerTests.java | 24 - .../SettingsGetWithResponseMockTests.java | 67 - .../generated/SettingsListMockTests.java | 64 - .../security/generated/SettingsListTests.java | 27 - .../SettingsUpdateWithResponseMockTests.java | 71 - .../generated/SoftwareInnerTests.java | 55 - ...reInventoriesGetWithResponseMockTests.java | 80 - ...toriesListByExtendedResourceMockTests.java | 81 - .../SoftwareInventoriesListMockTests.java | 77 - .../generated/SoftwarePropertiesTests.java | 55 - .../generated/SoftwaresListTests.java | 63 - ...SqlServerVulnerabilityPropertiesTests.java | 25 - ...BaselineRulesAddWithResponseMockTests.java | 94 - ...esCreateOrUpdateWithResponseMockTests.java | 80 - ...elineRulesDeleteWithResponseMockTests.java | 63 - ...BaselineRulesGetWithResponseMockTests.java | 70 - ...aselineRulesListWithResponseMockTests.java | 67 - ...ntScanResultsGetWithResponseMockTests.java | 87 - ...tScanResultsListWithResponseMockTests.java | 66 - ...sessmentScansGetWithResponseMockTests.java | 86 - ...essmentScansListWithResponseMockTests.java | 67 - .../SuppressionAlertsScopeTests.java | 45 - .../security/generated/TagsResourceTests.java | 41 - .../security/generated/TagsTests.java | 38 - ...ceGroupLevelTaskWithResponseMockTests.java | 68 - ...riptionLevelTaskWithResponseMockTests.java | 67 - .../TasksListByHomeRegionMockTests.java | 65 - .../TasksListByResourceGroupMockTests.java | 65 - .../generated/TasksListMockTests.java | 64 - ...upLevelTaskStateWithResponseMockTests.java | 65 - ...onLevelTaskStateWithResponseMockTests.java | 65 - .../ThresholdCustomAlertRuleTests.java | 36 - .../TimeWindowCustomAlertRuleTests.java | 40 - .../TopologiesGetWithResponseMockTests.java | 67 - .../TopologiesListByHomeRegionMockTests.java | 65 - .../generated/TopologiesListMockTests.java | 64 - .../security/generated/TopologyListTests.java | 25 - .../generated/TopologyResourceInnerTests.java | 25 - .../TopologyResourcePropertiesTests.java | 25 - .../TopologySingleResourceChildTests.java | 22 - .../TopologySingleResourceParentTests.java | 22 - .../TopologySingleResourceTests.java | 25 - .../generated/TrackedResourceTests.java | 52 - .../TwinUpdatesNotInAllowedRangeTests.java | 40 - ...rizedOperationsNotInAllowedRangeTests.java | 40 - ...ateIoTSecuritySolutionPropertiesTests.java | 61 - .../UpdateIotSecuritySolutionDataTests.java | 84 - .../UserDefinedResourcesPropertiesTests.java | 34 - .../generated/UserRecommendationTests.java | 31 - .../security/generated/VaRuleTests.java | 80 - .../generated/VendorReferenceTests.java | 22 - .../generated/VmRecommendationTests.java | 42 - .../generated/WorkspaceSettingInnerTests.java | 31 - .../generated/WorkspaceSettingListTests.java | 39 - .../WorkspaceSettingPropertiesTests.java | 30 - ...ceSettingsCreateWithResponseMockTests.java | 73 - ...ceSettingsDeleteWithResponseMockTests.java | 61 - ...spaceSettingsGetWithResponseMockTests.java | 68 - .../WorkspaceSettingsListMockTests.java | 68 - 851 files changed, 33301 insertions(+), 31094 deletions(-) delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionOnboardingsClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsOrgsClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsProjectsClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsReposClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DefenderForStoragesClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsConfigurationsClient.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/{ApiCollectionOffboardingsClient.java => DevOpsOperationResultsClient.java} (50%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubOwnersClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubReposClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabGroupsClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabProjectsClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabSubgroupsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IngestionSettingsClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ResourceProvidersClient.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/{HealthReportOperationsClient.java => SensitivitySettingsClient.java} (56%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsSettingsClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionResponseInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgListResponseInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsProjectInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsRepositoryInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectionStringsInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DevOpsConfigurationInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsListResponseInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsResponseInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerListResponseInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubRepositoryInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupListResponseInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabProjectInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingTokenInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MalwareScanningProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OnUploadProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationStatusResultInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SensitiveDataDiscoveryProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsAzureSettingProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsSettingInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOffboardingsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOnboardingsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionResponseImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgListResponseImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsRepositoryImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectionStringsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStorageSettingImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsImpl.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/{ApiCollectionOnboardingsClientImpl.java => DevOpsOperationResultsClientImpl.java} (50%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsListResponseImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsResponseImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerListResponseImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubRepositoryImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupListResponseImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsImpl.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/{ApiCollectionOffboardingsClientImpl.java => GitLabSubgroupsClientImpl.java} (53%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingTokenImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationStatusResultImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediation.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediationState.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AnnotateDefaultBranchState.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollection.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/{ApiCollectionResponseList.java => ApiCollectionList.java} (78%) delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionOffboardings.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionOnboardings.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Authorization.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoDiscovery.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrg.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgListResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgs.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProject.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectListResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjects.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepos.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepository.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryListResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureServersSetting.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BuiltInInfoType.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CategoryConfiguration.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionStrings.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiem.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemDiscovery.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemOidc.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersImageAssessment.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingCiemDiscovery.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingDataSensitivityDiscovery.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersImageAssessment.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingVmScanners.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingVmScannersConfiguration.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersImageAssessment.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersImageAssessment.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorageSetting.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorages.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfiguration.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationListResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurations.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsOperationResults.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsProvisioningState.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsListResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponseProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponsePropertiesMipInformation.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/{ApiCollectionResponse.java => GitHubOwner.java} (55%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubOwnerListResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubOwnerProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubOwners.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepos.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepository.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepositoryListResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepositoryProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroup.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroupListResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroupProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroups.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProject.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProjectListResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProjectProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProjects.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabSubgroups.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InfoType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionConnectionString.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSetting.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettingToken.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettings.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InheritFromParentState.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Label.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MipIntegrationStatus.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnboardingState.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationStatusAutoGenerated.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationStatusResult.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceProviders.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleCategory.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScopeName.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/{HealthReportOperations.java => SensitivitySettings.java} (52%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsAzureSettingSelectedProvider.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSetting.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettingKind.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettingKindName.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettings.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/{IngestionSettingList.java => ServerVulnerabilityAssessmentsSettingsList.java} (60%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingNameAutoGenerated.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TargetBranchConfiguration.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpdateSensitivitySettingsRequest.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-security/proxy-config.json create mode 100644 sdk/security/azure-resourcemanager-security/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-security/reflect-config.json delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOffboardingDeleteSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOnboardingCreateSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/{ApiCollectionGetSamples.java => ApiCollectionsGetByAzureApiManagementServiceSamples.java} (51%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/{ApiCollectionListSamples.java => ApiCollectionsListByAzureApiManagementServiceSamples.java} (53%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListByResourceGroupSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsOffboardAzureApiManagementApiSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsOnboardAzureApiManagementApiSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsCreateOrUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsListAvailableSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsCreateOrUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposCreateOrUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageCreateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsCreateOrUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsDeleteSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsOperationResultsGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersListAvailableSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubReposGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubReposListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsListAvailableSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabProjectsGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabProjectsListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabSubgroupsListSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/{HealthReportOperationGetSamples.java => HealthReportsGetSamples.java} (78%) delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListTokensSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/{IngestionSettingsCreateSamples.java => ResourceProviderGetSensitivitySettingsSamples.java} (50%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ResourceProviderUpdateSensitivitySettingsSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SensitivitySettingsListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsCreateOrUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsDeleteSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadConnectivityStateAutoGeneratedTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadExternalSecuritySolutionTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadSolutionPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ActiveConnectionsNotInAllowedRangeTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupDataTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupsInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlIssueSummaryTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsDeleteByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsListWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsPutWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningEnforceRequestTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsEnforceMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListByExtendedResourceMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdditionalDataTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdditionalWorkspacesPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionSettingInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionsCreateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertEntityTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertPropertiesSupportingEvidenceTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorBundlesRequestPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorRequestBodyTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorRequestPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSyncSettingPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSyncSettingsTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRuleInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulePropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesDeleteWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToActivateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToDismissWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToInProgressWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToResolveWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToActivateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToDismissWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToInProgressWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToResolveWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListByHomeRegionMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsResourceInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsResourcePropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowlistCustomAlertRuleTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpC2DMessagesNotInAllowedRangeTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpC2DRejectedMessagesNotInAllowedRangeTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpD2CMessagesNotInAllowedRangeTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionOffboardingsDeleteWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionOnboardingsCreateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionResponseInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionResponseListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsDeleteWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationsListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AscLocationInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AscLocationListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentLinksTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentsDeleteByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentsMetadatasDeleteInSubscriptionWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AtaExternalSecuritySolutionTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AtaSolutionPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AuthenticationDetailsPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsCreateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionEventHubTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionLogicAppTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionWorkspaceTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationRuleSetTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationScopeTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationSourceTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationTriggeringRuleTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationValidationStatusInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsDeleteByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsListByResourceGroupMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsValidateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwAssumeRoleAuthenticationDetailsPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsEnvironmentDataTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataMasterTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataMemberTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsScopeEnvironmentDataTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceDetailsTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceIdentifierTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceLinkTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureTrackedResourceLocationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BaselineAdjustedResultTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BaselineTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BenchmarkReferenceTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CefExternalSecuritySolutionTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CefSolutionPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CloudOfferingTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancePropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceSegmentTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancesGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancesListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectableResourceTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectedResourceTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectedWorkspaceTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionFromIpNotAllowedTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionStringsInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionToIpNotAllowedTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorSettingInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorSettingListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsDeleteWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ContainerRegistryVulnerabilityPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAwsOfferingNativeCloudConnectionTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAwsOfferingTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAzureDevOpsOfferingTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGcpOfferingNativeCloudConnectionTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGcpOfferingTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGitLabOfferingTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGithubOfferingTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAlertRuleTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationRequestPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationRequestTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsDeleteByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentRequestPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentRequestTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsCreateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsDeleteByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsGetByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListByResourceGroupMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListResultTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CveTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CvssTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DataExportSettingPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DataExportSettingsTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingDataSensitivityDiscoveryTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingDatabasesDspmTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingVmScannersConfigurationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingVmScannersTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmGcpOfferingTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfigurationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingArcAutoProvisioningTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingDatabasesDspmTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingRdsTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingCloudWatchToKinesisTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTaskTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKinesisToS3Tests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKubernetesScubaReaderTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKubernetesServiceTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnectionTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingNativeCloudConnectionTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingArcAutoProvisioningConfigurationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingArcAutoProvisioningTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioningTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsAzureDevOpsOfferingTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsGitLabOfferingTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsGithubOfferingTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingArcAutoProvisioningConfigurationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingArcAutoProvisioningTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingDefenderForServersTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingMdeAutoProvisioningTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingSubPlanTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVaAutoProvisioningConfigurationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVaAutoProvisioningTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVmScannersConfigurationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVmScannersTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingArcAutoProvisioningConfigurationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingArcAutoProvisioningTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingDefenderForServersTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingMdeAutoProvisioningTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingSubPlanTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVaAutoProvisioningConfigurationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVaAutoProvisioningTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVmScannersConfigurationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVmScannersTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DenylistCustomAlertRuleTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsDeleteByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DirectMethodInvokesNotInAllowedRangeTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListByHomeRegionMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EffectiveNetworkSecurityGroupsTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EnvironmentDataTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EnvironmentDetailsTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EtagTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExecuteGovernanceRuleParamsTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListByHomeRegionMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/FailedLocalLoginsNotInAllowedRangeTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/FileUploadsNotInAllowedRangeTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataMemberTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataOrganizationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpProjectDetailsTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpProjectEnvironmentDataTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GithubScopeEnvironmentDataTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitlabScopeEnvironmentDataTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentAdditionalDataTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsDeleteWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceEmailNotificationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleEmailNotificationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleMetadataTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleOwnerSourceTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulePropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesDeleteMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationResultsWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HealthDataClassificationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HealthReportsListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpC2DMessagesNotInAllowedRangeTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpC2DRejectedMessagesNotInAllowedRangeTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpD2CMessagesNotInAllowedRangeTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IdentityTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionAwsOfferingInformationProtectionTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionAwsOfferingTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionKeywordTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPolicyListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionConnectionStringTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsCreateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertPropertiesTopDevicesListItemTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAlertedDeviceTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityDeviceAlertTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityDeviceRecommendationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelListInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItemTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionModelInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionsListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSeverityMetricsTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsDismissWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsDeleteByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsGetByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsListByResourceGroupMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesInitiateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByRegionMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupAndRegionMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiatePortTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiateRequestTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiateVirtualMachineTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyVirtualMachineTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPortRuleTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestPortTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestVirtualMachineTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/KindAutoGeneratedTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ListCustomAlertRuleTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocalUserNotAllowedTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LogAnalyticsIdentifierTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataListInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttC2DMessagesNotInAllowedRangeTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttC2DRejectedMessagesNotInAllowedRangeTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttD2CMessagesNotInAllowedRangeTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OnPremiseResourceDetailsTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OnPremiseSqlResourceDetailsTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationDisplayTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationResultAutoGeneratedInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PathRecommendationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingListInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsListWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsUpdateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProcessNotAllowedTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProtectionModeTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProxyServerPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PublisherInfoTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/QueryCheckTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/QueuePurgesNotInAllowedRangeTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RecommendationConfigurationPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RemediationEtaTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RemediationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceDetailsAutoGeneratedTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceDetailsTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceIdentifierTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsInputTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RulesResultsInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RulesResultsInputTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultsInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScansInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScopeElementTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScoreDetailsTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionItemInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionItemPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionSourceTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListBySubscriptionMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDetailsInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlScoreDetailsInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreItemInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreItemPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentMetadataPropertiesResponsePublishDatesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentMetadataResponseListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsDeleteWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesAlertNotificationsTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesNotificationsByRoleTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsCreateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsDeleteWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorListInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsDeleteByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsListWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDatasListByHomeRegionWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDatasListWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySubAssessmentListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskParametersTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SensitivityLabelTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsDeleteMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsListByExtendedResourceWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsListInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsUpdateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListByExtendedResourceMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwarePropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwaresListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlServerVulnerabilityPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesDeleteWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesListWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsListWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansListWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SuppressionAlertsScopeTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TagsResourceTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TagsTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksGetResourceGroupLevelTaskWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksGetSubscriptionLevelTaskWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListByHomeRegionMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListByResourceGroupMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksUpdateResourceGroupLevelTaskStateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksUpdateSubscriptionLevelTaskStateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ThresholdCustomAlertRuleTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TimeWindowCustomAlertRuleTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesListByHomeRegionMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyResourceInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyResourcePropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceChildTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceParentTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TrackedResourceTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TwinUpdatesNotInAllowedRangeTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UnauthorizedOperationsNotInAllowedRangeTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UpdateIoTSecuritySolutionPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UpdateIotSecuritySolutionDataTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UserDefinedResourcesPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UserRecommendationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VaRuleTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VendorReferenceTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VmRecommendationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingPropertiesTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsCreateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsDeleteWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListMockTests.java diff --git a/sdk/security/azure-resourcemanager-security/CHANGELOG.md b/sdk/security/azure-resourcemanager-security/CHANGELOG.md index bd1644944ed7..ebcc431de0f5 100644 --- a/sdk/security/azure-resourcemanager-security/CHANGELOG.md +++ b/sdk/security/azure-resourcemanager-security/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.6 (Unreleased) +## 1.0.0-beta.1 (2023-10-23) + +- Azure Resource Manager Security client library for Java. This package contains Microsoft Azure SDK for Security Management SDK. API spec for Microsoft.Security (Azure Security Center) resource provider. Package tag package-composite-v3. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/security/azure-resourcemanager-security/README.md b/sdk/security/azure-resourcemanager-security/README.md index 960b33cd33f3..53cd81088b64 100644 --- a/sdk/security/azure-resourcemanager-security/README.md +++ b/sdk/security/azure-resourcemanager-security/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-security - 1.0.0-beta.5 + 1.0.0-beta.6 ``` [//]: # ({x-version-update-end}) @@ -45,7 +45,7 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. +By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. @@ -94,7 +94,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS [docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[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_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty @@ -103,3 +103,5 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fsecurity%2Fazure-resourcemanager-security%2FREADME.png) diff --git a/sdk/security/azure-resourcemanager-security/SAMPLE.md b/sdk/security/azure-resourcemanager-security/SAMPLE.md index 3972495626d9..d25840838854 100644 --- a/sdk/security/azure-resourcemanager-security/SAMPLE.md +++ b/sdk/security/azure-resourcemanager-security/SAMPLE.md @@ -50,18 +50,14 @@ - [List](#allowedconnections_list) - [ListByHomeRegion](#allowedconnections_listbyhomeregion) -## ApiCollection +## ApiCollections -- [Get](#apicollection_get) -- [List](#apicollection_list) - -## ApiCollectionOffboarding - -- [Delete](#apicollectionoffboarding_delete) - -## ApiCollectionOnboarding - -- [Create](#apicollectiononboarding_create) +- [GetByAzureApiManagementService](#apicollections_getbyazureapimanagementservice) +- [List](#apicollections_list) +- [ListByAzureApiManagementService](#apicollections_listbyazureapimanagementservice) +- [ListByResourceGroup](#apicollections_listbyresourcegroup) +- [OffboardAzureApiManagementApi](#apicollections_offboardazureapimanagementapi) +- [OnboardAzureApiManagementApi](#apicollections_onboardazureapimanagementapi) ## ApplicationOperation @@ -104,6 +100,28 @@ - [ListByResourceGroup](#automations_listbyresourcegroup) - [Validate](#automations_validate) +## AzureDevOpsOrgs + +- [CreateOrUpdate](#azuredevopsorgs_createorupdate) +- [Get](#azuredevopsorgs_get) +- [List](#azuredevopsorgs_list) +- [ListAvailable](#azuredevopsorgs_listavailable) +- [Update](#azuredevopsorgs_update) + +## AzureDevOpsProjects + +- [CreateOrUpdate](#azuredevopsprojects_createorupdate) +- [Get](#azuredevopsprojects_get) +- [List](#azuredevopsprojects_list) +- [Update](#azuredevopsprojects_update) + +## AzureDevOpsRepos + +- [CreateOrUpdate](#azuredevopsrepos_createorupdate) +- [Get](#azuredevopsrepos_get) +- [List](#azuredevopsrepos_list) +- [Update](#azuredevopsrepos_update) + ## ComplianceResults - [Get](#complianceresults_get) @@ -137,6 +155,23 @@ - [List](#customentitystoreassignments_list) - [ListByResourceGroup](#customentitystoreassignments_listbyresourcegroup) +## DefenderForStorage + +- [Create](#defenderforstorage_create) +- [Get](#defenderforstorage_get) + +## DevOpsConfigurations + +- [CreateOrUpdate](#devopsconfigurations_createorupdate) +- [Delete](#devopsconfigurations_delete) +- [Get](#devopsconfigurations_get) +- [List](#devopsconfigurations_list) +- [Update](#devopsconfigurations_update) + +## DevOpsOperationResults + +- [Get](#devopsoperationresults_get) + ## DeviceSecurityGroups - [CreateOrUpdate](#devicesecuritygroups_createorupdate) @@ -156,6 +191,32 @@ - [List](#externalsecuritysolutions_list) - [ListByHomeRegion](#externalsecuritysolutions_listbyhomeregion) +## GitHubOwners + +- [Get](#githubowners_get) +- [List](#githubowners_list) +- [ListAvailable](#githubowners_listavailable) + +## GitHubRepos + +- [Get](#githubrepos_get) +- [List](#githubrepos_list) + +## GitLabGroups + +- [Get](#gitlabgroups_get) +- [List](#gitlabgroups_list) +- [ListAvailable](#gitlabgroups_listavailable) + +## GitLabProjects + +- [Get](#gitlabprojects_get) +- [List](#gitlabprojects_list) + +## GitLabSubgroups + +- [List](#gitlabsubgroups_list) + ## GovernanceAssignments - [CreateOrUpdate](#governanceassignments_createorupdate) @@ -172,12 +233,9 @@ - [List](#governancerules_list) - [OperationResults](#governancerules_operationresults) -## HealthReportOperation - -- [Get](#healthreportoperation_get) - ## HealthReports +- [Get](#healthreports_get) - [List](#healthreports_list) ## InformationProtectionPolicies @@ -186,15 +244,6 @@ - [Get](#informationprotectionpolicies_get) - [List](#informationprotectionpolicies_list) -## IngestionSettings - -- [Create](#ingestionsettings_create) -- [Delete](#ingestionsettings_delete) -- [Get](#ingestionsettings_get) -- [List](#ingestionsettings_list) -- [ListConnectionStrings](#ingestionsettings_listconnectionstrings) -- [ListTokens](#ingestionsettings_listtokens) - ## IotSecuritySolution - [CreateOrUpdate](#iotsecuritysolution_createorupdate) @@ -262,6 +311,11 @@ - [Get](#regulatorycompliancestandards_get) - [List](#regulatorycompliancestandards_list) +## ResourceProvider + +- [GetSensitivitySettings](#resourceprovider_getsensitivitysettings) +- [UpdateSensitivitySettings](#resourceprovider_updatesensitivitysettings) + ## SecureScoreControlDefinitions - [List](#securescorecontroldefinitions_list) @@ -320,6 +374,10 @@ - [List](#securitysolutionsreferencedata_list) - [ListByHomeRegion](#securitysolutionsreferencedata_listbyhomeregion) +## SensitivitySettings + +- [List](#sensitivitysettings_list) + ## ServerVulnerabilityAssessment - [CreateOrUpdate](#servervulnerabilityassessment_createorupdate) @@ -327,6 +385,13 @@ - [Get](#servervulnerabilityassessment_get) - [ListByExtendedResource](#servervulnerabilityassessment_listbyextendedresource) +## ServerVulnerabilityAssessmentsSettings + +- [CreateOrUpdate](#servervulnerabilityassessmentssettings_createorupdate) +- [Delete](#servervulnerabilityassessmentssettings_delete) +- [Get](#servervulnerabilityassessmentssettings_get) +- [List](#servervulnerabilityassessmentssettings_list) + ## Settings - [Get](#settings_get) @@ -1239,6 +1304,7 @@ public final class AlertsSuppressionRulesUpdateSamples { com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1315,86 +1381,134 @@ public final class AllowedConnectionsListByHomeRegionSamples { } ``` -### ApiCollection_Get +### ApiCollections_GetByAzureApiManagementService ```java -/** Samples for ApiCollection Get. */ -public final class ApiCollectionGetSamples { +/** Samples for ApiCollections GetByAzureApiManagementService. */ +public final class ApiCollectionsGetByAzureApiManagementServiceSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-11-20-preview/examples/ApiCollections/APICollection_Get_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/APICollections_GetByAzureApiManagementService_example.json */ /** - * Sample code: Gets an Azure API Management API if it has been onboarded to Defender for APIs. + * Sample code: Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. * * @param manager Entry point to SecurityManager. */ - public static void getsAnAzureAPIManagementAPIIfItHasBeenOnboardedToDefenderForAPIs( + public static void getsAnAzureAPIManagementAPIIfItHasBeenOnboardedToMicrosoftDefenderForAPIs( com.azure.resourcemanager.security.SecurityManager manager) { - manager.apiCollections().getWithResponse("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); + manager + .apiCollections() + .getByAzureApiManagementServiceWithResponse( + "rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); } } ``` -### ApiCollection_List +### ApiCollections_List ```java -/** Samples for ApiCollection List. */ -public final class ApiCollectionListSamples { +/** Samples for ApiCollections List. */ +public final class ApiCollectionsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-11-20-preview/examples/ApiCollections/APICollection_List_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/APICollections_ListBySubscription_example.json */ /** - * Sample code: Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. + * Sample code: Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender + * for APIs. * * @param manager Entry point to SecurityManager. */ - public static void getsAListOfAzureAPIManagementAPIsThatHaveBeenOnboardedToDefenderForAPIs( + public static void getsAListOfAPICollectionsWithinASubscriptionThatHaveBeenOnboardedToMicrosoftDefenderForAPIs( com.azure.resourcemanager.security.SecurityManager manager) { - manager.apiCollections().list("rg1", "apimService1", com.azure.core.util.Context.NONE); + manager.apiCollections().list(com.azure.core.util.Context.NONE); } } ``` -### ApiCollectionOffboarding_Delete +### ApiCollections_ListByAzureApiManagementService ```java -/** Samples for ApiCollectionOffboarding Delete. */ -public final class ApiCollectionOffboardingDeleteSamples { +/** Samples for ApiCollections ListByAzureApiManagementService. */ +public final class ApiCollectionsListByAzureApiManagementServiceSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-11-20-preview/examples/ApiCollections/APICollectionOffboarding_Delete_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/APICollections_ListByAzureApiManagementService_example.json */ /** - * Sample code: Delete a security recommendation task on a resource. + * Sample code: Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. * * @param manager Entry point to SecurityManager. */ - public static void deleteASecurityRecommendationTaskOnAResource( + public static void getsAListOfAzureAPIManagementAPIsThatHaveBeenOnboardedToMicrosoftDefenderForAPIs( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .apiCollections() + .listByAzureApiManagementService("rg1", "apimService1", com.azure.core.util.Context.NONE); + } +} +``` + +### ApiCollections_ListByResourceGroup + +```java +/** Samples for ApiCollections ListByResourceGroup. */ +public final class ApiCollectionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/APICollections_ListByResourceGroup_example.json + */ + /** + * Sample code: Gets a list of API collections within a resource group that have been onboarded to Microsoft + * Defender for APIs. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsAListOfAPICollectionsWithinAResourceGroupThatHaveBeenOnboardedToMicrosoftDefenderForAPIs( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.apiCollections().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### ApiCollections_OffboardAzureApiManagementApi + +```java +/** Samples for ApiCollections OffboardAzureApiManagementApi. */ +public final class ApiCollectionsOffboardAzureApiManagementApiSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/APICollections_OffboardAzureApiManagementApi_example.json + */ + /** + * Sample code: Offboard an Azure API Management API from Microsoft Defender for APIs. + * + * @param manager Entry point to SecurityManager. + */ + public static void offboardAnAzureAPIManagementAPIFromMicrosoftDefenderForAPIs( com.azure.resourcemanager.security.SecurityManager manager) { manager - .apiCollectionOffboardings() - .deleteWithResponse("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); + .apiCollections() + .offboardAzureApiManagementApiWithResponse( + "rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); } } ``` -### ApiCollectionOnboarding_Create +### ApiCollections_OnboardAzureApiManagementApi ```java -/** Samples for ApiCollectionOnboarding Create. */ -public final class ApiCollectionOnboardingCreateSamples { +/** Samples for ApiCollections OnboardAzureApiManagementApi. */ +public final class ApiCollectionsOnboardAzureApiManagementApiSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-11-20-preview/examples/ApiCollections/APICollectionOnboarding_Create_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/APICollections_OnboardAzureApiManagementApi_example.json */ /** - * Sample code: Onboard an Azure API Management API to Defender for APIs. + * Sample code: Onboard an Azure API Management API to Microsoft Defender for APIs. * * @param manager Entry point to SecurityManager. */ - public static void onboardAnAzureAPIManagementAPIToDefenderForAPIs( + public static void onboardAnAzureAPIManagementAPIToMicrosoftDefenderForAPIs( com.azure.resourcemanager.security.SecurityManager manager) { manager - .apiCollectionOnboardings() - .createWithResponse("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); + .apiCollections() + .onboardAzureApiManagementApi("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); } } ``` @@ -2009,6 +2123,7 @@ public final class AutomationsCreateOrUpdateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -2182,6 +2297,7 @@ public final class AutomationsValidateSamples { com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -2195,722 +2311,1614 @@ public final class AutomationsValidateSamples { } ``` -### ComplianceResults_Get +### AzureDevOpsOrgs_CreateOrUpdate ```java -/** Samples for ComplianceResults Get. */ -public final class ComplianceResultsGetSamples { +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsOrgProperties; +import com.azure.resourcemanager.security.models.OnboardingState; + +/** Samples for AzureDevOpsOrgs CreateOrUpdate. */ +public final class AzureDevOpsOrgsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2017-08-01/examples/ComplianceResults/GetComplianceResults_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/CreateOrUpdateAzureDevOpsOrgs_example.json */ /** - * Sample code: Get compliance results on subscription. + * Sample code: CreateOrUpdate_AzureDevOpsOrgs. * * @param manager Entry point to SecurityManager. */ - public static void getComplianceResultsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + public static void createOrUpdateAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { manager - .complianceResults() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "DesignateMoreThanOneOwner", - com.azure.core.util.Context.NONE); + .azureDevOpsOrgs() + .define("myAzDevOpsOrg") + .withExistingSecurityConnector("myRg", "mySecurityConnectorName") + .withProperties( + new AzureDevOpsOrgProperties() + .withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation( + new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) + .create(); } } ``` -### ComplianceResults_List +### AzureDevOpsOrgs_Get ```java -/** Samples for ComplianceResults List. */ -public final class ComplianceResultsListSamples { +/** Samples for AzureDevOpsOrgs Get. */ +public final class AzureDevOpsOrgsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2017-08-01/examples/ComplianceResults/ListComplianceResults_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetAzureDevOpsOrgs_example.json */ /** - * Sample code: Get compliance results on subscription. + * Sample code: Get_AzureDevOpsOrgs. * * @param manager Entry point to SecurityManager. */ - public static void getComplianceResultsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + public static void getAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { manager - .complianceResults() - .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + .azureDevOpsOrgs() + .getWithResponse("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", com.azure.core.util.Context.NONE); } } ``` -### Compliances_Get +### AzureDevOpsOrgs_List ```java -/** Samples for Compliances Get. */ -public final class CompliancesGetSamples { +/** Samples for AzureDevOpsOrgs List. */ +public final class AzureDevOpsOrgsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Compliances/GetCompliance_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListAzureDevOpsOrgs_example.json */ /** - * Sample code: Get security compliance data for a day. + * Sample code: List_AzureDevOpsOrgs. * * @param manager Entry point to SecurityManager. */ - public static void getSecurityComplianceDataForADay(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .compliances() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "2018-01-01Z", com.azure.core.util.Context.NONE); + public static void listAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsOrgs().list("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); } } ``` -### Compliances_List +### AzureDevOpsOrgs_ListAvailable ```java -/** Samples for Compliances List. */ -public final class CompliancesListSamples { +/** Samples for AzureDevOpsOrgs ListAvailable. */ +public final class AzureDevOpsOrgsListAvailableSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Compliances/GetCompliances_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListAvailableAzureDevOpsOrgs_example.json */ /** - * Sample code: Get security compliance data over time. + * Sample code: ListAvailable_AzureDevOpsOrgs. * * @param manager Entry point to SecurityManager. */ - public static void getSecurityComplianceDataOverTime(com.azure.resourcemanager.security.SecurityManager manager) { + public static void listAvailableAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { manager - .compliances() - .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + .azureDevOpsOrgs() + .listAvailableWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); } } ``` -### Connectors_CreateOrUpdate +### AzureDevOpsOrgs_Update ```java -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.AwAssumeRoleAuthenticationDetailsProperties; -import com.azure.resourcemanager.security.models.AwsCredsAuthenticationDetailsProperties; -import com.azure.resourcemanager.security.models.GcpCredentialsDetailsProperties; -import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties; -import com.azure.resourcemanager.security.models.ProxyServerProperties; -import com.azure.resourcemanager.security.models.ServicePrincipalProperties; +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsOrg; +import com.azure.resourcemanager.security.models.AzureDevOpsOrgProperties; +import com.azure.resourcemanager.security.models.OnboardingState; -/** Samples for Connectors CreateOrUpdate. */ -public final class ConnectorsCreateOrUpdateSamples { +/** Samples for AzureDevOpsOrgs Update. */ +public final class AzureDevOpsOrgsUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateGcpCredentialsConnectorSubscription_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/UpdateAzureDevOpsOrgs_example.json */ /** - * Sample code: gcpCredentials - Create a cloud account connector for a subscription. + * Sample code: Update_AzureDevOpsOrgs. * * @param manager Entry point to SecurityManager. */ - public static void gcpCredentialsCreateACloudAccountConnectorForASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .connectors() - .define("gcp_dev") - .withHybridComputeSettings(new HybridComputeSettingsProperties().withAutoProvision(AutoProvision.OFF)) - .withAuthenticationDetails( - new GcpCredentialsDetailsProperties() - .withOrganizationId("AscDemoOrg") - .withType("service_account") - .withProjectId("asc-project-1234") - .withPrivateKeyId("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder") - .withClientEmail("asc-135@asc-project-1234.iam.gserviceaccount.com") - .withClientId("105889053725632919854") - .withAuthUri("https://accounts.google.com/o/oauth2/auth") - .withTokenUri("fakeTokenPlaceholder") - .withAuthProviderX509CertUrl("https://www.googleapis.com/oauth2/v1/certs") - .withClientX509CertUrl( - "https://www.googleapis.com/robot/v1/metadata/x509/asc-135%40asc-project-1234.iam.gserviceaccount.com")) - .create(); + public static void updateAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { + AzureDevOpsOrg resource = + manager + .azureDevOpsOrgs() + .getWithResponse("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new AzureDevOpsOrgProperties() + .withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation( + new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) + .apply(); } +} +``` - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateAwsCredConnectorSubscription_example.json - */ - /** - * Sample code: AwsCred - Create a cloud account connector for a subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void awsCredCreateACloudAccountConnectorForASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .connectors() - .define("aws_dev1") - .withHybridComputeSettings( - new HybridComputeSettingsProperties() - .withAutoProvision(AutoProvision.ON) - .withResourceGroupName("AwsConnectorRG") - .withRegion("West US 2") - .withProxyServer(new ProxyServerProperties().withIp("167.220.197.140").withPort("34")) - .withServicePrincipal( - new ServicePrincipalProperties() - .withApplicationId("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1") - .withSecret("fakeTokenPlaceholder"))) - .withAuthenticationDetails( - new AwsCredsAuthenticationDetailsProperties() - .withAwsAccessKeyId("fakeTokenPlaceholder") - .withAwsSecretAccessKey("fakeTokenPlaceholder")) - .create(); - } +### AzureDevOpsProjects_CreateOrUpdate + +```java +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsProjectProperties; +import com.azure.resourcemanager.security.models.OnboardingState; +/** Samples for AzureDevOpsProjects CreateOrUpdate. */ +public final class AzureDevOpsProjectsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateAwsAssumeRoleConnectorSubscription_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/CreateOrUpdateAzureDevOpsProjects_example.json */ /** - * Sample code: AwsAssumeRole - Create a cloud account connector for a subscription. + * Sample code: CreateOrUpdate_AzureDevOpsProjects. * * @param manager Entry point to SecurityManager. */ - public static void awsAssumeRoleCreateACloudAccountConnectorForASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void createOrUpdateAzureDevOpsProjects(com.azure.resourcemanager.security.SecurityManager manager) { manager - .connectors() - .define("aws_dev2") - .withHybridComputeSettings( - new HybridComputeSettingsProperties() - .withAutoProvision(AutoProvision.ON) - .withResourceGroupName("AwsConnectorRG") - .withRegion("West US 2") - .withProxyServer(new ProxyServerProperties().withIp("167.220.197.140").withPort("34")) - .withServicePrincipal( - new ServicePrincipalProperties() - .withApplicationId("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1") - .withSecret("fakeTokenPlaceholder"))) - .withAuthenticationDetails( - new AwAssumeRoleAuthenticationDetailsProperties() - .withAwsAssumeRoleArn("arn:aws:iam::81231569658:role/AscConnector") - .withAwsExternalId("20ff7fc3-e762-44dd-bd96-b71116dcdc23")) + .azureDevOpsProjects() + .define("myAzDevOpsProject") + .withExistingAzureDevOpsOrg("myRg", "mySecurityConnectorName", "myAzDevOpsOrg") + .withProperties( + new AzureDevOpsProjectProperties() + .withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation( + new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) .create(); } } ``` -### Connectors_Delete +### AzureDevOpsProjects_Get ```java -/** Samples for Connectors Delete. */ -public final class ConnectorsDeleteSamples { +/** Samples for AzureDevOpsProjects Get. */ +public final class AzureDevOpsProjectsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/DeleteConnectorSubscription_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetAzureDevOpsProjects_example.json */ /** - * Sample code: Delete a cloud account connector from a subscription. + * Sample code: Get_AzureDevOpsProjects. * * @param manager Entry point to SecurityManager. */ - public static void deleteACloudAccountConnectorFromASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors().deleteWithResponse("aws_dev1", com.azure.core.util.Context.NONE); + public static void getAzureDevOpsProjects(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .azureDevOpsProjects() + .getWithResponse( + "myRg", + "mySecurityConnectorName", + "myAzDevOpsOrg", + "myAzDevOpsProject", + com.azure.core.util.Context.NONE); } } ``` -### Connectors_Get +### AzureDevOpsProjects_List ```java -/** Samples for Connectors Get. */ -public final class ConnectorsGetSamples { +/** Samples for AzureDevOpsProjects List. */ +public final class AzureDevOpsProjectsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/GetConnectorSubscription_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListAzureDevOpsProjects_example.json */ /** - * Sample code: Details of a specific cloud account connector. + * Sample code: List_AzureDevOpsProjects. * * @param manager Entry point to SecurityManager. */ - public static void detailsOfASpecificCloudAccountConnector( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors().getWithResponse("aws_dev1", com.azure.core.util.Context.NONE); + public static void listAzureDevOpsProjects(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .azureDevOpsProjects() + .list("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", com.azure.core.util.Context.NONE); } } ``` -### Connectors_List +### AzureDevOpsProjects_Update ```java -/** Samples for Connectors List. */ -public final class ConnectorsListSamples { +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsProject; +import com.azure.resourcemanager.security.models.AzureDevOpsProjectProperties; +import com.azure.resourcemanager.security.models.OnboardingState; + +/** Samples for AzureDevOpsProjects Update. */ +public final class AzureDevOpsProjectsUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/GetListConnectorSubscription_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/UpdateAzureDevOpsProjects_example.json */ /** - * Sample code: Get all cloud accounts connectors of a subscription. + * Sample code: Update_AzureDevOpsProjects. * * @param manager Entry point to SecurityManager. */ - public static void getAllCloudAccountsConnectorsOfASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors().list(com.azure.core.util.Context.NONE); + public static void updateAzureDevOpsProjects(com.azure.resourcemanager.security.SecurityManager manager) { + AzureDevOpsProject resource = + manager + .azureDevOpsProjects() + .getWithResponse( + "myRg", + "mySecurityConnectorName", + "myAzDevOpsOrg", + "myAzDevOpsProject", + com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new AzureDevOpsProjectProperties() + .withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation( + new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) + .apply(); } } ``` -### CustomAssessmentAutomations_Create +### AzureDevOpsRepos_CreateOrUpdate ```java -import com.azure.resourcemanager.security.models.SeverityEnum; -import com.azure.resourcemanager.security.models.SupportedCloudEnum; +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsRepositoryProperties; +import com.azure.resourcemanager.security.models.OnboardingState; -/** Samples for CustomAssessmentAutomations Create. */ -public final class CustomAssessmentAutomationsCreateSamples { +/** Samples for AzureDevOpsRepos CreateOrUpdate. */ +public final class AzureDevOpsReposCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationCreate_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/CreateOrUpdateAzureDevOpsRepos_example.json */ /** - * Sample code: Create a Custom Assessment Automation. + * Sample code: CreateOrUpdate_AzureDevOpsRepos. * * @param manager Entry point to SecurityManager. */ - public static void createACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { + public static void createOrUpdateAzureDevOpsRepos(com.azure.resourcemanager.security.SecurityManager manager) { manager - .customAssessmentAutomations() - .define("MyCustomAssessmentAutomation") - .withExistingResourceGroup("TestResourceGroup") - .withCompressedQuery( - "DQAKAEkAYQBtAF8ARwByAG8AdQBwAA0ACgB8ACAAZQB4AHQAZQBuAGQAIABIAGUAYQBsAHQAaABTAHQAYQB0AHUAcwAgAD0AIABpAGYAZgAoAHQAbwBzAHQAcgBpAG4AZwAoAFIAZQBjAG8AcgBkAC4AVQBzAGUAcgBOAGEAbQBlACkAIABjAG8AbgB0AGEAaQBuAHMAIAAnAHUAcwBlAHIAJwAsACAAJwBVAE4ASABFAEEATABUAEgAWQAnACwAIAAnAEgARQBBAEwAVABIAFkAJwApAA0ACgA=") - .withSupportedCloud(SupportedCloudEnum.AWS) - .withSeverity(SeverityEnum.MEDIUM) - .withDisplayName("Password Policy") - .withDescription("Data should be encrypted") - .withRemediationDescription("Encrypt store by...") + .azureDevOpsRepos() + .define("myAzDevOpsRepo") + .withExistingProject("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject") + .withProperties( + new AzureDevOpsRepositoryProperties() + .withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation( + new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) .create(); } } ``` -### CustomAssessmentAutomations_Delete +### AzureDevOpsRepos_Get ```java -/** Samples for CustomAssessmentAutomations Delete. */ -public final class CustomAssessmentAutomationsDeleteSamples { +/** Samples for AzureDevOpsRepos Get. */ +public final class AzureDevOpsReposGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationDelete_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetAzureDevOpsRepos_example.json */ /** - * Sample code: Delete a Custom Assessment Automation. + * Sample code: Get_AzureDevOpsRepos. * * @param manager Entry point to SecurityManager. */ - public static void deleteACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { + public static void getAzureDevOpsRepos(com.azure.resourcemanager.security.SecurityManager manager) { manager - .customAssessmentAutomations() + .azureDevOpsRepos() + .getWithResponse( + "myRg", + "mySecurityConnectorName", + "myAzDevOpsOrg", + "myAzDevOpsProject", + "myAzDevOpsRepo", + com.azure.core.util.Context.NONE); + } +} +``` + +### AzureDevOpsRepos_List + +```java +/** Samples for AzureDevOpsRepos List. */ +public final class AzureDevOpsReposListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListAzureDevOpsRepos_example.json + */ + /** + * Sample code: List_AzureDevOpsRepos. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAzureDevOpsRepos(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .azureDevOpsRepos() + .list( + "myRg", + "mySecurityConnectorName", + "myAzDevOpsOrg", + "myAzDevOpsProject", + com.azure.core.util.Context.NONE); + } +} +``` + +### AzureDevOpsRepos_Update + +```java +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsRepository; +import com.azure.resourcemanager.security.models.AzureDevOpsRepositoryProperties; +import com.azure.resourcemanager.security.models.OnboardingState; + +/** Samples for AzureDevOpsRepos Update. */ +public final class AzureDevOpsReposUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/UpdateAzureDevOpsRepos_example.json + */ + /** + * Sample code: Update_AzureDevOpsRepos. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateAzureDevOpsRepos(com.azure.resourcemanager.security.SecurityManager manager) { + AzureDevOpsRepository resource = + manager + .azureDevOpsRepos() + .getWithResponse( + "myRg", + "mySecurityConnectorName", + "myAzDevOpsOrg", + "myAzDevOpsProject", + "myAzDevOpsRepo", + com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new AzureDevOpsRepositoryProperties() + .withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation( + new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) + .apply(); + } +} +``` + +### ComplianceResults_Get + +```java +/** Samples for ComplianceResults Get. */ +public final class ComplianceResultsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2017-08-01/examples/ComplianceResults/GetComplianceResults_example.json + */ + /** + * Sample code: Get compliance results on subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getComplianceResultsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .complianceResults() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "DesignateMoreThanOneOwner", + com.azure.core.util.Context.NONE); + } +} +``` + +### ComplianceResults_List + +```java +/** Samples for ComplianceResults List. */ +public final class ComplianceResultsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2017-08-01/examples/ComplianceResults/ListComplianceResults_example.json + */ + /** + * Sample code: Get compliance results on subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getComplianceResultsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .complianceResults() + .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + } +} +``` + +### Compliances_Get + +```java +/** Samples for Compliances Get. */ +public final class CompliancesGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Compliances/GetCompliance_example.json + */ + /** + * Sample code: Get security compliance data for a day. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityComplianceDataForADay(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .compliances() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "2018-01-01Z", com.azure.core.util.Context.NONE); + } +} +``` + +### Compliances_List + +```java +/** Samples for Compliances List. */ +public final class CompliancesListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Compliances/GetCompliances_example.json + */ + /** + * Sample code: Get security compliance data over time. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityComplianceDataOverTime(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .compliances() + .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + } +} +``` + +### Connectors_CreateOrUpdate + +```java +import com.azure.resourcemanager.security.models.AutoProvision; +import com.azure.resourcemanager.security.models.AwAssumeRoleAuthenticationDetailsProperties; +import com.azure.resourcemanager.security.models.AwsCredsAuthenticationDetailsProperties; +import com.azure.resourcemanager.security.models.GcpCredentialsDetailsProperties; +import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties; +import com.azure.resourcemanager.security.models.ProxyServerProperties; +import com.azure.resourcemanager.security.models.ServicePrincipalProperties; + +/** Samples for Connectors CreateOrUpdate. */ +public final class ConnectorsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateGcpCredentialsConnectorSubscription_example.json + */ + /** + * Sample code: gcpCredentials - Create a cloud account connector for a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void gcpCredentialsCreateACloudAccountConnectorForASubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .connectors() + .define("gcp_dev") + .withHybridComputeSettings(new HybridComputeSettingsProperties().withAutoProvision(AutoProvision.OFF)) + .withAuthenticationDetails( + new GcpCredentialsDetailsProperties() + .withOrganizationId("AscDemoOrg") + .withType("service_account") + .withProjectId("asc-project-1234") + .withPrivateKeyId("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder") + .withClientEmail("asc-135@asc-project-1234.iam.gserviceaccount.com") + .withClientId("105889053725632919854") + .withAuthUri("https://accounts.google.com/o/oauth2/auth") + .withTokenUri("fakeTokenPlaceholder") + .withAuthProviderX509CertUrl("https://www.googleapis.com/oauth2/v1/certs") + .withClientX509CertUrl( + "https://www.googleapis.com/robot/v1/metadata/x509/asc-135%40asc-project-1234.iam.gserviceaccount.com")) + .create(); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateAwsCredConnectorSubscription_example.json + */ + /** + * Sample code: AwsCred - Create a cloud account connector for a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void awsCredCreateACloudAccountConnectorForASubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .connectors() + .define("aws_dev1") + .withHybridComputeSettings( + new HybridComputeSettingsProperties() + .withAutoProvision(AutoProvision.ON) + .withResourceGroupName("AwsConnectorRG") + .withRegion("West US 2") + .withProxyServer(new ProxyServerProperties().withIp("167.220.197.140").withPort("34")) + .withServicePrincipal( + new ServicePrincipalProperties() + .withApplicationId("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1") + .withSecret("fakeTokenPlaceholder"))) + .withAuthenticationDetails( + new AwsCredsAuthenticationDetailsProperties() + .withAwsAccessKeyId("fakeTokenPlaceholder") + .withAwsSecretAccessKey("fakeTokenPlaceholder")) + .create(); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateAwsAssumeRoleConnectorSubscription_example.json + */ + /** + * Sample code: AwsAssumeRole - Create a cloud account connector for a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void awsAssumeRoleCreateACloudAccountConnectorForASubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .connectors() + .define("aws_dev2") + .withHybridComputeSettings( + new HybridComputeSettingsProperties() + .withAutoProvision(AutoProvision.ON) + .withResourceGroupName("AwsConnectorRG") + .withRegion("West US 2") + .withProxyServer(new ProxyServerProperties().withIp("167.220.197.140").withPort("34")) + .withServicePrincipal( + new ServicePrincipalProperties() + .withApplicationId("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1") + .withSecret("fakeTokenPlaceholder"))) + .withAuthenticationDetails( + new AwAssumeRoleAuthenticationDetailsProperties() + .withAwsAssumeRoleArn("arn:aws:iam::81231569658:role/AscConnector") + .withAwsExternalId("20ff7fc3-e762-44dd-bd96-b71116dcdc23")) + .create(); + } +} +``` + +### Connectors_Delete + +```java +/** Samples for Connectors Delete. */ +public final class ConnectorsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/DeleteConnectorSubscription_example.json + */ + /** + * Sample code: Delete a cloud account connector from a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteACloudAccountConnectorFromASubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.connectors().deleteWithResponse("aws_dev1", com.azure.core.util.Context.NONE); + } +} +``` + +### Connectors_Get + +```java +/** Samples for Connectors Get. */ +public final class ConnectorsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/GetConnectorSubscription_example.json + */ + /** + * Sample code: Details of a specific cloud account connector. + * + * @param manager Entry point to SecurityManager. + */ + public static void detailsOfASpecificCloudAccountConnector( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.connectors().getWithResponse("aws_dev1", com.azure.core.util.Context.NONE); + } +} +``` + +### Connectors_List + +```java +/** Samples for Connectors List. */ +public final class ConnectorsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/GetListConnectorSubscription_example.json + */ + /** + * Sample code: Get all cloud accounts connectors of a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAllCloudAccountsConnectorsOfASubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.connectors().list(com.azure.core.util.Context.NONE); + } +} +``` + +### CustomAssessmentAutomations_Create + +```java +import com.azure.resourcemanager.security.models.SeverityEnum; +import com.azure.resourcemanager.security.models.SupportedCloudEnum; + +/** Samples for CustomAssessmentAutomations Create. */ +public final class CustomAssessmentAutomationsCreateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationCreate_example.json + */ + /** + * Sample code: Create a Custom Assessment Automation. + * + * @param manager Entry point to SecurityManager. + */ + public static void createACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .customAssessmentAutomations() + .define("MyCustomAssessmentAutomation") + .withExistingResourceGroup("TestResourceGroup") + .withCompressedQuery( + "DQAKAEkAYQBtAF8ARwByAG8AdQBwAA0ACgB8ACAAZQB4AHQAZQBuAGQAIABIAGUAYQBsAHQAaABTAHQAYQB0AHUAcwAgAD0AIABpAGYAZgAoAHQAbwBzAHQAcgBpAG4AZwAoAFIAZQBjAG8AcgBkAC4AVQBzAGUAcgBOAGEAbQBlACkAIABjAG8AbgB0AGEAaQBuAHMAIAAnAHUAcwBlAHIAJwAsACAAJwBVAE4ASABFAEEATABUAEgAWQAnACwAIAAnAEgARQBBAEwAVABIAFkAJwApAA0ACgA=") + .withSupportedCloud(SupportedCloudEnum.AWS) + .withSeverity(SeverityEnum.MEDIUM) + .withDisplayName("Password Policy") + .withDescription("Data should be encrypted") + .withRemediationDescription("Encrypt store by...") + .create(); + } +} +``` + +### CustomAssessmentAutomations_Delete + +```java +/** Samples for CustomAssessmentAutomations Delete. */ +public final class CustomAssessmentAutomationsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationDelete_example.json + */ + /** + * Sample code: Delete a Custom Assessment Automation. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .customAssessmentAutomations() + .deleteByResourceGroupWithResponse( + "TestResourceGroup", "MyCustomAssessmentAutomation", com.azure.core.util.Context.NONE); + } +} +``` + +### CustomAssessmentAutomations_GetByResourceGroup + +```java +/** Samples for CustomAssessmentAutomations GetByResourceGroup. */ +public final class CustomAssessmentAutomationsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationGet_example.json + */ + /** + * Sample code: Get a Custom Assessment Automation. + * + * @param manager Entry point to SecurityManager. + */ + public static void getACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .customAssessmentAutomations() + .getByResourceGroupWithResponse( + "TestResourceGroup", "MyCustomAssessmentAutomation", com.azure.core.util.Context.NONE); + } +} +``` + +### CustomAssessmentAutomations_List + +```java +/** Samples for CustomAssessmentAutomations List. */ +public final class CustomAssessmentAutomationsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationListBySubscription_example.json + */ + /** + * Sample code: List Custom Assessment Automations in a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void listCustomAssessmentAutomationsInASubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.customAssessmentAutomations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### CustomAssessmentAutomations_ListByResourceGroup + +```java +/** Samples for CustomAssessmentAutomations ListByResourceGroup. */ +public final class CustomAssessmentAutomationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationListByResourceGroup_example.json + */ + /** + * Sample code: List Custom Assessment Automations in a subscription and a resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void listCustomAssessmentAutomationsInASubscriptionAndAResourceGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .customAssessmentAutomations() + .listByResourceGroup("TestResourceGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### CustomEntityStoreAssignments_Create + +```java +/** Samples for CustomEntityStoreAssignments Create. */ +public final class CustomEntityStoreAssignmentsCreateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentCreate_example.json + */ + /** + * Sample code: Create a custom entity store assignment. + * + * @param manager Entry point to SecurityManager. + */ + public static void createACustomEntityStoreAssignment(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .customEntityStoreAssignments() + .define("33e7cc6e-a139-4723-a0e5-76993aee0771") + .withExistingResourceGroup("TestResourceGroup") + .withPrincipal("aaduser=f3923a3e-ad57-4752-b1a9-fbf3c8e5e082;72f988bf-86f1-41af-91ab-2d7cd011db47") + .create(); + } +} +``` + +### CustomEntityStoreAssignments_Delete + +```java +/** Samples for CustomEntityStoreAssignments Delete. */ +public final class CustomEntityStoreAssignmentsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentDelete_example.json + */ + /** + * Sample code: Delete a custom entity store assignment. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteACustomEntityStoreAssignment(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .customEntityStoreAssignments() .deleteByResourceGroupWithResponse( - "TestResourceGroup", "MyCustomAssessmentAutomation", com.azure.core.util.Context.NONE); + "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", com.azure.core.util.Context.NONE); + } +} +``` + +### CustomEntityStoreAssignments_GetByResourceGroup + +```java +/** Samples for CustomEntityStoreAssignments GetByResourceGroup. */ +public final class CustomEntityStoreAssignmentsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentGet_example.json + */ + /** + * Sample code: Get a custom entity store assignment. + * + * @param manager Entry point to SecurityManager. + */ + public static void getACustomEntityStoreAssignment(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .customEntityStoreAssignments() + .getByResourceGroupWithResponse( + "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", com.azure.core.util.Context.NONE); + } +} +``` + +### CustomEntityStoreAssignments_List + +```java +/** Samples for CustomEntityStoreAssignments List. */ +public final class CustomEntityStoreAssignmentsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentListBySubscription_example.json + */ + /** + * Sample code: List custom entity store assignments in a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void listCustomEntityStoreAssignmentsInASubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.customEntityStoreAssignments().list(com.azure.core.util.Context.NONE); + } +} +``` + +### CustomEntityStoreAssignments_ListByResourceGroup + +```java +/** Samples for CustomEntityStoreAssignments ListByResourceGroup. */ +public final class CustomEntityStoreAssignmentsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentListByResourceGroup_example.json + */ + /** + * Sample code: List custom entity store assignments in a subscription and a resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void listCustomEntityStoreAssignmentsInASubscriptionAndAResourceGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .customEntityStoreAssignments() + .listByResourceGroup("TestResourceGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### DefenderForStorage_Create + +```java +import com.azure.resourcemanager.security.models.SettingNameAutoGenerated; + +/** Samples for DefenderForStorage Create. */ +public final class DefenderForStorageCreateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-12-01-preview/examples/DefenderForStorage/PutDefenderForStorageSettings_example.json + */ + /** + * Sample code: Creates or updates the Defender for Storage settings on a specified resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void createsOrUpdatesTheDefenderForStorageSettingsOnASpecifiedResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .defenderForStorages() + .define(SettingNameAutoGenerated.CURRENT) + .withExistingResourceId( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount") + .withIsEnabled(true) + .withOverrideSubscriptionLevelSettings(true) + .withScanResultsEventGridTopicResourceId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.EventGrid/topics/sampletopic") + .withIsEnabledMalwareScanningIsEnabled(true) + .withCapGBPerMonth(-1) + .withIsEnabledSensitiveDataDiscoveryIsEnabled(true) + .create(); + } +} +``` + +### DefenderForStorage_Get + +```java +import com.azure.resourcemanager.security.models.SettingNameAutoGenerated; + +/** Samples for DefenderForStorage Get. */ +public final class DefenderForStorageGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-12-01-preview/examples/DefenderForStorage/GetDefenderForStorageSettings_example.json + */ + /** + * Sample code: Gets the Defender for Storage settings for the specified resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsTheDefenderForStorageSettingsForTheSpecifiedResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .defenderForStorages() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", + SettingNameAutoGenerated.CURRENT, + com.azure.core.util.Context.NONE); + } +} +``` + +### DevOpsConfigurations_CreateOrUpdate + +```java +import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; +import com.azure.resourcemanager.security.models.Authorization; +import com.azure.resourcemanager.security.models.AutoDiscovery; +import com.azure.resourcemanager.security.models.DevOpsConfigurationProperties; +import java.util.Arrays; + +/** Samples for DevOpsConfigurations CreateOrUpdate. */ +public final class DevOpsConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/CreateOrUpdateDevOpsConfigurationsOnboardCurrentAndFuture_example.json + */ + /** + * Sample code: CreateOrUpdate_DevOpsConfigurations_OnboardCurrentAndFuture. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateDevOpsConfigurationsOnboardCurrentAndFuture( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .devOpsConfigurations() + .createOrUpdate( + "myRg", + "mySecurityConnectorName", + new DevOpsConfigurationInner() + .withProperties( + new DevOpsConfigurationProperties() + .withAuthorization(new Authorization().withCode("fakeTokenPlaceholder")) + .withAutoDiscovery(AutoDiscovery.ENABLED)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/CreateOrUpdateDevOpsConfigurationsOnboardCurrentOnly_example.json + */ + /** + * Sample code: CreateOrUpdate_DevOpsConfigurations_OnboardCurrentOnly. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateDevOpsConfigurationsOnboardCurrentOnly( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .devOpsConfigurations() + .createOrUpdate( + "myRg", + "mySecurityConnectorName", + new DevOpsConfigurationInner() + .withProperties( + new DevOpsConfigurationProperties() + .withAuthorization(new Authorization().withCode("fakeTokenPlaceholder")) + .withAutoDiscovery(AutoDiscovery.DISABLED)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/CreateOrUpdateDevOpsConfigurationsOnboardSelected_example.json + */ + /** + * Sample code: CreateOrUpdate_DevOpsConfigurations_OnboardSelected. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateDevOpsConfigurationsOnboardSelected( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .devOpsConfigurations() + .createOrUpdate( + "myRg", + "mySecurityConnectorName", + new DevOpsConfigurationInner() + .withProperties( + new DevOpsConfigurationProperties() + .withAuthorization(new Authorization().withCode("fakeTokenPlaceholder")) + .withAutoDiscovery(AutoDiscovery.DISABLED) + .withTopLevelInventoryList(Arrays.asList("org1", "org2"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### DevOpsConfigurations_Delete + +```java +/** Samples for DevOpsConfigurations Delete. */ +public final class DevOpsConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/DeleteDevOpsConfigurations_example.json + */ + /** + * Sample code: Delete_DevOpsConfigurations. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteDevOpsConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations().delete("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} +``` + +### DevOpsConfigurations_Get + +```java +/** Samples for DevOpsConfigurations Get. */ +public final class DevOpsConfigurationsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetDevOpsConfigurations_example.json + */ + /** + * Sample code: Get_DevOpsConfigurations. + * + * @param manager Entry point to SecurityManager. + */ + public static void getDevOpsConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .devOpsConfigurations() + .getWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} +``` + +### DevOpsConfigurations_List + +```java +/** Samples for DevOpsConfigurations List. */ +public final class DevOpsConfigurationsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListDevOpsConfigurations_example.json + */ + /** + * Sample code: List_DevOpsConfigurations. + * + * @param manager Entry point to SecurityManager. + */ + public static void listDevOpsConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations().list("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} +``` + +### DevOpsConfigurations_Update + +```java +import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; +import com.azure.resourcemanager.security.models.AutoDiscovery; +import com.azure.resourcemanager.security.models.DevOpsConfigurationProperties; + +/** Samples for DevOpsConfigurations Update. */ +public final class DevOpsConfigurationsUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/UpdateDevOpsConfigurations_example.json + */ + /** + * Sample code: Update_DevOpsConfigurations. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateDevOpsConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .devOpsConfigurations() + .update( + "myRg", + "mySecurityConnectorName", + new DevOpsConfigurationInner() + .withProperties(new DevOpsConfigurationProperties().withAutoDiscovery(AutoDiscovery.ENABLED)), + com.azure.core.util.Context.NONE); + } +} +``` + +### DevOpsOperationResults_Get + +```java +/** Samples for DevOpsOperationResults Get. */ +public final class DevOpsOperationResultsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetDevOpsOperationResultsFailed_example.json + */ + /** + * Sample code: Get_DevOpsOperationResults_Failed. + * + * @param manager Entry point to SecurityManager. + */ + public static void getDevOpsOperationResultsFailed(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .devOpsOperationResults() + .getWithResponse( + "myRg", + "mySecurityConnectorName", + "8d4caace-e7b3-4b3e-af99-73f76829ebcf", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetDevOpsOperationResultsSucceeded_example.json + */ + /** + * Sample code: Get_DevOpsOperationResults_Succeeded. + * + * @param manager Entry point to SecurityManager. + */ + public static void getDevOpsOperationResultsSucceeded(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .devOpsOperationResults() + .getWithResponse( + "myRg", + "mySecurityConnectorName", + "4e826cf1-5c36-4808-a7d2-fb4f5170978b", + com.azure.core.util.Context.NONE); } } ``` -### CustomAssessmentAutomations_GetByResourceGroup +### DeviceSecurityGroups_CreateOrUpdate ```java -/** Samples for CustomAssessmentAutomations GetByResourceGroup. */ -public final class CustomAssessmentAutomationsGetByResourceGroupSamples { +import com.azure.resourcemanager.security.models.ActiveConnectionsNotInAllowedRange; +import java.time.Duration; +import java.util.Arrays; + +/** Samples for DeviceSecurityGroups CreateOrUpdate. */ +public final class DeviceSecurityGroupsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationGet_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/PutDeviceSecurityGroups_example.json */ /** - * Sample code: Get a Custom Assessment Automation. + * Sample code: Create or update a device security group for the specified IoT hub resource. * * @param manager Entry point to SecurityManager. */ - public static void getACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { + public static void createOrUpdateADeviceSecurityGroupForTheSpecifiedIoTHubResource( + com.azure.resourcemanager.security.SecurityManager manager) { manager - .customAssessmentAutomations() - .getByResourceGroupWithResponse( - "TestResourceGroup", "MyCustomAssessmentAutomation", com.azure.core.util.Context.NONE); + .deviceSecurityGroups() + .define("samplesecuritygroup") + .withExistingResourceId( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub") + .withTimeWindowRules( + Arrays + .asList( + new ActiveConnectionsNotInAllowedRange() + .withIsEnabled(true) + .withMinThreshold(0) + .withMaxThreshold(30) + .withTimeWindowSize(Duration.parse("PT05M")))) + .create(); } } ``` -### CustomAssessmentAutomations_List +### DeviceSecurityGroups_Delete ```java -/** Samples for CustomAssessmentAutomations List. */ -public final class CustomAssessmentAutomationsListSamples { +/** Samples for DeviceSecurityGroups Delete. */ +public final class DeviceSecurityGroupsDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationListBySubscription_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/DeleteDeviceSecurityGroups_example.json */ /** - * Sample code: List Custom Assessment Automations in a subscription. + * Sample code: Delete a device security group for the specified IoT Hub resource. * * @param manager Entry point to SecurityManager. */ - public static void listCustomAssessmentAutomationsInASubscription( + public static void deleteADeviceSecurityGroupForTheSpecifiedIoTHubResource( com.azure.resourcemanager.security.SecurityManager manager) { - manager.customAssessmentAutomations().list(com.azure.core.util.Context.NONE); + manager + .deviceSecurityGroups() + .deleteByResourceGroupWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", + "samplesecuritygroup", + com.azure.core.util.Context.NONE); } } ``` -### CustomAssessmentAutomations_ListByResourceGroup +### DeviceSecurityGroups_Get ```java -/** Samples for CustomAssessmentAutomations ListByResourceGroup. */ -public final class CustomAssessmentAutomationsListByResourceGroupSamples { +/** Samples for DeviceSecurityGroups Get. */ +public final class DeviceSecurityGroupsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationListByResourceGroup_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/GetDeviceSecurityGroups_example.json */ /** - * Sample code: List Custom Assessment Automations in a subscription and a resource group. + * Sample code: Get a device security group for the specified IoT Hub resource. * * @param manager Entry point to SecurityManager. */ - public static void listCustomAssessmentAutomationsInASubscriptionAndAResourceGroup( + public static void getADeviceSecurityGroupForTheSpecifiedIoTHubResource( com.azure.resourcemanager.security.SecurityManager manager) { manager - .customAssessmentAutomations() - .listByResourceGroup("TestResourceGroup", com.azure.core.util.Context.NONE); + .deviceSecurityGroups() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", + "samplesecuritygroup", + com.azure.core.util.Context.NONE); } } ``` -### CustomEntityStoreAssignments_Create +### DeviceSecurityGroups_List ```java -/** Samples for CustomEntityStoreAssignments Create. */ -public final class CustomEntityStoreAssignmentsCreateSamples { +/** Samples for DeviceSecurityGroups List. */ +public final class DeviceSecurityGroupsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentCreate_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/ListDeviceSecurityGroups_example.json */ /** - * Sample code: Create a custom entity store assignment. + * Sample code: List all device security groups for the specified IoT Hub resource. * * @param manager Entry point to SecurityManager. */ - public static void createACustomEntityStoreAssignment(com.azure.resourcemanager.security.SecurityManager manager) { + public static void listAllDeviceSecurityGroupsForTheSpecifiedIoTHubResource( + com.azure.resourcemanager.security.SecurityManager manager) { manager - .customEntityStoreAssignments() - .define("33e7cc6e-a139-4723-a0e5-76993aee0771") - .withExistingResourceGroup("TestResourceGroup") - .withPrincipal("aaduser=f3923a3e-ad57-4752-b1a9-fbf3c8e5e082;72f988bf-86f1-41af-91ab-2d7cd011db47") - .create(); + .deviceSecurityGroups() + .list( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", + com.azure.core.util.Context.NONE); } } ``` -### CustomEntityStoreAssignments_Delete +### DiscoveredSecuritySolutions_Get ```java -/** Samples for CustomEntityStoreAssignments Delete. */ -public final class CustomEntityStoreAssignmentsDeleteSamples { +/** Samples for DiscoveredSecuritySolutions Get. */ +public final class DiscoveredSecuritySolutionsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentDelete_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionResourceGroupLocation_example.json */ /** - * Sample code: Delete a custom entity store assignment. + * Sample code: Get discovered security solution from a security data location. * * @param manager Entry point to SecurityManager. */ - public static void deleteACustomEntityStoreAssignment(com.azure.resourcemanager.security.SecurityManager manager) { + public static void getDiscoveredSecuritySolutionFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { manager - .customEntityStoreAssignments() - .deleteByResourceGroupWithResponse( - "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", com.azure.core.util.Context.NONE); + .discoveredSecuritySolutions() + .getWithResponse("myRg2", "centralus", "paloalto7", com.azure.core.util.Context.NONE); } } ``` -### CustomEntityStoreAssignments_GetByResourceGroup +### DiscoveredSecuritySolutions_List ```java -/** Samples for CustomEntityStoreAssignments GetByResourceGroup. */ -public final class CustomEntityStoreAssignmentsGetByResourceGroupSamples { +/** Samples for DiscoveredSecuritySolutions List. */ +public final class DiscoveredSecuritySolutionsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentGet_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionsSubscription_example.json */ /** - * Sample code: Get a custom entity store assignment. + * Sample code: Get discovered security solutions. * * @param manager Entry point to SecurityManager. */ - public static void getACustomEntityStoreAssignment(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .customEntityStoreAssignments() - .getByResourceGroupWithResponse( - "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", com.azure.core.util.Context.NONE); + public static void getDiscoveredSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { + manager.discoveredSecuritySolutions().list(com.azure.core.util.Context.NONE); } } ``` -### CustomEntityStoreAssignments_List +### DiscoveredSecuritySolutions_ListByHomeRegion ```java -/** Samples for CustomEntityStoreAssignments List. */ -public final class CustomEntityStoreAssignmentsListSamples { +/** Samples for DiscoveredSecuritySolutions ListByHomeRegion. */ +public final class DiscoveredSecuritySolutionsListByHomeRegionSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentListBySubscription_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionsSubscriptionLocation_example.json */ /** - * Sample code: List custom entity store assignments in a subscription. + * Sample code: Get discovered security solutions from a security data location. * * @param manager Entry point to SecurityManager. */ - public static void listCustomEntityStoreAssignmentsInASubscription( + public static void getDiscoveredSecuritySolutionsFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.customEntityStoreAssignments().list(com.azure.core.util.Context.NONE); + manager.discoveredSecuritySolutions().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); } } ``` -### CustomEntityStoreAssignments_ListByResourceGroup +### ExternalSecuritySolutions_Get ```java -/** Samples for CustomEntityStoreAssignments ListByResourceGroup. */ -public final class CustomEntityStoreAssignmentsListByResourceGroupSamples { +/** Samples for ExternalSecuritySolutions Get. */ +public final class ExternalSecuritySolutionsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentListByResourceGroup_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolution_example.json */ /** - * Sample code: List custom entity store assignments in a subscription and a resource group. + * Sample code: Get external security solution. * * @param manager Entry point to SecurityManager. */ - public static void listCustomEntityStoreAssignmentsInASubscriptionAndAResourceGroup( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void getExternalSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { manager - .customEntityStoreAssignments() - .listByResourceGroup("TestResourceGroup", com.azure.core.util.Context.NONE); + .externalSecuritySolutions() + .getWithResponse( + "defaultresourcegroup-eus", + "centralus", + "aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus", + com.azure.core.util.Context.NONE); } } ``` -### DeviceSecurityGroups_CreateOrUpdate +### ExternalSecuritySolutions_List ```java -import com.azure.resourcemanager.security.models.ActiveConnectionsNotInAllowedRange; -import java.time.Duration; -import java.util.Arrays; +/** Samples for ExternalSecuritySolutions List. */ +public final class ExternalSecuritySolutionsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolutionsSubscription_example.json + */ + /** + * Sample code: Get external security solutions on a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getExternalSecuritySolutionsOnASubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.externalSecuritySolutions().list(com.azure.core.util.Context.NONE); + } +} +``` -/** Samples for DeviceSecurityGroups CreateOrUpdate. */ -public final class DeviceSecurityGroupsCreateOrUpdateSamples { +### ExternalSecuritySolutions_ListByHomeRegion + +```java +/** Samples for ExternalSecuritySolutions ListByHomeRegion. */ +public final class ExternalSecuritySolutionsListByHomeRegionSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/PutDeviceSecurityGroups_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolutionsSubscriptionLocation_example.json */ /** - * Sample code: Create or update a device security group for the specified IoT hub resource. + * Sample code: Get external security solutions on a subscription from security data location. * * @param manager Entry point to SecurityManager. */ - public static void createOrUpdateADeviceSecurityGroupForTheSpecifiedIoTHubResource( + public static void getExternalSecuritySolutionsOnASubscriptionFromSecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { + manager.externalSecuritySolutions().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); + } +} +``` + +### GitHubOwners_Get + +```java +/** Samples for GitHubOwners Get. */ +public final class GitHubOwnersGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetGitHubOwners_example.json + */ + /** + * Sample code: Get_GitHubOwners. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGitHubOwners(com.azure.resourcemanager.security.SecurityManager manager) { manager - .deviceSecurityGroups() - .define("samplesecuritygroup") - .withExistingResourceId( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub") - .withTimeWindowRules( - Arrays - .asList( - new ActiveConnectionsNotInAllowedRange() - .withIsEnabled(true) - .withMinThreshold(0) - .withMaxThreshold(30) - .withTimeWindowSize(Duration.parse("PT05M")))) - .create(); + .gitHubOwners() + .getWithResponse("myRg", "mySecurityConnectorName", "myGitHubOwner", com.azure.core.util.Context.NONE); } } ``` -### DeviceSecurityGroups_Delete +### GitHubOwners_List ```java -/** Samples for DeviceSecurityGroups Delete. */ -public final class DeviceSecurityGroupsDeleteSamples { +/** Samples for GitHubOwners List. */ +public final class GitHubOwnersListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/DeleteDeviceSecurityGroups_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListGitHubOwners_example.json */ /** - * Sample code: Delete a device security group for the specified IoT Hub resource. + * Sample code: List_GitHubOwners. * * @param manager Entry point to SecurityManager. */ - public static void deleteADeviceSecurityGroupForTheSpecifiedIoTHubResource( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void listGitHubOwners(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitHubOwners().list("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} +``` + +### GitHubOwners_ListAvailable + +```java +/** Samples for GitHubOwners ListAvailable. */ +public final class GitHubOwnersListAvailableSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListAvailableGitHubOwners_example.json + */ + /** + * Sample code: ListAvailable_GitHubOwners. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAvailableGitHubOwners(com.azure.resourcemanager.security.SecurityManager manager) { manager - .deviceSecurityGroups() - .deleteByResourceGroupWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", - "samplesecuritygroup", - com.azure.core.util.Context.NONE); + .gitHubOwners() + .listAvailableWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); } } ``` -### DeviceSecurityGroups_Get +### GitHubRepos_Get ```java -/** Samples for DeviceSecurityGroups Get. */ -public final class DeviceSecurityGroupsGetSamples { +/** Samples for GitHubRepos Get. */ +public final class GitHubReposGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/GetDeviceSecurityGroups_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetGitHubRepos_example.json */ /** - * Sample code: Get a device security group for the specified IoT Hub resource. + * Sample code: Get_GitHubRepos. * * @param manager Entry point to SecurityManager. */ - public static void getADeviceSecurityGroupForTheSpecifiedIoTHubResource( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void getGitHubRepos(com.azure.resourcemanager.security.SecurityManager manager) { manager - .deviceSecurityGroups() + .gitHubRepos() .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", - "samplesecuritygroup", - com.azure.core.util.Context.NONE); + "myRg", "mySecurityConnectorName", "myGitHubOwner", "myGitHubRepo", com.azure.core.util.Context.NONE); } } ``` -### DeviceSecurityGroups_List +### GitHubRepos_List ```java -/** Samples for DeviceSecurityGroups List. */ -public final class DeviceSecurityGroupsListSamples { +/** Samples for GitHubRepos List. */ +public final class GitHubReposListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/ListDeviceSecurityGroups_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListGitHubRepos_example.json */ /** - * Sample code: List all device security groups for the specified IoT Hub resource. + * Sample code: List_GitHubRepos. * * @param manager Entry point to SecurityManager. */ - public static void listAllDeviceSecurityGroupsForTheSpecifiedIoTHubResource( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void listGitHubRepos(com.azure.resourcemanager.security.SecurityManager manager) { manager - .deviceSecurityGroups() - .list( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", - com.azure.core.util.Context.NONE); + .gitHubRepos() + .list("myRg", "mySecurityConnectorName", "myGitHubOwner", com.azure.core.util.Context.NONE); } } ``` -### DiscoveredSecuritySolutions_Get +### GitLabGroups_Get ```java -/** Samples for DiscoveredSecuritySolutions Get. */ -public final class DiscoveredSecuritySolutionsGetSamples { +/** Samples for GitLabGroups Get. */ +public final class GitLabGroupsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionResourceGroupLocation_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetGitLabGroups_example.json */ /** - * Sample code: Get discovered security solution from a security data location. + * Sample code: Get_GitLabGroups. * * @param manager Entry point to SecurityManager. */ - public static void getDiscoveredSecuritySolutionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void getGitLabGroups(com.azure.resourcemanager.security.SecurityManager manager) { manager - .discoveredSecuritySolutions() - .getWithResponse("myRg2", "centralus", "paloalto7", com.azure.core.util.Context.NONE); + .gitLabGroups() + .getWithResponse( + "myRg", "mySecurityConnectorName", "myGitLabGroup$mySubGroup", com.azure.core.util.Context.NONE); } } ``` -### DiscoveredSecuritySolutions_List +### GitLabGroups_List ```java -/** Samples for DiscoveredSecuritySolutions List. */ -public final class DiscoveredSecuritySolutionsListSamples { +/** Samples for GitLabGroups List. */ +public final class GitLabGroupsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionsSubscription_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListGitLabGroups_example.json */ /** - * Sample code: Get discovered security solutions. + * Sample code: List_GitLabGroups. * * @param manager Entry point to SecurityManager. */ - public static void getDiscoveredSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { - manager.discoveredSecuritySolutions().list(com.azure.core.util.Context.NONE); + public static void listGitLabGroups(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitLabGroups().list("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); } } ``` -### DiscoveredSecuritySolutions_ListByHomeRegion +### GitLabGroups_ListAvailable ```java -/** Samples for DiscoveredSecuritySolutions ListByHomeRegion. */ -public final class DiscoveredSecuritySolutionsListByHomeRegionSamples { +/** Samples for GitLabGroups ListAvailable. */ +public final class GitLabGroupsListAvailableSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionsSubscriptionLocation_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListAvailableGitLabGroups_example.json */ /** - * Sample code: Get discovered security solutions from a security data location. + * Sample code: ListAvailable_GitLabGroups. * * @param manager Entry point to SecurityManager. */ - public static void getDiscoveredSecuritySolutionsFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.discoveredSecuritySolutions().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); + public static void listAvailableGitLabGroups(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .gitLabGroups() + .listAvailableWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); } } ``` -### ExternalSecuritySolutions_Get +### GitLabProjects_Get ```java -/** Samples for ExternalSecuritySolutions Get. */ -public final class ExternalSecuritySolutionsGetSamples { +/** Samples for GitLabProjects Get. */ +public final class GitLabProjectsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolution_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetGitLabProjects_example.json */ /** - * Sample code: Get external security solution. + * Sample code: Get_GitLabProjects. * * @param manager Entry point to SecurityManager. */ - public static void getExternalSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { + public static void getGitLabProjects(com.azure.resourcemanager.security.SecurityManager manager) { manager - .externalSecuritySolutions() + .gitLabProjects() .getWithResponse( - "defaultresourcegroup-eus", - "centralus", - "aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus", + "myRg", + "mySecurityConnectorName", + "myGitLabGroup$mySubGroup", + "myGitLabProject", com.azure.core.util.Context.NONE); } } ``` -### ExternalSecuritySolutions_List +### GitLabProjects_List ```java -/** Samples for ExternalSecuritySolutions List. */ -public final class ExternalSecuritySolutionsListSamples { +/** Samples for GitLabProjects List. */ +public final class GitLabProjectsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolutionsSubscription_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListGitLabProjects_example.json */ /** - * Sample code: Get external security solutions on a subscription. + * Sample code: List_GitLabProjects. * * @param manager Entry point to SecurityManager. */ - public static void getExternalSecuritySolutionsOnASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.externalSecuritySolutions().list(com.azure.core.util.Context.NONE); + public static void listGitLabProjects(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .gitLabProjects() + .list("myRg", "mySecurityConnectorName", "myGitLabGroup$mySubGroup", com.azure.core.util.Context.NONE); } } ``` -### ExternalSecuritySolutions_ListByHomeRegion +### GitLabSubgroups_List ```java -/** Samples for ExternalSecuritySolutions ListByHomeRegion. */ -public final class ExternalSecuritySolutionsListByHomeRegionSamples { +/** Samples for GitLabSubgroups List. */ +public final class GitLabSubgroupsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolutionsSubscriptionLocation_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListGitLabSubgroups_example.json */ /** - * Sample code: Get external security solutions on a subscription from security data location. + * Sample code: List_GitLabSubgroups. * * @param manager Entry point to SecurityManager. */ - public static void getExternalSecuritySolutionsOnASubscriptionFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.externalSecuritySolutions().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); + public static void listGitLabSubgroups(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .gitLabSubgroups() + .listWithResponse("myRg", "mySecurityConnectorName", "myGitLabGroup", com.azure.core.util.Context.NONE); } } ``` @@ -3488,13 +4496,13 @@ public final class GovernanceRulesOperationResultsSamples { } ``` -### HealthReportOperation_Get +### HealthReports_Get ```java -/** Samples for HealthReportOperation Get. */ -public final class HealthReportOperationGetSamples { +/** Samples for HealthReports Get. */ +public final class HealthReportsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/HealthReports/GetHealthReport_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-05-01-preview/examples/HealthReports/GetHealthReports_example.json */ /** * Sample code: Get health report of resource. @@ -3503,7 +4511,7 @@ public final class HealthReportOperationGetSamples { */ public static void getHealthReportOfResource(com.azure.resourcemanager.security.SecurityManager manager) { manager - .healthReportOperations() + .healthReports() .getWithResponse( "subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2/resourcegroups/E2E-IBB0WX/providers/Microsoft.Security/securityconnectors/AwsConnectorAllOfferings", "909c629a-bf39-4521-8e4f-10b443a0bc02", @@ -3518,7 +4526,7 @@ public final class HealthReportOperationGetSamples { /** Samples for HealthReports List. */ public final class HealthReportsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/HealthReports/ListHealthReports_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-05-01-preview/examples/HealthReports/ListHealthReports_example.json */ /** * Sample code: List health reports. @@ -3602,6 +4610,7 @@ public final class InformationProtectionPoliciesCreateOrUpdateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -3683,123 +4692,6 @@ public final class InformationProtectionPoliciesListSamples { } ``` -### IngestionSettings_Create - -```java -/** Samples for IngestionSettings Create. */ -public final class IngestionSettingsCreateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/CreateIngestionSetting_example.json - */ - /** - * Sample code: Create an ingestion setting for subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void createAnIngestionSettingForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().define("default").create(); - } -} -``` - -### IngestionSettings_Delete - -```java -/** Samples for IngestionSettings Delete. */ -public final class IngestionSettingsDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/DeleteIngestionSetting_example.json - */ - /** - * Sample code: Delete an ingestion setting for the subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteAnIngestionSettingForTheSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().deleteWithResponse("default", com.azure.core.util.Context.NONE); - } -} -``` - -### IngestionSettings_Get - -```java -/** Samples for IngestionSettings Get. */ -public final class IngestionSettingsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSetting_example.json - */ - /** - * Sample code: Get a ingestion setting on subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getAIngestionSettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().getWithResponse("default", com.azure.core.util.Context.NONE); - } -} -``` - -### IngestionSettings_List - -```java -/** Samples for IngestionSettings List. */ -public final class IngestionSettingsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSettings_example.json - */ - /** - * Sample code: Get ingestion settings on subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getIngestionSettingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().list(com.azure.core.util.Context.NONE); - } -} -``` - -### IngestionSettings_ListConnectionStrings - -```java -/** Samples for IngestionSettings ListConnectionStrings. */ -public final class IngestionSettingsListConnectionStringsSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListConnectionStrings_example.json - */ - /** - * Sample code: List connection strings for ingesting security data and logs. - * - * @param manager Entry point to SecurityManager. - */ - public static void listConnectionStringsForIngestingSecurityDataAndLogs( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().listConnectionStringsWithResponse("default", com.azure.core.util.Context.NONE); - } -} -``` - -### IngestionSettings_ListTokens - -```java -/** Samples for IngestionSettings ListTokens. */ -public final class IngestionSettingsListTokensSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListTokensIngestionSetting_example.json - */ - /** - * Sample code: List ingestion setting tokens. - * - * @param manager Entry point to SecurityManager. - */ - public static void listIngestionSettingTokens(com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().listTokensWithResponse("default", com.azure.core.util.Context.NONE); - } -} -``` - ### IotSecuritySolution_CreateOrUpdate ```java @@ -3857,6 +4749,7 @@ public final class IotSecuritySolutionCreateOrUpdateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -4036,6 +4929,7 @@ public final class IotSecuritySolutionUpdateSamples { .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -4784,6 +5678,60 @@ public final class RegulatoryComplianceStandardsListSamples { } ``` +### ResourceProvider_GetSensitivitySettings + +```java +/** Samples for ResourceProvider GetSensitivitySettings. */ +public final class ResourceProviderGetSensitivitySettingsSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-15-preview/examples/SensitivitySettings/GetSensitivitySettings_example.json + */ + /** + * Sample code: Get sensitivity settings. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSensitivitySettings(com.azure.resourcemanager.security.SecurityManager manager) { + manager.resourceProviders().getSensitivitySettingsWithResponse(com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_UpdateSensitivitySettings + +```java +import com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest; +import java.util.Arrays; +import java.util.UUID; + +/** Samples for ResourceProvider UpdateSensitivitySettings. */ +public final class ResourceProviderUpdateSensitivitySettingsSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-15-preview/examples/SensitivitySettings/PutSensitivitySettings_example.json + */ + /** + * Sample code: Update sensitivity settings. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSensitivitySettings(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .resourceProviders() + .updateSensitivitySettingsWithResponse( + new UpdateSensitivitySettingsRequest() + .withSensitiveInfoTypesIds( + Arrays + .asList( + UUID.fromString("f2f8a7a1-28c0-404b-9ab4-30a0a7af18cb"), + UUID.fromString("b452f22b-f87d-4f48-8490-ecf0873325b5"), + UUID.fromString("d59ee8b6-2618-404b-a5e7-aa377cd67543"))) + .withSensitivityThresholdLabelOrder(2.0F) + .withSensitivityThresholdLabelId(UUID.fromString("f2f8a7a1-28c0-404b-9ab4-30a0a7af18cb")), + com.azure.core.util.Context.NONE); + } +} +``` + ### SecureScoreControlDefinitions_List ```java @@ -5051,7 +5999,7 @@ import java.util.Map; /** Samples for SecurityConnectors CreateOrUpdate. */ public final class SecurityConnectorsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/PutSecurityConnector_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-10-01-preview/examples/SecurityConnectors/PutSecurityConnector_example.json */ /** * Sample code: Create or update a security connector. @@ -5074,10 +6022,11 @@ public final class SecurityConnectorsCreateOrUpdateSamples { .withNativeCloudConnection( new CspmMonitorAwsOfferingNativeCloudConnection() .withCloudRoleArn("arn:aws:iam::00000000:role/ASCMonitor")))) - .withEnvironmentData(new AwsEnvironmentData()) + .withEnvironmentData(new AwsEnvironmentData().withScanInterval(4L)) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -5097,7 +6046,7 @@ public final class SecurityConnectorsCreateOrUpdateSamples { /** Samples for SecurityConnectors Delete. */ public final class SecurityConnectorsDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/DeleteSecurityConnector_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-10-01-preview/examples/SecurityConnectors/DeleteSecurityConnector_example.json */ /** * Sample code: Delete a security connector. @@ -5118,7 +6067,7 @@ public final class SecurityConnectorsDeleteSamples { /** Samples for SecurityConnectors GetByResourceGroup. */ public final class SecurityConnectorsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/GetSecurityConnectorSingleResource_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-10-01-preview/examples/SecurityConnectors/GetSecurityConnectorSingleResource_example.json */ /** * Sample code: Retrieve a security connector. @@ -5140,7 +6089,7 @@ public final class SecurityConnectorsGetByResourceGroupSamples { /** Samples for SecurityConnectors List. */ public final class SecurityConnectorsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/GetSecurityConnectorsSubscription_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-10-01-preview/examples/SecurityConnectors/GetSecurityConnectorsSubscription_example.json */ /** * Sample code: List all security connectors of a specified subscription. @@ -5160,7 +6109,7 @@ public final class SecurityConnectorsListSamples { /** Samples for SecurityConnectors ListByResourceGroup. */ public final class SecurityConnectorsListByResourceGroupSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/GetSecurityConnectorsResourceGroup_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-10-01-preview/examples/SecurityConnectors/GetSecurityConnectorsResourceGroup_example.json */ /** * Sample code: List all security connectors of a specified resource group. @@ -5189,7 +6138,7 @@ import java.util.Map; /** Samples for SecurityConnectors Update. */ public final class SecurityConnectorsUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/PatchSecurityConnector_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-10-01-preview/examples/SecurityConnectors/PatchSecurityConnector_example.json */ /** * Sample code: Update a security connector. @@ -5219,6 +6168,7 @@ public final class SecurityConnectorsUpdateSamples { .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -5497,6 +6447,25 @@ public final class SecuritySolutionsReferenceDataListByHomeRegionSamples { } ``` +### SensitivitySettings_List + +```java +/** Samples for SensitivitySettings List. */ +public final class SensitivitySettingsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-15-preview/examples/SensitivitySettings/GetSensitivitySettingsList_example.json + */ + /** + * Sample code: Get sensitivity settings list. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSensitivitySettingsList(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sensitivitySettings().listWithResponse(com.azure.core.util.Context.NONE); + } +} +``` + ### ServerVulnerabilityAssessment_CreateOrUpdate ```java @@ -5595,6 +6564,107 @@ public final class ServerVulnerabilityAssessmentListByExtendedResourceSamples { } ``` +### ServerVulnerabilityAssessmentsSettings_CreateOrUpdate + +```java +import com.azure.resourcemanager.security.models.AzureServersSetting; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsAzureSettingSelectedProvider; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; + +/** Samples for ServerVulnerabilityAssessmentsSettings CreateOrUpdate. */ +public final class ServerVulnerabilityAssessmentsSettingsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ServerVulnerabilityAssessmentsSettings/PutServerVulnerabilityAssessmentsSetting_example.json + */ + /** + * Sample code: Set a server vulnerability assessments setting of the kind settingKind on the subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void setAServerVulnerabilityAssessmentsSettingOfTheKindSettingKindOnTheSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .serverVulnerabilityAssessmentsSettings() + .createOrUpdateWithResponse( + ServerVulnerabilityAssessmentsSettingKindName.AZURE_SERVERS_SETTING, + new AzureServersSetting() + .withSelectedProvider(ServerVulnerabilityAssessmentsAzureSettingSelectedProvider.MDE_TVM), + com.azure.core.util.Context.NONE); + } +} +``` + +### ServerVulnerabilityAssessmentsSettings_Delete + +```java +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; + +/** Samples for ServerVulnerabilityAssessmentsSettings Delete. */ +public final class ServerVulnerabilityAssessmentsSettingsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ServerVulnerabilityAssessmentsSettings/DeleteServerVulnerabilityAssessmentsSetting_example.json + */ + /** + * Sample code: Delete the server vulnerability assessments setting of the kind settingKind from the subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteTheServerVulnerabilityAssessmentsSettingOfTheKindSettingKindFromTheSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .serverVulnerabilityAssessmentsSettings() + .deleteWithResponse( + ServerVulnerabilityAssessmentsSettingKindName.AZURE_SERVERS_SETTING, com.azure.core.util.Context.NONE); + } +} +``` + +### ServerVulnerabilityAssessmentsSettings_Get + +```java +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; + +/** Samples for ServerVulnerabilityAssessmentsSettings Get. */ +public final class ServerVulnerabilityAssessmentsSettingsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ServerVulnerabilityAssessmentsSettings/GetServerVulnerabilityAssessmentsSetting_example.json + */ + /** + * Sample code: Get the server vulnerability assessments setting of the kind settingKind that is set on the + * subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTheServerVulnerabilityAssessmentsSettingOfTheKindSettingKindThatIsSetOnTheSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .serverVulnerabilityAssessmentsSettings() + .getWithResponse( + ServerVulnerabilityAssessmentsSettingKindName.AZURE_SERVERS_SETTING, com.azure.core.util.Context.NONE); + } +} +``` + +### ServerVulnerabilityAssessmentsSettings_List + +```java +/** Samples for ServerVulnerabilityAssessmentsSettings List. */ +public final class ServerVulnerabilityAssessmentsSettingsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ServerVulnerabilityAssessmentsSettings/ListServerVulnerabilityAssessmentsSettings_example.json + */ + /** + * Sample code: List the server vulnerability assessments settings set on the subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void listTheServerVulnerabilityAssessmentsSettingsSetOnTheSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.serverVulnerabilityAssessmentsSettings().list(com.azure.core.util.Context.NONE); + } +} +``` + ### Settings_Get ```java @@ -5785,6 +6855,7 @@ public final class SqlVulnerabilityAssessmentBaselineRulesAddSamples { com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/security/azure-resourcemanager-security/pom.xml b/sdk/security/azure-resourcemanager-security/pom.xml index 2813d26e290d..9ca5520d0f59 100644 --- a/sdk/security/azure-resourcemanager-security/pom.xml +++ b/sdk/security/azure-resourcemanager-security/pom.xml @@ -45,6 +45,7 @@ UTF-8 0 0 + true diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java index 80fd7da717a7..1fa0c01b6e3f 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java @@ -30,8 +30,6 @@ import com.azure.resourcemanager.security.implementation.AlertsImpl; import com.azure.resourcemanager.security.implementation.AlertsSuppressionRulesImpl; import com.azure.resourcemanager.security.implementation.AllowedConnectionsImpl; -import com.azure.resourcemanager.security.implementation.ApiCollectionOffboardingsImpl; -import com.azure.resourcemanager.security.implementation.ApiCollectionOnboardingsImpl; import com.azure.resourcemanager.security.implementation.ApiCollectionsImpl; import com.azure.resourcemanager.security.implementation.ApplicationOperationsImpl; import com.azure.resourcemanager.security.implementation.ApplicationsImpl; @@ -39,20 +37,29 @@ import com.azure.resourcemanager.security.implementation.AssessmentsMetadatasImpl; import com.azure.resourcemanager.security.implementation.AutoProvisioningSettingsImpl; import com.azure.resourcemanager.security.implementation.AutomationsImpl; +import com.azure.resourcemanager.security.implementation.AzureDevOpsOrgsImpl; +import com.azure.resourcemanager.security.implementation.AzureDevOpsProjectsImpl; +import com.azure.resourcemanager.security.implementation.AzureDevOpsReposImpl; import com.azure.resourcemanager.security.implementation.ComplianceResultsImpl; import com.azure.resourcemanager.security.implementation.CompliancesImpl; import com.azure.resourcemanager.security.implementation.ConnectorsImpl; import com.azure.resourcemanager.security.implementation.CustomAssessmentAutomationsImpl; import com.azure.resourcemanager.security.implementation.CustomEntityStoreAssignmentsImpl; +import com.azure.resourcemanager.security.implementation.DefenderForStoragesImpl; +import com.azure.resourcemanager.security.implementation.DevOpsConfigurationsImpl; +import com.azure.resourcemanager.security.implementation.DevOpsOperationResultsImpl; import com.azure.resourcemanager.security.implementation.DeviceSecurityGroupsImpl; import com.azure.resourcemanager.security.implementation.DiscoveredSecuritySolutionsImpl; import com.azure.resourcemanager.security.implementation.ExternalSecuritySolutionsImpl; +import com.azure.resourcemanager.security.implementation.GitHubOwnersImpl; +import com.azure.resourcemanager.security.implementation.GitHubReposImpl; +import com.azure.resourcemanager.security.implementation.GitLabGroupsImpl; +import com.azure.resourcemanager.security.implementation.GitLabProjectsImpl; +import com.azure.resourcemanager.security.implementation.GitLabSubgroupsImpl; import com.azure.resourcemanager.security.implementation.GovernanceAssignmentsImpl; import com.azure.resourcemanager.security.implementation.GovernanceRulesImpl; -import com.azure.resourcemanager.security.implementation.HealthReportOperationsImpl; import com.azure.resourcemanager.security.implementation.HealthReportsImpl; import com.azure.resourcemanager.security.implementation.InformationProtectionPoliciesImpl; -import com.azure.resourcemanager.security.implementation.IngestionSettingsImpl; import com.azure.resourcemanager.security.implementation.IotSecuritySolutionAnalyticsImpl; import com.azure.resourcemanager.security.implementation.IotSecuritySolutionsAnalyticsAggregatedAlertsImpl; import com.azure.resourcemanager.security.implementation.IotSecuritySolutionsAnalyticsRecommendationsImpl; @@ -65,6 +72,7 @@ import com.azure.resourcemanager.security.implementation.RegulatoryComplianceAssessmentsImpl; import com.azure.resourcemanager.security.implementation.RegulatoryComplianceControlsImpl; import com.azure.resourcemanager.security.implementation.RegulatoryComplianceStandardsImpl; +import com.azure.resourcemanager.security.implementation.ResourceProvidersImpl; import com.azure.resourcemanager.security.implementation.SecureScoreControlDefinitionsImpl; import com.azure.resourcemanager.security.implementation.SecureScoreControlsImpl; import com.azure.resourcemanager.security.implementation.SecureScoresImpl; @@ -76,7 +84,9 @@ import com.azure.resourcemanager.security.implementation.SecurityOperatorsImpl; import com.azure.resourcemanager.security.implementation.SecuritySolutionsImpl; import com.azure.resourcemanager.security.implementation.SecuritySolutionsReferenceDatasImpl; +import com.azure.resourcemanager.security.implementation.SensitivitySettingsImpl; import com.azure.resourcemanager.security.implementation.ServerVulnerabilityAssessmentsImpl; +import com.azure.resourcemanager.security.implementation.ServerVulnerabilityAssessmentsSettingsImpl; import com.azure.resourcemanager.security.implementation.SettingsImpl; import com.azure.resourcemanager.security.implementation.SoftwareInventoriesImpl; import com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentBaselineRulesImpl; @@ -92,8 +102,6 @@ import com.azure.resourcemanager.security.models.Alerts; import com.azure.resourcemanager.security.models.AlertsSuppressionRules; import com.azure.resourcemanager.security.models.AllowedConnections; -import com.azure.resourcemanager.security.models.ApiCollectionOffboardings; -import com.azure.resourcemanager.security.models.ApiCollectionOnboardings; import com.azure.resourcemanager.security.models.ApiCollections; import com.azure.resourcemanager.security.models.ApplicationOperations; import com.azure.resourcemanager.security.models.Applications; @@ -101,20 +109,29 @@ import com.azure.resourcemanager.security.models.AssessmentsMetadatas; import com.azure.resourcemanager.security.models.AutoProvisioningSettings; import com.azure.resourcemanager.security.models.Automations; +import com.azure.resourcemanager.security.models.AzureDevOpsOrgs; +import com.azure.resourcemanager.security.models.AzureDevOpsProjects; +import com.azure.resourcemanager.security.models.AzureDevOpsRepos; import com.azure.resourcemanager.security.models.ComplianceResults; import com.azure.resourcemanager.security.models.Compliances; import com.azure.resourcemanager.security.models.Connectors; import com.azure.resourcemanager.security.models.CustomAssessmentAutomations; import com.azure.resourcemanager.security.models.CustomEntityStoreAssignments; +import com.azure.resourcemanager.security.models.DefenderForStorages; +import com.azure.resourcemanager.security.models.DevOpsConfigurations; +import com.azure.resourcemanager.security.models.DevOpsOperationResults; import com.azure.resourcemanager.security.models.DeviceSecurityGroups; import com.azure.resourcemanager.security.models.DiscoveredSecuritySolutions; import com.azure.resourcemanager.security.models.ExternalSecuritySolutions; +import com.azure.resourcemanager.security.models.GitHubOwners; +import com.azure.resourcemanager.security.models.GitHubRepos; +import com.azure.resourcemanager.security.models.GitLabGroups; +import com.azure.resourcemanager.security.models.GitLabProjects; +import com.azure.resourcemanager.security.models.GitLabSubgroups; import com.azure.resourcemanager.security.models.GovernanceAssignments; import com.azure.resourcemanager.security.models.GovernanceRules; -import com.azure.resourcemanager.security.models.HealthReportOperations; import com.azure.resourcemanager.security.models.HealthReports; import com.azure.resourcemanager.security.models.InformationProtectionPolicies; -import com.azure.resourcemanager.security.models.IngestionSettings; import com.azure.resourcemanager.security.models.IotSecuritySolutionAnalytics; import com.azure.resourcemanager.security.models.IotSecuritySolutions; import com.azure.resourcemanager.security.models.IotSecuritySolutionsAnalyticsAggregatedAlerts; @@ -127,6 +144,7 @@ import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessments; import com.azure.resourcemanager.security.models.RegulatoryComplianceControls; import com.azure.resourcemanager.security.models.RegulatoryComplianceStandards; +import com.azure.resourcemanager.security.models.ResourceProviders; import com.azure.resourcemanager.security.models.SecureScoreControlDefinitions; import com.azure.resourcemanager.security.models.SecureScoreControls; import com.azure.resourcemanager.security.models.SecureScores; @@ -137,7 +155,9 @@ import com.azure.resourcemanager.security.models.SecurityOperators; import com.azure.resourcemanager.security.models.SecuritySolutions; import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceDatas; +import com.azure.resourcemanager.security.models.SensitivitySettings; import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessments; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettings; import com.azure.resourcemanager.security.models.Settings; import com.azure.resourcemanager.security.models.SoftwareInventories; import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentBaselineRules; @@ -238,12 +258,14 @@ public final class SecurityManager { private Connectors connectors; + private ResourceProviders resourceProviders; + + private SensitivitySettings sensitivitySettings; + private Alerts alerts; private Settings settings; - private IngestionSettings ingestionSettings; - private SoftwareInventories softwareInventories; private GovernanceRules governanceRules; @@ -260,23 +282,41 @@ public final class SecurityManager { private ApiCollections apiCollections; - private ApiCollectionOnboardings apiCollectionOnboardings; + private SqlVulnerabilityAssessmentScans sqlVulnerabilityAssessmentScans; - private ApiCollectionOffboardings apiCollectionOffboardings; + private SqlVulnerabilityAssessmentScanResults sqlVulnerabilityAssessmentScanResults; + + private SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselineRules; + + private SecurityOperators securityOperators; + + private ServerVulnerabilityAssessmentsSettings serverVulnerabilityAssessmentsSettings; private HealthReports healthReports; - private HealthReportOperations healthReportOperations; + private DefenderForStorages defenderForStorages; - private SqlVulnerabilityAssessmentScans sqlVulnerabilityAssessmentScans; + private AzureDevOpsOrgs azureDevOpsOrgs; - private SqlVulnerabilityAssessmentScanResults sqlVulnerabilityAssessmentScanResults; + private AzureDevOpsProjects azureDevOpsProjects; - private SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselineRules; + private AzureDevOpsRepos azureDevOpsRepos; - private SecurityConnectors securityConnectors; + private DevOpsConfigurations devOpsConfigurations; - private SecurityOperators securityOperators; + private GitHubOwners gitHubOwners; + + private GitHubRepos gitHubRepos; + + private GitLabGroups gitLabGroups; + + private GitLabSubgroups gitLabSubgroups; + + private GitLabProjects gitLabProjects; + + private DevOpsOperationResults devOpsOperationResults; + + private SecurityConnectors securityConnectors; private final SecurityCenter clientObject; @@ -443,7 +483,7 @@ public SecurityManager authenticate(TokenCredential credential, AzureProfile pro .append("-") .append("com.azure.resourcemanager.security") .append("/") - .append("1.0.0-beta.5"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -1014,6 +1054,30 @@ public Connectors connectors() { return connectors; } + /** + * Gets the resource collection API of ResourceProviders. + * + * @return Resource collection API of ResourceProviders. + */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + + /** + * Gets the resource collection API of SensitivitySettings. + * + * @return Resource collection API of SensitivitySettings. + */ + public SensitivitySettings sensitivitySettings() { + if (this.sensitivitySettings == null) { + this.sensitivitySettings = new SensitivitySettingsImpl(clientObject.getSensitivitySettings(), this); + } + return sensitivitySettings; + } + /** * Gets the resource collection API of Alerts. * @@ -1038,18 +1102,6 @@ public Settings settings() { return settings; } - /** - * Gets the resource collection API of IngestionSettings. It manages IngestionSetting. - * - * @return Resource collection API of IngestionSettings. - */ - public IngestionSettings ingestionSettings() { - if (this.ingestionSettings == null) { - this.ingestionSettings = new IngestionSettingsImpl(clientObject.getIngestionSettings(), this); - } - return ingestionSettings; - } - /** * Gets the resource collection API of SoftwareInventories. * @@ -1150,29 +1202,70 @@ public ApiCollections apiCollections() { } /** - * Gets the resource collection API of ApiCollectionOnboardings. + * Gets the resource collection API of SqlVulnerabilityAssessmentScans. + * + * @return Resource collection API of SqlVulnerabilityAssessmentScans. + */ + public SqlVulnerabilityAssessmentScans sqlVulnerabilityAssessmentScans() { + if (this.sqlVulnerabilityAssessmentScans == null) { + this.sqlVulnerabilityAssessmentScans = + new SqlVulnerabilityAssessmentScansImpl(clientObject.getSqlVulnerabilityAssessmentScans(), this); + } + return sqlVulnerabilityAssessmentScans; + } + + /** + * Gets the resource collection API of SqlVulnerabilityAssessmentScanResults. * - * @return Resource collection API of ApiCollectionOnboardings. + * @return Resource collection API of SqlVulnerabilityAssessmentScanResults. */ - public ApiCollectionOnboardings apiCollectionOnboardings() { - if (this.apiCollectionOnboardings == null) { - this.apiCollectionOnboardings = - new ApiCollectionOnboardingsImpl(clientObject.getApiCollectionOnboardings(), this); + public SqlVulnerabilityAssessmentScanResults sqlVulnerabilityAssessmentScanResults() { + if (this.sqlVulnerabilityAssessmentScanResults == null) { + this.sqlVulnerabilityAssessmentScanResults = + new SqlVulnerabilityAssessmentScanResultsImpl( + clientObject.getSqlVulnerabilityAssessmentScanResults(), this); } - return apiCollectionOnboardings; + return sqlVulnerabilityAssessmentScanResults; } /** - * Gets the resource collection API of ApiCollectionOffboardings. + * Gets the resource collection API of SqlVulnerabilityAssessmentBaselineRules. It manages RuleResults. * - * @return Resource collection API of ApiCollectionOffboardings. + * @return Resource collection API of SqlVulnerabilityAssessmentBaselineRules. + */ + public SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselineRules() { + if (this.sqlVulnerabilityAssessmentBaselineRules == null) { + this.sqlVulnerabilityAssessmentBaselineRules = + new SqlVulnerabilityAssessmentBaselineRulesImpl( + clientObject.getSqlVulnerabilityAssessmentBaselineRules(), this); + } + return sqlVulnerabilityAssessmentBaselineRules; + } + + /** + * Gets the resource collection API of SecurityOperators. + * + * @return Resource collection API of SecurityOperators. */ - public ApiCollectionOffboardings apiCollectionOffboardings() { - if (this.apiCollectionOffboardings == null) { - this.apiCollectionOffboardings = - new ApiCollectionOffboardingsImpl(clientObject.getApiCollectionOffboardings(), this); + public SecurityOperators securityOperators() { + if (this.securityOperators == null) { + this.securityOperators = new SecurityOperatorsImpl(clientObject.getSecurityOperators(), this); } - return apiCollectionOffboardings; + return securityOperators; + } + + /** + * Gets the resource collection API of ServerVulnerabilityAssessmentsSettings. + * + * @return Resource collection API of ServerVulnerabilityAssessmentsSettings. + */ + public ServerVulnerabilityAssessmentsSettings serverVulnerabilityAssessmentsSettings() { + if (this.serverVulnerabilityAssessmentsSettings == null) { + this.serverVulnerabilityAssessmentsSettings = + new ServerVulnerabilityAssessmentsSettingsImpl( + clientObject.getServerVulnerabilityAssessmentsSettings(), this); + } + return serverVulnerabilityAssessmentsSettings; } /** @@ -1188,57 +1281,136 @@ public HealthReports healthReports() { } /** - * Gets the resource collection API of HealthReportOperations. + * Gets the resource collection API of DefenderForStorages. It manages DefenderForStorageSetting. * - * @return Resource collection API of HealthReportOperations. + * @return Resource collection API of DefenderForStorages. */ - public HealthReportOperations healthReportOperations() { - if (this.healthReportOperations == null) { - this.healthReportOperations = - new HealthReportOperationsImpl(clientObject.getHealthReportOperations(), this); + public DefenderForStorages defenderForStorages() { + if (this.defenderForStorages == null) { + this.defenderForStorages = new DefenderForStoragesImpl(clientObject.getDefenderForStorages(), this); } - return healthReportOperations; + return defenderForStorages; } /** - * Gets the resource collection API of SqlVulnerabilityAssessmentScans. + * Gets the resource collection API of AzureDevOpsOrgs. It manages AzureDevOpsOrg. * - * @return Resource collection API of SqlVulnerabilityAssessmentScans. + * @return Resource collection API of AzureDevOpsOrgs. */ - public SqlVulnerabilityAssessmentScans sqlVulnerabilityAssessmentScans() { - if (this.sqlVulnerabilityAssessmentScans == null) { - this.sqlVulnerabilityAssessmentScans = - new SqlVulnerabilityAssessmentScansImpl(clientObject.getSqlVulnerabilityAssessmentScans(), this); + public AzureDevOpsOrgs azureDevOpsOrgs() { + if (this.azureDevOpsOrgs == null) { + this.azureDevOpsOrgs = new AzureDevOpsOrgsImpl(clientObject.getAzureDevOpsOrgs(), this); } - return sqlVulnerabilityAssessmentScans; + return azureDevOpsOrgs; } /** - * Gets the resource collection API of SqlVulnerabilityAssessmentScanResults. + * Gets the resource collection API of AzureDevOpsProjects. It manages AzureDevOpsProject. * - * @return Resource collection API of SqlVulnerabilityAssessmentScanResults. + * @return Resource collection API of AzureDevOpsProjects. */ - public SqlVulnerabilityAssessmentScanResults sqlVulnerabilityAssessmentScanResults() { - if (this.sqlVulnerabilityAssessmentScanResults == null) { - this.sqlVulnerabilityAssessmentScanResults = - new SqlVulnerabilityAssessmentScanResultsImpl( - clientObject.getSqlVulnerabilityAssessmentScanResults(), this); + public AzureDevOpsProjects azureDevOpsProjects() { + if (this.azureDevOpsProjects == null) { + this.azureDevOpsProjects = new AzureDevOpsProjectsImpl(clientObject.getAzureDevOpsProjects(), this); } - return sqlVulnerabilityAssessmentScanResults; + return azureDevOpsProjects; } /** - * Gets the resource collection API of SqlVulnerabilityAssessmentBaselineRules. It manages RuleResults. + * Gets the resource collection API of AzureDevOpsRepos. It manages AzureDevOpsRepository. * - * @return Resource collection API of SqlVulnerabilityAssessmentBaselineRules. + * @return Resource collection API of AzureDevOpsRepos. */ - public SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselineRules() { - if (this.sqlVulnerabilityAssessmentBaselineRules == null) { - this.sqlVulnerabilityAssessmentBaselineRules = - new SqlVulnerabilityAssessmentBaselineRulesImpl( - clientObject.getSqlVulnerabilityAssessmentBaselineRules(), this); + public AzureDevOpsRepos azureDevOpsRepos() { + if (this.azureDevOpsRepos == null) { + this.azureDevOpsRepos = new AzureDevOpsReposImpl(clientObject.getAzureDevOpsRepos(), this); } - return sqlVulnerabilityAssessmentBaselineRules; + return azureDevOpsRepos; + } + + /** + * Gets the resource collection API of DevOpsConfigurations. + * + * @return Resource collection API of DevOpsConfigurations. + */ + public DevOpsConfigurations devOpsConfigurations() { + if (this.devOpsConfigurations == null) { + this.devOpsConfigurations = new DevOpsConfigurationsImpl(clientObject.getDevOpsConfigurations(), this); + } + return devOpsConfigurations; + } + + /** + * Gets the resource collection API of GitHubOwners. + * + * @return Resource collection API of GitHubOwners. + */ + public GitHubOwners gitHubOwners() { + if (this.gitHubOwners == null) { + this.gitHubOwners = new GitHubOwnersImpl(clientObject.getGitHubOwners(), this); + } + return gitHubOwners; + } + + /** + * Gets the resource collection API of GitHubRepos. + * + * @return Resource collection API of GitHubRepos. + */ + public GitHubRepos gitHubRepos() { + if (this.gitHubRepos == null) { + this.gitHubRepos = new GitHubReposImpl(clientObject.getGitHubRepos(), this); + } + return gitHubRepos; + } + + /** + * Gets the resource collection API of GitLabGroups. + * + * @return Resource collection API of GitLabGroups. + */ + public GitLabGroups gitLabGroups() { + if (this.gitLabGroups == null) { + this.gitLabGroups = new GitLabGroupsImpl(clientObject.getGitLabGroups(), this); + } + return gitLabGroups; + } + + /** + * Gets the resource collection API of GitLabSubgroups. + * + * @return Resource collection API of GitLabSubgroups. + */ + public GitLabSubgroups gitLabSubgroups() { + if (this.gitLabSubgroups == null) { + this.gitLabSubgroups = new GitLabSubgroupsImpl(clientObject.getGitLabSubgroups(), this); + } + return gitLabSubgroups; + } + + /** + * Gets the resource collection API of GitLabProjects. + * + * @return Resource collection API of GitLabProjects. + */ + public GitLabProjects gitLabProjects() { + if (this.gitLabProjects == null) { + this.gitLabProjects = new GitLabProjectsImpl(clientObject.getGitLabProjects(), this); + } + return gitLabProjects; + } + + /** + * Gets the resource collection API of DevOpsOperationResults. + * + * @return Resource collection API of DevOpsOperationResults. + */ + public DevOpsOperationResults devOpsOperationResults() { + if (this.devOpsOperationResults == null) { + this.devOpsOperationResults = + new DevOpsOperationResultsImpl(clientObject.getDevOpsOperationResults(), this); + } + return devOpsOperationResults; } /** @@ -1254,20 +1426,10 @@ public SecurityConnectors securityConnectors() { } /** - * Gets the resource collection API of SecurityOperators. + * Gets wrapped service client SecurityCenter providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. * - * @return Resource collection API of SecurityOperators. - */ - public SecurityOperators securityOperators() { - if (this.securityOperators == null) { - this.securityOperators = new SecurityOperatorsImpl(clientObject.getSecurityOperators(), this); - } - return securityOperators; - } - - /** - * @return Wrapped service client SecurityCenter providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. + * @return Wrapped service client SecurityCenter. */ public SecurityCenter serviceClient() { return this.clientObject; diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionOnboardingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionOnboardingsClient.java deleted file mode 100644 index 2dd341d3c7e1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionOnboardingsClient.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.models.ApiCollectionResponseInner; - -/** An instance of this class provides access to all the operations defined in ApiCollectionOnboardingsClient. */ -public interface ApiCollectionOnboardingsClient { - /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to Defender for APIs. The system will start monitoring the operations - * within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 API collection as represented by Defender for APIs along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context); - - /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to Defender for APIs. The system will start monitoring the operations - * within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an API collection as represented by Defender for APIs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApiCollectionResponseInner create(String resourceGroupName, String serviceName, String apiCollectionId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionsClient.java index 6eded28ea973..7bde87fe2b8d 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionsClient.java @@ -8,35 +8,98 @@ 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.resourcemanager.security.fluent.models.ApiCollectionResponseInner; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.security.fluent.models.ApiCollectionInner; /** An instance of this class provides access to all the operations defined in ApiCollectionsClient. */ public interface ApiCollectionsClient { /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs + * Gets a list of API collections within a subscription * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API - * Management API for intrusive behaviors and provide alerts for attacks that have been detected. + *

Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs. + * + * @throws com.azure.core.management.exception.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 API collections within a subscription that have been onboarded to Microsoft Defender for APIs + * as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of API collections within a subscription + * + *

Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 API collections within a subscription that have been onboarded to Microsoft Defender for APIs + * as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets a list of API collections within a resource group + * + *

Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for + * APIs. + * + * @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 a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs + * as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of API collections within a resource group + * + *

Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for + * APIs. + * + * @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 a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs + * as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a list of onboarded Azure API Management APIs + * + *

Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure + * API Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the + * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName The name of the API Management service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedIterable}. + * @return a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serviceName); + PagedIterable listByAzureApiManagementService(String resourceGroupName, String serviceName); /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs + * Gets a list of onboarded Azure API Management APIs * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API - * Management API for intrusive behaviors and provide alerts for attacks that have been detected. + *

Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure + * API Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the + * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName The name of the API Management service. @@ -44,49 +107,169 @@ public interface ApiCollectionsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedIterable}. + * @return a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serviceName, Context context); + PagedIterable listByAzureApiManagementService( + String resourceGroupName, String serviceName, Context context); + + /** + * Gets an onboarded Azure API Management API + * + *

Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API + * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the + * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Azure API Management API if it has been onboarded to Microsoft Defender for APIs along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByAzureApiManagementServiceWithResponse( + String resourceGroupName, String serviceName, String apiId, Context context); + + /** + * Gets an onboarded Azure API Management API + * + *

Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API + * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the + * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Azure API Management API if it has been onboarded to Microsoft Defender for APIs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiCollectionInner getByAzureApiManagementService(String resourceGroupName, String serviceName, String apiId); + + /** + * Onboard an Azure API Management API to Microsoft Defender for APIs + * + *

Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the + * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been + * detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 API collection as represented by Microsoft Defender for APIs. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApiCollectionInner> beginOnboardAzureApiManagementApi( + String resourceGroupName, String serviceName, String apiId); + + /** + * Onboard an Azure API Management API to Microsoft Defender for APIs + * + *

Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the + * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been + * detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 API collection as represented by Microsoft Defender for APIs. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApiCollectionInner> beginOnboardAzureApiManagementApi( + String resourceGroupName, String serviceName, String apiId, Context context); + + /** + * Onboard an Azure API Management API to Microsoft Defender for APIs + * + *

Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the + * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been + * detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 API collection as represented by Microsoft Defender for APIs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiCollectionInner onboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId); + + /** + * Onboard an Azure API Management API to Microsoft Defender for APIs + * + *

Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the + * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been + * detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 API collection as represented by Microsoft Defender for APIs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiCollectionInner onboardAzureApiManagementApi( + String resourceGroupName, String serviceName, String apiId, Context context); /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs + * Offboard an Azure API Management API from Microsoft Defender for APIs * - *

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to Defender for APIs, the system will monitor the operations within the Azure API Management API for - * intrusive behaviors and provide alerts for attacks that have been detected. + *

Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the + * operations within the Azure API Management API for intrusive behaviors. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Azure API Management API if it has been onboarded to Defender for APIs along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context); + Response offboardAzureApiManagementApiWithResponse( + String resourceGroupName, String serviceName, String apiId, Context context); /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs + * Offboard an Azure API Management API from Microsoft Defender for APIs * - *

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to Defender for APIs, the system will monitor the operations within the Azure API Management API for - * intrusive behaviors and provide alerts for attacks that have been detected. + *

Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the + * operations within the Azure API Management API for intrusive behaviors. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Azure API Management API if it has been onboarded to Defender for APIs. */ @ServiceMethod(returns = ReturnType.SINGLE) - ApiCollectionResponseInner get(String resourceGroupName, String serviceName, String apiCollectionId); + void offboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsOrgsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsOrgsClient.java new file mode 100644 index 000000000000..f306bc8496c8 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsOrgsClient.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.models.AzureDevOpsOrgInner; +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgListResponseInner; + +/** An instance of this class provides access to all the operations defined in AzureDevOpsOrgsClient. */ +public interface AzureDevOpsOrgsClient { + /** + * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAvailableWithResponse( + String resourceGroupName, String securityConnectorName, Context context); + + /** + * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureDevOpsOrgListResponseInner listAvailable(String resourceGroupName, String securityConnectorName); + + /** + * Returns a list of Azure DevOps organizations onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String securityConnectorName); + + /** + * Returns a list of Azure DevOps organizations onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); + + /** + * Returns a monitored Azure DevOps organization resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String securityConnectorName, String orgName, Context context); + + /** + * Returns a monitored Azure DevOps organization resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureDevOpsOrgInner get(String resourceGroupName, String securityConnectorName, String orgName); + + /** + * Creates or updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AzureDevOpsOrgInner> beginCreateOrUpdate( + String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg); + + /** + * Creates or updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AzureDevOpsOrgInner> beginCreateOrUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + AzureDevOpsOrgInner azureDevOpsOrg, + Context context); + + /** + * Creates or updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureDevOpsOrgInner createOrUpdate( + String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg); + + /** + * Creates or updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureDevOpsOrgInner createOrUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + AzureDevOpsOrgInner azureDevOpsOrg, + Context context); + + /** + * Updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AzureDevOpsOrgInner> beginUpdate( + String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg); + + /** + * Updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AzureDevOpsOrgInner> beginUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + AzureDevOpsOrgInner azureDevOpsOrg, + Context context); + + /** + * Updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureDevOpsOrgInner update( + String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg); + + /** + * Updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureDevOpsOrgInner update( + String resourceGroupName, + String securityConnectorName, + String orgName, + AzureDevOpsOrgInner azureDevOpsOrg, + Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsProjectsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsProjectsClient.java new file mode 100644 index 000000000000..ef13605eba26 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsProjectsClient.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.models.AzureDevOpsProjectInner; + +/** An instance of this class provides access to all the operations defined in AzureDevOpsProjectsClient. */ +public interface AzureDevOpsProjectsClient { + /** + * Returns a list of Azure DevOps projects onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String securityConnectorName, String orgName); + + /** + * Returns a list of Azure DevOps projects onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String securityConnectorName, String orgName, Context context); + + /** + * Returns a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String securityConnectorName, String orgName, String projectName, Context context); + + /** + * Returns a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureDevOpsProjectInner get( + String resourceGroupName, String securityConnectorName, String orgName, String projectName); + + /** + * Creates or updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AzureDevOpsProjectInner> beginCreateOrUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject); + + /** + * Creates or updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AzureDevOpsProjectInner> beginCreateOrUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject, + Context context); + + /** + * Creates or updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureDevOpsProjectInner createOrUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject); + + /** + * Creates or updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureDevOpsProjectInner createOrUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject, + Context context); + + /** + * Updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AzureDevOpsProjectInner> beginUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject); + + /** + * Updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AzureDevOpsProjectInner> beginUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject, + Context context); + + /** + * Updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureDevOpsProjectInner update( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject); + + /** + * Updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureDevOpsProjectInner update( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject, + Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsReposClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsReposClient.java new file mode 100644 index 000000000000..65831decc2be --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsReposClient.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.models.AzureDevOpsRepositoryInner; + +/** An instance of this class provides access to all the operations defined in AzureDevOpsReposClient. */ +public interface AzureDevOpsReposClient { + /** + * Returns a list of Azure DevOps repositories onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String securityConnectorName, String orgName, String projectName); + + /** + * Returns a list of Azure DevOps repositories onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String securityConnectorName, String orgName, String projectName, Context context); + + /** + * Returns a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + Context context); + + /** + * Returns a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureDevOpsRepositoryInner get( + String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName); + + /** + * Creates or updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AzureDevOpsRepositoryInner> beginCreateOrUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository); + + /** + * Creates or updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AzureDevOpsRepositoryInner> beginCreateOrUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository, + Context context); + + /** + * Creates or updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureDevOpsRepositoryInner createOrUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository); + + /** + * Creates or updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureDevOpsRepositoryInner createOrUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository, + Context context); + + /** + * Updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AzureDevOpsRepositoryInner> beginUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository); + + /** + * Updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AzureDevOpsRepositoryInner> beginUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository, + Context context); + + /** + * Updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureDevOpsRepositoryInner update( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository); + + /** + * Updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureDevOpsRepositoryInner update( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository, + Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DefenderForStoragesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DefenderForStoragesClient.java new file mode 100644 index 000000000000..563cd6065573 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DefenderForStoragesClient.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.models.DefenderForStorageSettingInner; +import com.azure.resourcemanager.security.models.SettingNameAutoGenerated; + +/** An instance of this class provides access to all the operations defined in DefenderForStoragesClient. */ +public interface DefenderForStoragesClient { + /** + * Gets the Defender for Storage settings for the specified storage account. + * + * @param resourceId The identifier of the resource. + * @param settingName Defender for Storage setting name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Defender for Storage settings for the specified storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceId, SettingNameAutoGenerated settingName, Context context); + + /** + * Gets the Defender for Storage settings for the specified storage account. + * + * @param resourceId The identifier of the resource. + * @param settingName Defender for Storage setting name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Defender for Storage settings for the specified storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DefenderForStorageSettingInner get(String resourceId, SettingNameAutoGenerated settingName); + + /** + * Creates or updates the Defender for Storage settings on a specified storage account. + * + * @param resourceId The identifier of the resource. + * @param settingName Defender for Storage setting name. + * @param defenderForStorageSetting Defender for Storage Settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Defender for Storage resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceId, + SettingNameAutoGenerated settingName, + DefenderForStorageSettingInner defenderForStorageSetting, + Context context); + + /** + * Creates or updates the Defender for Storage settings on a specified storage account. + * + * @param resourceId The identifier of the resource. + * @param settingName Defender for Storage setting name. + * @param defenderForStorageSetting Defender for Storage Settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Defender for Storage resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DefenderForStorageSettingInner create( + String resourceId, + SettingNameAutoGenerated settingName, + DefenderForStorageSettingInner defenderForStorageSetting); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsConfigurationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsConfigurationsClient.java new file mode 100644 index 000000000000..1b86382b2652 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsConfigurationsClient.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.models.DevOpsConfigurationInner; + +/** An instance of this class provides access to all the operations defined in DevOpsConfigurationsClient. */ +public interface DevOpsConfigurationsClient { + /** + * List DevOps Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String securityConnectorName); + + /** + * List DevOps Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String securityConnectorName, Context context); + + /** + * Gets a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 DevOps Configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String securityConnectorName, Context context); + + /** + * Gets a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DevOps Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DevOpsConfigurationInner get(String resourceGroupName, String securityConnectorName); + + /** + * Creates or updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of devOps Configuration resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DevOpsConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration); + + /** + * Creates or updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of devOps Configuration resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DevOpsConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String securityConnectorName, + DevOpsConfigurationInner devOpsConfiguration, + Context context); + + /** + * Creates or updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return devOps Configuration resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DevOpsConfigurationInner createOrUpdate( + String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration); + + /** + * Creates or updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return devOps Configuration resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DevOpsConfigurationInner createOrUpdate( + String resourceGroupName, + String securityConnectorName, + DevOpsConfigurationInner devOpsConfiguration, + Context context); + + /** + * Updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of devOps Configuration resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DevOpsConfigurationInner> beginUpdate( + String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration); + + /** + * Updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of devOps Configuration resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DevOpsConfigurationInner> beginUpdate( + String resourceGroupName, + String securityConnectorName, + DevOpsConfigurationInner devOpsConfiguration, + Context context); + + /** + * Updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return devOps Configuration resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DevOpsConfigurationInner update( + String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration); + + /** + * Updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return devOps Configuration resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DevOpsConfigurationInner update( + String resourceGroupName, + String securityConnectorName, + DevOpsConfigurationInner devOpsConfiguration, + Context context); + + /** + * Deletes a DevOps Connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String securityConnectorName); + + /** + * Deletes a DevOps Connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 securityConnectorName, Context context); + + /** + * Deletes a DevOps Connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String securityConnectorName); + + /** + * Deletes a DevOps Connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 securityConnectorName, Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionOffboardingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsOperationResultsClient.java similarity index 50% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionOffboardingsClient.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsOperationResultsClient.java index 01617030ae54..9935fc201e77 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionOffboardingsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsOperationResultsClient.java @@ -8,43 +8,37 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.OperationStatusResultInner; -/** An instance of this class provides access to all the operations defined in ApiCollectionOffboardingsClient. */ -public interface ApiCollectionOffboardingsClient { +/** An instance of this class provides access to all the operations defined in DevOpsOperationResultsClient. */ +public interface DevOpsOperationResultsClient { /** - * Offboard an Azure API Management API from Defender for APIs - * - *

Offboard an Azure API Management API from Defender for APIs. The system will stop monitoring the operations - * within the Azure API Management API for intrusive behaviors. + * Get devops long running operation result. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @param securityConnectorName The security connector name. + * @param operationResultId The operation result Id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return devops long running operation result along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context); + Response getWithResponse( + String resourceGroupName, String securityConnectorName, String operationResultId, Context context); /** - * Offboard an Azure API Management API from Defender for APIs - * - *

Offboard an Azure API Management API from Defender for APIs. The system will stop monitoring the operations - * within the Azure API Management API for intrusive behaviors. + * Get devops long running operation result. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @param securityConnectorName The security connector name. + * @param operationResultId The operation result 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 devops long running operation result. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String serviceName, String apiCollectionId); + OperationStatusResultInner get(String resourceGroupName, String securityConnectorName, String operationResultId); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubOwnersClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubOwnersClient.java new file mode 100644 index 000000000000..de8b306e89d1 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubOwnersClient.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.models.GitHubOwnerInner; +import com.azure.resourcemanager.security.fluent.models.GitHubOwnerListResponseInner; + +/** An instance of this class provides access to all the operations defined in GitHubOwnersClient. */ +public interface GitHubOwnersClient { + /** + * Returns a list of all GitHub owners accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAvailableWithResponse( + String resourceGroupName, String securityConnectorName, Context context); + + /** + * Returns a list of all GitHub owners accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GitHubOwnerListResponseInner listAvailable(String resourceGroupName, String securityConnectorName); + + /** + * Returns a list of GitHub owners onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String securityConnectorName); + + /** + * Returns a list of GitHub owners onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); + + /** + * Returns a monitored GitHub owner. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitHub Owner resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String securityConnectorName, String ownerName, Context context); + + /** + * Returns a monitored GitHub owner. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitHub Owner resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GitHubOwnerInner get(String resourceGroupName, String securityConnectorName, String ownerName); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubReposClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubReposClient.java new file mode 100644 index 000000000000..01ccb8004896 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubReposClient.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.models.GitHubRepositoryInner; + +/** An instance of this class provides access to all the operations defined in GitHubReposClient. */ +public interface GitHubReposClient { + /** + * Returns a list of GitHub repositories onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String securityConnectorName, String ownerName); + + /** + * Returns a list of GitHub repositories onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String securityConnectorName, String ownerName, Context context); + + /** + * Returns a monitored GitHub repository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @param repoName The repository name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitHub Repository resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String securityConnectorName, String ownerName, String repoName, Context context); + + /** + * Returns a monitored GitHub repository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @param repoName The repository name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitHub Repository resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GitHubRepositoryInner get( + String resourceGroupName, String securityConnectorName, String ownerName, String repoName); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabGroupsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabGroupsClient.java new file mode 100644 index 000000000000..8884096b831f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabGroupsClient.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.models.GitLabGroupInner; +import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; + +/** An instance of this class provides access to all the operations defined in GitLabGroupsClient. */ +public interface GitLabGroupsClient { + /** + * Returns a list of all GitLab groups accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAvailableWithResponse( + String resourceGroupName, String securityConnectorName, Context context); + + /** + * Returns a list of all GitLab groups accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GitLabGroupListResponseInner listAvailable(String resourceGroupName, String securityConnectorName); + + /** + * Returns a list of GitLab groups onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String securityConnectorName); + + /** + * Returns a list of GitLab groups onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); + + /** + * Returns a monitored GitLab Group resource for a given fully-qualified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitLab Group resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String securityConnectorName, String groupFQName, Context context); + + /** + * Returns a monitored GitLab Group resource for a given fully-qualified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitLab Group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GitLabGroupInner get(String resourceGroupName, String securityConnectorName, String groupFQName); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabProjectsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabProjectsClient.java new file mode 100644 index 000000000000..413456baa6e5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabProjectsClient.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.models.GitLabProjectInner; + +/** An instance of this class provides access to all the operations defined in GitLabProjectsClient. */ +public interface GitLabProjectsClient { + /** + * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of GitLab projects that are directly owned by given group and onboarded to the connector as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String securityConnectorName, String groupFQName); + + /** + * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 GitLab projects that are directly owned by given group and onboarded to the connector as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String securityConnectorName, String groupFQName, Context context); + + /** + * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @param projectName The project name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitLab Project resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String securityConnectorName, + String groupFQName, + String projectName, + Context context); + + /** + * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @param projectName The project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitLab Project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GitLabProjectInner get( + String resourceGroupName, String securityConnectorName, String groupFQName, String projectName); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabSubgroupsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabSubgroupsClient.java new file mode 100644 index 000000000000..8f1549117e5b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabSubgroupsClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.models.GitLabGroupListResponseInner; + +/** An instance of this class provides access to all the operations defined in GitLabSubgroupsClient. */ +public interface GitLabSubgroupsClient { + /** + * Gets nested subgroups of given GitLab Group which are onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nested subgroups of given GitLab Group which are onboarded to the connector along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String securityConnectorName, String groupFQName, Context context); + + /** + * Gets nested subgroups of given GitLab Group which are onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nested subgroups of given GitLab Group which are onboarded to the connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GitLabGroupListResponseInner list(String resourceGroupName, String securityConnectorName, String groupFQName); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportsClient.java index 57ee9785cfd2..ab86a82e0368 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportsClient.java @@ -7,6 +7,7 @@ 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.security.fluent.models.HealthReportInner; @@ -40,4 +41,31 @@ public interface HealthReportsClient { */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String scope, Context context); + + /** + * Get health report of resource. + * + * @param resourceId The identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health report of resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceId, String healthReportName, Context context); + + /** + * Get health report of resource. + * + * @param resourceId The identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health report of resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HealthReportInner get(String resourceId, String healthReportName); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IngestionSettingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IngestionSettingsClient.java deleted file mode 100644 index c0765e68586c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IngestionSettingsClient.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.models.ConnectionStringsInner; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingInner; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingTokenInner; - -/** An instance of this class provides access to all the operations defined in IngestionSettingsClient. */ -public interface IngestionSettingsClient { - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String ingestionSettingName, Context context); - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IngestionSettingInner get(String ingestionSettingName); - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String ingestionSettingName, IngestionSettingInner ingestionSetting, Context context); - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IngestionSettingInner create(String ingestionSettingName, IngestionSettingInner ingestionSetting); - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String ingestionSettingName, Context context); - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 ingestionSettingName); - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listTokensWithResponse(String ingestionSettingName, Context context); - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IngestionSettingTokenInner listTokens(String ingestionSettingName); - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listConnectionStringsWithResponse(String ingestionSettingName, Context context); - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionStringsInner listConnectionStrings(String ingestionSettingName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ResourceProvidersClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ResourceProvidersClient.java new file mode 100644 index 000000000000..099992cef0fa --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ResourceProvidersClient.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.models.GetSensitivitySettingsResponseInner; +import com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public interface ResourceProvidersClient { + /** + * Updates data sensitivity settings for sensitive data discovery. + * + * @param sensitivitySettings The data sensitivity settings to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateSensitivitySettingsWithResponse( + UpdateSensitivitySettingsRequest sensitivitySettings, Context context); + + /** + * Updates data sensitivity settings for sensitive data discovery. + * + * @param sensitivitySettings The data sensitivity settings to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GetSensitivitySettingsResponseInner updateSensitivitySettings(UpdateSensitivitySettingsRequest sensitivitySettings); + + /** + * Gets data sensitivity settings for sensitive data discovery. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getSensitivitySettingsWithResponse(Context context); + + /** + * Gets data sensitivity settings for sensitive data discovery. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GetSensitivitySettingsResponseInner getSensitivitySettings(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java index 3632a9b91815..544f5cb1dcb5 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java @@ -324,6 +324,20 @@ public interface SecurityCenter { */ ConnectorsClient getConnectors(); + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); + + /** + * Gets the SensitivitySettingsClient object to access its operations. + * + * @return the SensitivitySettingsClient object. + */ + SensitivitySettingsClient getSensitivitySettings(); + /** * Gets the AlertsClient object to access its operations. * @@ -338,13 +352,6 @@ public interface SecurityCenter { */ SettingsClient getSettings(); - /** - * Gets the IngestionSettingsClient object to access its operations. - * - * @return the IngestionSettingsClient object. - */ - IngestionSettingsClient getIngestionSettings(); - /** * Gets the SoftwareInventoriesClient object to access its operations. * @@ -402,18 +409,39 @@ public interface SecurityCenter { ApiCollectionsClient getApiCollections(); /** - * Gets the ApiCollectionOnboardingsClient object to access its operations. + * Gets the SqlVulnerabilityAssessmentScansClient object to access its operations. * - * @return the ApiCollectionOnboardingsClient object. + * @return the SqlVulnerabilityAssessmentScansClient object. */ - ApiCollectionOnboardingsClient getApiCollectionOnboardings(); + SqlVulnerabilityAssessmentScansClient getSqlVulnerabilityAssessmentScans(); /** - * Gets the ApiCollectionOffboardingsClient object to access its operations. + * Gets the SqlVulnerabilityAssessmentScanResultsClient object to access its operations. * - * @return the ApiCollectionOffboardingsClient object. + * @return the SqlVulnerabilityAssessmentScanResultsClient object. */ - ApiCollectionOffboardingsClient getApiCollectionOffboardings(); + SqlVulnerabilityAssessmentScanResultsClient getSqlVulnerabilityAssessmentScanResults(); + + /** + * Gets the SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. + * + * @return the SqlVulnerabilityAssessmentBaselineRulesClient object. + */ + SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessmentBaselineRules(); + + /** + * Gets the SecurityOperatorsClient object to access its operations. + * + * @return the SecurityOperatorsClient object. + */ + SecurityOperatorsClient getSecurityOperators(); + + /** + * Gets the ServerVulnerabilityAssessmentsSettingsClient object to access its operations. + * + * @return the ServerVulnerabilityAssessmentsSettingsClient object. + */ + ServerVulnerabilityAssessmentsSettingsClient getServerVulnerabilityAssessmentsSettings(); /** * Gets the HealthReportsClient object to access its operations. @@ -423,44 +451,86 @@ public interface SecurityCenter { HealthReportsClient getHealthReports(); /** - * Gets the HealthReportOperationsClient object to access its operations. + * Gets the DefenderForStoragesClient object to access its operations. * - * @return the HealthReportOperationsClient object. + * @return the DefenderForStoragesClient object. */ - HealthReportOperationsClient getHealthReportOperations(); + DefenderForStoragesClient getDefenderForStorages(); /** - * Gets the SqlVulnerabilityAssessmentScansClient object to access its operations. + * Gets the AzureDevOpsOrgsClient object to access its operations. * - * @return the SqlVulnerabilityAssessmentScansClient object. + * @return the AzureDevOpsOrgsClient object. */ - SqlVulnerabilityAssessmentScansClient getSqlVulnerabilityAssessmentScans(); + AzureDevOpsOrgsClient getAzureDevOpsOrgs(); /** - * Gets the SqlVulnerabilityAssessmentScanResultsClient object to access its operations. + * Gets the AzureDevOpsProjectsClient object to access its operations. * - * @return the SqlVulnerabilityAssessmentScanResultsClient object. + * @return the AzureDevOpsProjectsClient object. */ - SqlVulnerabilityAssessmentScanResultsClient getSqlVulnerabilityAssessmentScanResults(); + AzureDevOpsProjectsClient getAzureDevOpsProjects(); /** - * Gets the SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. + * Gets the AzureDevOpsReposClient object to access its operations. * - * @return the SqlVulnerabilityAssessmentBaselineRulesClient object. + * @return the AzureDevOpsReposClient object. */ - SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessmentBaselineRules(); + AzureDevOpsReposClient getAzureDevOpsRepos(); /** - * Gets the SecurityConnectorsClient object to access its operations. + * Gets the DevOpsConfigurationsClient object to access its operations. * - * @return the SecurityConnectorsClient object. + * @return the DevOpsConfigurationsClient object. */ - SecurityConnectorsClient getSecurityConnectors(); + DevOpsConfigurationsClient getDevOpsConfigurations(); /** - * Gets the SecurityOperatorsClient object to access its operations. + * Gets the GitHubOwnersClient object to access its operations. * - * @return the SecurityOperatorsClient object. + * @return the GitHubOwnersClient object. */ - SecurityOperatorsClient getSecurityOperators(); + GitHubOwnersClient getGitHubOwners(); + + /** + * Gets the GitHubReposClient object to access its operations. + * + * @return the GitHubReposClient object. + */ + GitHubReposClient getGitHubRepos(); + + /** + * Gets the GitLabGroupsClient object to access its operations. + * + * @return the GitLabGroupsClient object. + */ + GitLabGroupsClient getGitLabGroups(); + + /** + * Gets the GitLabSubgroupsClient object to access its operations. + * + * @return the GitLabSubgroupsClient object. + */ + GitLabSubgroupsClient getGitLabSubgroups(); + + /** + * Gets the GitLabProjectsClient object to access its operations. + * + * @return the GitLabProjectsClient object. + */ + GitLabProjectsClient getGitLabProjects(); + + /** + * Gets the DevOpsOperationResultsClient object to access its operations. + * + * @return the DevOpsOperationResultsClient object. + */ + DevOpsOperationResultsClient getDevOpsOperationResults(); + + /** + * Gets the SecurityConnectorsClient object to access its operations. + * + * @return the SecurityConnectorsClient object. + */ + SecurityConnectorsClient getSecurityConnectors(); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportOperationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SensitivitySettingsClient.java similarity index 56% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportOperationsClient.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SensitivitySettingsClient.java index 9127fc7b309b..600866a35bde 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportOperationsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SensitivitySettingsClient.java @@ -8,34 +8,29 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.HealthReportInner; +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; -/** An instance of this class provides access to all the operations defined in HealthReportOperationsClient. */ -public interface HealthReportOperationsClient { +/** An instance of this class provides access to all the operations defined in SensitivitySettingsClient. */ +public interface SensitivitySettingsClient { /** - * Get health report of resource. + * Gets a list with a single sensitivity settings resource. * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource along with {@link Response}. + * @return a list with a single sensitivity settings resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceId, String healthReportName, Context context); + Response listWithResponse(Context context); /** - * Get health report of resource. + * Gets a list with a single sensitivity settings resource. * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource. + * @return a list with a single sensitivity settings resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - HealthReportInner get(String resourceId, String healthReportName); + GetSensitivitySettingsListResponseInner list(); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsSettingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsSettingsClient.java new file mode 100644 index 000000000000..88643e1d8c6f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsSettingsClient.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.models.ServerVulnerabilityAssessmentsSettingInner; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; + +/** + * An instance of this class provides access to all the operations defined in + * ServerVulnerabilityAssessmentsSettingsClient. + */ +public interface ServerVulnerabilityAssessmentsSettingsClient { + /** + * Get a list of all the server vulnerability assessments settings over a subscription level scope. + * + * @throws com.azure.core.management.exception.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 all the server vulnerability assessments settings over a subscription level scope as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get a list of all the server vulnerability assessments settings over a subscription level scope. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 all the server vulnerability assessments settings over a subscription level scope as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get a server vulnerability assessments setting of the requested kind, that is set on the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 server vulnerability assessments setting of the requested kind, that is set on the subscription along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + ServerVulnerabilityAssessmentsSettingKindName settingKind, Context context); + + /** + * Get a server vulnerability assessments setting of the requested kind, that is set on the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 server vulnerability assessments setting of the requested kind, that is set on the subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerVulnerabilityAssessmentsSettingInner get(ServerVulnerabilityAssessmentsSettingKindName settingKind); + + /** + * Create or update a server vulnerability assessments setting of the requested kind on the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @param serverVulnerabilityAssessmentsSetting A server vulnerability assessments setting over a predefined scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 base vulnerability assessments setting on servers in the defined scope along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + ServerVulnerabilityAssessmentsSettingKindName settingKind, + ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting, + Context context); + + /** + * Create or update a server vulnerability assessments setting of the requested kind on the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @param serverVulnerabilityAssessmentsSetting A server vulnerability assessments setting over a predefined scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 base vulnerability assessments setting on servers in the defined scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerVulnerabilityAssessmentsSettingInner createOrUpdate( + ServerVulnerabilityAssessmentsSettingKindName settingKind, + ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting); + + /** + * Delete the server vulnerability assessments setting of the requested kind from the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(ServerVulnerabilityAssessmentsSettingKindName settingKind, Context context); + + /** + * Delete the server vulnerability assessments setting of the requested kind from the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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(ServerVulnerabilityAssessmentsSettingKindName settingKind); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionInner.java new file mode 100644 index 000000000000..991e370d2b2a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionInner.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.security.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An API collection as represented by Microsoft Defender for APIs. */ +@Immutable +public final class ApiCollectionInner extends ProxyResource { + /* + * Describes the properties of an API collection. + */ + @JsonProperty(value = "properties") + private ApiCollectionProperties innerProperties; + + /** Creates an instance of ApiCollectionInner class. */ + public ApiCollectionInner() { + } + + /** + * Get the innerProperties property: Describes the properties of an API collection. + * + * @return the innerProperties value. + */ + private ApiCollectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the API collection. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the displayName property: The display name of the API collection. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Get the discoveredVia property: The resource Id of the resource from where this API collection was discovered. + * + * @return the discoveredVia value. + */ + public String discoveredVia() { + return this.innerProperties() == null ? null : this.innerProperties().discoveredVia(); + } + + /** + * Get the baseUrl property: The base URI for this API collection. All endpoints of this API collection extend this + * base URI. + * + * @return the baseUrl value. + */ + public String baseUrl() { + return this.innerProperties() == null ? null : this.innerProperties().baseUrl(); + } + + /** + * Get the numberOfApiEndpoints property: The number of API endpoints discovered in this API collection. + * + * @return the numberOfApiEndpoints value. + */ + public Long numberOfApiEndpoints() { + return this.innerProperties() == null ? null : this.innerProperties().numberOfApiEndpoints(); + } + + /** + * Get the numberOfInactiveApiEndpoints property: The number of API endpoints in this API collection that have not + * received any API traffic in the last 30 days. + * + * @return the numberOfInactiveApiEndpoints value. + */ + public Long numberOfInactiveApiEndpoints() { + return this.innerProperties() == null ? null : this.innerProperties().numberOfInactiveApiEndpoints(); + } + + /** + * Get the numberOfUnauthenticatedApiEndpoints property: The number of API endpoints in this API collection that are + * unauthenticated. + * + * @return the numberOfUnauthenticatedApiEndpoints value. + */ + public Long numberOfUnauthenticatedApiEndpoints() { + return this.innerProperties() == null ? null : this.innerProperties().numberOfUnauthenticatedApiEndpoints(); + } + + /** + * Get the numberOfExternalApiEndpoints property: The number of API endpoints in this API collection for which API + * traffic from the internet was observed. + * + * @return the numberOfExternalApiEndpoints value. + */ + public Long numberOfExternalApiEndpoints() { + return this.innerProperties() == null ? null : this.innerProperties().numberOfExternalApiEndpoints(); + } + + /** + * Get the numberOfApiEndpointsWithSensitiveDataExposed property: The number of API endpoints in this API collection + * which are exposing sensitive data in their requests and/or responses. + * + * @return the numberOfApiEndpointsWithSensitiveDataExposed value. + */ + public Long numberOfApiEndpointsWithSensitiveDataExposed() { + return this.innerProperties() == null + ? null + : this.innerProperties().numberOfApiEndpointsWithSensitiveDataExposed(); + } + + /** + * Get the sensitivityLabel property: The highest priority sensitivity label from Microsoft Purview in this API + * collection. + * + * @return the sensitivityLabel value. + */ + public String sensitivityLabel() { + return this.innerProperties() == null ? null : this.innerProperties().sensitivityLabel(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionProperties.java index 951e62c71a5c..1b031de018a9 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionProperties.java @@ -4,33 +4,89 @@ package com.azure.resourcemanager.security.fluent.models; -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.security.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; /** Describes the properties of an API collection. */ -@Fluent +@Immutable public final class ApiCollectionProperties { /* - * The display name of the Azure API Management API. + * Gets the provisioning state of the API collection. */ - @JsonProperty(value = "displayName") + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The display name of the API collection. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) private String displayName; /* - * Additional data regarding the API collection. + * The resource Id of the resource from where this API collection was discovered. + */ + @JsonProperty(value = "discoveredVia", access = JsonProperty.Access.WRITE_ONLY) + private String discoveredVia; + + /* + * The base URI for this API collection. All endpoints of this API collection extend this base URI. + */ + @JsonProperty(value = "baseUrl", access = JsonProperty.Access.WRITE_ONLY) + private String baseUrl; + + /* + * The number of API endpoints discovered in this API collection. */ - @JsonProperty(value = "additionalData") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map additionalData; + @JsonProperty(value = "numberOfApiEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfApiEndpoints; + + /* + * The number of API endpoints in this API collection that have not received any API traffic in the last 30 days. + */ + @JsonProperty(value = "numberOfInactiveApiEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfInactiveApiEndpoints; + + /* + * The number of API endpoints in this API collection that are unauthenticated. + */ + @JsonProperty(value = "numberOfUnauthenticatedApiEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfUnauthenticatedApiEndpoints; + + /* + * The number of API endpoints in this API collection for which API traffic from the internet was observed. + */ + @JsonProperty(value = "numberOfExternalApiEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfExternalApiEndpoints; + + /* + * The number of API endpoints in this API collection which are exposing sensitive data in their requests and/or + * responses. + */ + @JsonProperty(value = "numberOfApiEndpointsWithSensitiveDataExposed", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfApiEndpointsWithSensitiveDataExposed; + + /* + * The highest priority sensitivity label from Microsoft Purview in this API collection. + */ + @JsonProperty(value = "sensitivityLabel", access = JsonProperty.Access.WRITE_ONLY) + private String sensitivityLabel; /** Creates an instance of ApiCollectionProperties class. */ public ApiCollectionProperties() { } /** - * Get the displayName property: The display name of the Azure API Management API. + * Get the provisioningState property: Gets the provisioning state of the API collection. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the displayName property: The display name of the API collection. * * @return the displayName value. */ @@ -39,34 +95,81 @@ public String displayName() { } /** - * Set the displayName property: The display name of the Azure API Management API. + * Get the discoveredVia property: The resource Id of the resource from where this API collection was discovered. + * + * @return the discoveredVia value. + */ + public String discoveredVia() { + return this.discoveredVia; + } + + /** + * Get the baseUrl property: The base URI for this API collection. All endpoints of this API collection extend this + * base URI. + * + * @return the baseUrl value. + */ + public String baseUrl() { + return this.baseUrl; + } + + /** + * Get the numberOfApiEndpoints property: The number of API endpoints discovered in this API collection. + * + * @return the numberOfApiEndpoints value. + */ + public Long numberOfApiEndpoints() { + return this.numberOfApiEndpoints; + } + + /** + * Get the numberOfInactiveApiEndpoints property: The number of API endpoints in this API collection that have not + * received any API traffic in the last 30 days. + * + * @return the numberOfInactiveApiEndpoints value. + */ + public Long numberOfInactiveApiEndpoints() { + return this.numberOfInactiveApiEndpoints; + } + + /** + * Get the numberOfUnauthenticatedApiEndpoints property: The number of API endpoints in this API collection that are + * unauthenticated. + * + * @return the numberOfUnauthenticatedApiEndpoints value. + */ + public Long numberOfUnauthenticatedApiEndpoints() { + return this.numberOfUnauthenticatedApiEndpoints; + } + + /** + * Get the numberOfExternalApiEndpoints property: The number of API endpoints in this API collection for which API + * traffic from the internet was observed. * - * @param displayName the displayName value to set. - * @return the ApiCollectionProperties object itself. + * @return the numberOfExternalApiEndpoints value. */ - public ApiCollectionProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; + public Long numberOfExternalApiEndpoints() { + return this.numberOfExternalApiEndpoints; } /** - * Get the additionalData property: Additional data regarding the API collection. + * Get the numberOfApiEndpointsWithSensitiveDataExposed property: The number of API endpoints in this API collection + * which are exposing sensitive data in their requests and/or responses. * - * @return the additionalData value. + * @return the numberOfApiEndpointsWithSensitiveDataExposed value. */ - public Map additionalData() { - return this.additionalData; + public Long numberOfApiEndpointsWithSensitiveDataExposed() { + return this.numberOfApiEndpointsWithSensitiveDataExposed; } /** - * Set the additionalData property: Additional data regarding the API collection. + * Get the sensitivityLabel property: The highest priority sensitivity label from Microsoft Purview in this API + * collection. * - * @param additionalData the additionalData value to set. - * @return the ApiCollectionProperties object itself. + * @return the sensitivityLabel value. */ - public ApiCollectionProperties withAdditionalData(Map additionalData) { - this.additionalData = additionalData; - return this; + public String sensitivityLabel() { + return this.sensitivityLabel; } /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionResponseInner.java deleted file mode 100644 index 6224a7ea4eb4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionResponseInner.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** An API collection as represented by Defender for APIs. */ -@Fluent -public final class ApiCollectionResponseInner extends ProxyResource { - /* - * Describes the properties of an API collection. - */ - @JsonProperty(value = "properties") - private ApiCollectionProperties innerProperties; - - /** Creates an instance of ApiCollectionResponseInner class. */ - public ApiCollectionResponseInner() { - } - - /** - * Get the innerProperties property: Describes the properties of an API collection. - * - * @return the innerProperties value. - */ - private ApiCollectionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the displayName property: The display name of the Azure API Management API. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: The display name of the Azure API Management API. - * - * @param displayName the displayName value to set. - * @return the ApiCollectionResponseInner object itself. - */ - public ApiCollectionResponseInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new ApiCollectionProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the additionalData property: Additional data regarding the API collection. - * - * @return the additionalData value. - */ - public Map additionalData() { - return this.innerProperties() == null ? null : this.innerProperties().additionalData(); - } - - /** - * Set the additionalData property: Additional data regarding the API collection. - * - * @param additionalData the additionalData value to set. - * @return the ApiCollectionResponseInner object itself. - */ - public ApiCollectionResponseInner withAdditionalData(Map additionalData) { - if (this.innerProperties() == null) { - this.innerProperties = new ApiCollectionProperties(); - } - this.innerProperties().withAdditionalData(additionalData); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgInner.java new file mode 100644 index 000000000000..b4da9a4a6e2a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.security.models.AzureDevOpsOrgProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure DevOps Organization resource. */ +@Fluent +public final class AzureDevOpsOrgInner extends ProxyResource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Azure DevOps Organization properties. + */ + @JsonProperty(value = "properties") + private AzureDevOpsOrgProperties properties; + + /** Creates an instance of AzureDevOpsOrgInner class. */ + public AzureDevOpsOrgInner() { + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the properties property: Azure DevOps Organization properties. + * + * @return the properties value. + */ + public AzureDevOpsOrgProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Azure DevOps Organization properties. + * + * @param properties the properties value to set. + * @return the AzureDevOpsOrgInner object itself. + */ + public AzureDevOpsOrgInner withProperties(AzureDevOpsOrgProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgListResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgListResponseInner.java new file mode 100644 index 000000000000..0c2e692bbd0a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgListResponseInner.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of RP resources which supports pagination. */ +@Fluent +public final class AzureDevOpsOrgListResponseInner { + /* + * Gets or sets list of resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets next link to scroll over the results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of AzureDevOpsOrgListResponseInner class. */ + public AzureDevOpsOrgListResponseInner() { + } + + /** + * Get the value property: Gets or sets list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets list of resources. + * + * @param value the value value to set. + * @return the AzureDevOpsOrgListResponseInner object itself. + */ + public AzureDevOpsOrgListResponseInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets next link to scroll over the results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets next link to scroll over the results. + * + * @param nextLink the nextLink value to set. + * @return the AzureDevOpsOrgListResponseInner object itself. + */ + public AzureDevOpsOrgListResponseInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsProjectInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsProjectInner.java new file mode 100644 index 000000000000..003c0f4e98df --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsProjectInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.security.models.AzureDevOpsProjectProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure DevOps Project resource. */ +@Fluent +public final class AzureDevOpsProjectInner extends ProxyResource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Azure DevOps Project properties. + */ + @JsonProperty(value = "properties") + private AzureDevOpsProjectProperties properties; + + /** Creates an instance of AzureDevOpsProjectInner class. */ + public AzureDevOpsProjectInner() { + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the properties property: Azure DevOps Project properties. + * + * @return the properties value. + */ + public AzureDevOpsProjectProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Azure DevOps Project properties. + * + * @param properties the properties value to set. + * @return the AzureDevOpsProjectInner object itself. + */ + public AzureDevOpsProjectInner withProperties(AzureDevOpsProjectProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsRepositoryInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsRepositoryInner.java new file mode 100644 index 000000000000..2d4233411ad8 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsRepositoryInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.security.models.AzureDevOpsRepositoryProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure DevOps Repository resource. */ +@Fluent +public final class AzureDevOpsRepositoryInner extends ProxyResource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Azure DevOps Repository properties. + */ + @JsonProperty(value = "properties") + private AzureDevOpsRepositoryProperties properties; + + /** Creates an instance of AzureDevOpsRepositoryInner class. */ + public AzureDevOpsRepositoryInner() { + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the properties property: Azure DevOps Repository properties. + * + * @return the properties value. + */ + public AzureDevOpsRepositoryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Azure DevOps Repository properties. + * + * @param properties the properties value to set. + * @return the AzureDevOpsRepositoryInner object itself. + */ + public AzureDevOpsRepositoryInner withProperties(AzureDevOpsRepositoryProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectionStringsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectionStringsInner.java deleted file mode 100644 index 4e21ee921fae..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectionStringsInner.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.IngestionConnectionString; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Connection string for ingesting security data and logs. */ -@Fluent -public final class ConnectionStringsInner { - /* - * Connection strings - */ - @JsonProperty(value = "value", required = true) - private List value; - - /** Creates an instance of ConnectionStringsInner class. */ - public ConnectionStringsInner() { - } - - /** - * Get the value property: Connection strings. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Connection strings. - * - * @param value the value value to set. - * @return the ConnectionStringsInner object itself. - */ - public ConnectionStringsInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ConnectionStringsInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ConnectionStringsInner.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingInner.java new file mode 100644 index 000000000000..4a5809d19fc9 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingInner.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.security.models.OperationStatusAutoGenerated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Defender for Storage resource. */ +@Fluent +public final class DefenderForStorageSettingInner extends ProxyResource { + /* + * Defender for Storage resource properties. + */ + @JsonProperty(value = "properties") + private DefenderForStorageSettingProperties innerProperties; + + /** Creates an instance of DefenderForStorageSettingInner class. */ + public DefenderForStorageSettingInner() { + } + + /** + * Get the innerProperties property: Defender for Storage resource properties. + * + * @return the innerProperties value. + */ + private DefenderForStorageSettingProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the isEnabled property: Indicates whether Defender for Storage is enabled on this storage account. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isEnabled(); + } + + /** + * Set the isEnabled property: Indicates whether Defender for Storage is enabled on this storage account. + * + * @param isEnabled the isEnabled value to set. + * @return the DefenderForStorageSettingInner object itself. + */ + public DefenderForStorageSettingInner withIsEnabled(Boolean isEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new DefenderForStorageSettingProperties(); + } + this.innerProperties().withIsEnabled(isEnabled); + return this; + } + + /** + * Get the overrideSubscriptionLevelSettings property: Indicates whether the settings defined for this storage + * account should override the settings defined for the subscription. + * + * @return the overrideSubscriptionLevelSettings value. + */ + public Boolean overrideSubscriptionLevelSettings() { + return this.innerProperties() == null ? null : this.innerProperties().overrideSubscriptionLevelSettings(); + } + + /** + * Set the overrideSubscriptionLevelSettings property: Indicates whether the settings defined for this storage + * account should override the settings defined for the subscription. + * + * @param overrideSubscriptionLevelSettings the overrideSubscriptionLevelSettings value to set. + * @return the DefenderForStorageSettingInner object itself. + */ + public DefenderForStorageSettingInner withOverrideSubscriptionLevelSettings( + Boolean overrideSubscriptionLevelSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new DefenderForStorageSettingProperties(); + } + this.innerProperties().withOverrideSubscriptionLevelSettings(overrideSubscriptionLevelSettings); + return this; + } + + /** + * Get the scanResultsEventGridTopicResourceId property: Optional. Resource id of an Event Grid Topic to send scan + * results to. + * + * @return the scanResultsEventGridTopicResourceId value. + */ + public String scanResultsEventGridTopicResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().scanResultsEventGridTopicResourceId(); + } + + /** + * Set the scanResultsEventGridTopicResourceId property: Optional. Resource id of an Event Grid Topic to send scan + * results to. + * + * @param scanResultsEventGridTopicResourceId the scanResultsEventGridTopicResourceId value to set. + * @return the DefenderForStorageSettingInner object itself. + */ + public DefenderForStorageSettingInner withScanResultsEventGridTopicResourceId( + String scanResultsEventGridTopicResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new DefenderForStorageSettingProperties(); + } + this.innerProperties().withScanResultsEventGridTopicResourceId(scanResultsEventGridTopicResourceId); + return this; + } + + /** + * Get the operationStatus property: Upon failure or partial success. Additional data describing Malware Scanning + * enable/disable operation. + * + * @return the operationStatus value. + */ + public OperationStatusAutoGenerated operationStatus() { + return this.innerProperties() == null ? null : this.innerProperties().operationStatus(); + } + + /** + * Get the isEnabledMalwareScanningIsEnabled property: Indicates whether On Upload malware scanning should be + * enabled. + * + * @return the isEnabledMalwareScanningIsEnabled value. + */ + public Boolean isEnabledMalwareScanningIsEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isEnabledMalwareScanningIsEnabled(); + } + + /** + * Set the isEnabledMalwareScanningIsEnabled property: Indicates whether On Upload malware scanning should be + * enabled. + * + * @param isEnabledMalwareScanningIsEnabled the isEnabledMalwareScanningIsEnabled value to set. + * @return the DefenderForStorageSettingInner object itself. + */ + public DefenderForStorageSettingInner withIsEnabledMalwareScanningIsEnabled( + Boolean isEnabledMalwareScanningIsEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new DefenderForStorageSettingProperties(); + } + this.innerProperties().withIsEnabledMalwareScanningIsEnabled(isEnabledMalwareScanningIsEnabled); + return this; + } + + /** + * Get the capGBPerMonth property: Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + * + * @return the capGBPerMonth value. + */ + public Integer capGBPerMonth() { + return this.innerProperties() == null ? null : this.innerProperties().capGBPerMonth(); + } + + /** + * Set the capGBPerMonth property: Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + * + * @param capGBPerMonth the capGBPerMonth value to set. + * @return the DefenderForStorageSettingInner object itself. + */ + public DefenderForStorageSettingInner withCapGBPerMonth(Integer capGBPerMonth) { + if (this.innerProperties() == null) { + this.innerProperties = new DefenderForStorageSettingProperties(); + } + this.innerProperties().withCapGBPerMonth(capGBPerMonth); + return this; + } + + /** + * Get the isEnabledSensitiveDataDiscoveryIsEnabled property: Indicates whether Sensitive Data Discovery should be + * enabled. + * + * @return the isEnabledSensitiveDataDiscoveryIsEnabled value. + */ + public Boolean isEnabledSensitiveDataDiscoveryIsEnabled() { + return this.innerProperties() == null + ? null + : this.innerProperties().isEnabledSensitiveDataDiscoveryIsEnabled(); + } + + /** + * Set the isEnabledSensitiveDataDiscoveryIsEnabled property: Indicates whether Sensitive Data Discovery should be + * enabled. + * + * @param isEnabledSensitiveDataDiscoveryIsEnabled the isEnabledSensitiveDataDiscoveryIsEnabled value to set. + * @return the DefenderForStorageSettingInner object itself. + */ + public DefenderForStorageSettingInner withIsEnabledSensitiveDataDiscoveryIsEnabled( + Boolean isEnabledSensitiveDataDiscoveryIsEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new DefenderForStorageSettingProperties(); + } + this.innerProperties().withIsEnabledSensitiveDataDiscoveryIsEnabled(isEnabledSensitiveDataDiscoveryIsEnabled); + return this; + } + + /** + * Get the operationStatusSensitiveDataDiscoveryOperationStatus property: Upon failure or partial success. + * Additional data describing Sensitive Data Discovery enable/disable operation. + * + * @return the operationStatusSensitiveDataDiscoveryOperationStatus value. + */ + public OperationStatusAutoGenerated operationStatusSensitiveDataDiscoveryOperationStatus() { + return this.innerProperties() == null + ? null + : this.innerProperties().operationStatusSensitiveDataDiscoveryOperationStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingProperties.java new file mode 100644 index 000000000000..db3349e34512 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingProperties.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.security.models.OperationStatusAutoGenerated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defender for Storage resource properties. */ +@Fluent +public final class DefenderForStorageSettingProperties { + /* + * Indicates whether Defender for Storage is enabled on this storage account. + */ + @JsonProperty(value = "isEnabled") + private Boolean isEnabled; + + /* + * Properties of Malware Scanning. + */ + @JsonProperty(value = "malwareScanning") + private MalwareScanningProperties innerMalwareScanning; + + /* + * Properties of Sensitive Data Discovery. + */ + @JsonProperty(value = "sensitiveDataDiscovery") + private SensitiveDataDiscoveryProperties innerSensitiveDataDiscovery; + + /* + * Indicates whether the settings defined for this storage account should override the settings defined for the + * subscription. + */ + @JsonProperty(value = "overrideSubscriptionLevelSettings") + private Boolean overrideSubscriptionLevelSettings; + + /** Creates an instance of DefenderForStorageSettingProperties class. */ + public DefenderForStorageSettingProperties() { + } + + /** + * Get the isEnabled property: Indicates whether Defender for Storage is enabled on this storage account. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set the isEnabled property: Indicates whether Defender for Storage is enabled on this storage account. + * + * @param isEnabled the isEnabled value to set. + * @return the DefenderForStorageSettingProperties object itself. + */ + public DefenderForStorageSettingProperties withIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get the innerMalwareScanning property: Properties of Malware Scanning. + * + * @return the innerMalwareScanning value. + */ + private MalwareScanningProperties innerMalwareScanning() { + return this.innerMalwareScanning; + } + + /** + * Get the innerSensitiveDataDiscovery property: Properties of Sensitive Data Discovery. + * + * @return the innerSensitiveDataDiscovery value. + */ + private SensitiveDataDiscoveryProperties innerSensitiveDataDiscovery() { + return this.innerSensitiveDataDiscovery; + } + + /** + * Get the overrideSubscriptionLevelSettings property: Indicates whether the settings defined for this storage + * account should override the settings defined for the subscription. + * + * @return the overrideSubscriptionLevelSettings value. + */ + public Boolean overrideSubscriptionLevelSettings() { + return this.overrideSubscriptionLevelSettings; + } + + /** + * Set the overrideSubscriptionLevelSettings property: Indicates whether the settings defined for this storage + * account should override the settings defined for the subscription. + * + * @param overrideSubscriptionLevelSettings the overrideSubscriptionLevelSettings value to set. + * @return the DefenderForStorageSettingProperties object itself. + */ + public DefenderForStorageSettingProperties withOverrideSubscriptionLevelSettings( + Boolean overrideSubscriptionLevelSettings) { + this.overrideSubscriptionLevelSettings = overrideSubscriptionLevelSettings; + return this; + } + + /** + * Get the scanResultsEventGridTopicResourceId property: Optional. Resource id of an Event Grid Topic to send scan + * results to. + * + * @return the scanResultsEventGridTopicResourceId value. + */ + public String scanResultsEventGridTopicResourceId() { + return this.innerMalwareScanning() == null + ? null + : this.innerMalwareScanning().scanResultsEventGridTopicResourceId(); + } + + /** + * Set the scanResultsEventGridTopicResourceId property: Optional. Resource id of an Event Grid Topic to send scan + * results to. + * + * @param scanResultsEventGridTopicResourceId the scanResultsEventGridTopicResourceId value to set. + * @return the DefenderForStorageSettingProperties object itself. + */ + public DefenderForStorageSettingProperties withScanResultsEventGridTopicResourceId( + String scanResultsEventGridTopicResourceId) { + if (this.innerMalwareScanning() == null) { + this.innerMalwareScanning = new MalwareScanningProperties(); + } + this.innerMalwareScanning().withScanResultsEventGridTopicResourceId(scanResultsEventGridTopicResourceId); + return this; + } + + /** + * Get the operationStatus property: Upon failure or partial success. Additional data describing Malware Scanning + * enable/disable operation. + * + * @return the operationStatus value. + */ + public OperationStatusAutoGenerated operationStatus() { + return this.innerMalwareScanning() == null ? null : this.innerMalwareScanning().operationStatus(); + } + + /** + * Get the isEnabled property: Indicates whether On Upload malware scanning should be enabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabledMalwareScanningIsEnabled() { + return this.innerMalwareScanning() == null ? null : this.innerMalwareScanning().isEnabled(); + } + + /** + * Set the isEnabled property: Indicates whether On Upload malware scanning should be enabled. + * + * @param isEnabled the isEnabled value to set. + * @return the DefenderForStorageSettingProperties object itself. + */ + public DefenderForStorageSettingProperties withIsEnabledMalwareScanningIsEnabled(Boolean isEnabled) { + if (this.innerMalwareScanning() == null) { + this.innerMalwareScanning = new MalwareScanningProperties(); + } + this.innerMalwareScanning().withIsEnabled(isEnabled); + return this; + } + + /** + * Get the capGBPerMonth property: Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + * + * @return the capGBPerMonth value. + */ + public Integer capGBPerMonth() { + return this.innerMalwareScanning() == null ? null : this.innerMalwareScanning().capGBPerMonth(); + } + + /** + * Set the capGBPerMonth property: Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + * + * @param capGBPerMonth the capGBPerMonth value to set. + * @return the DefenderForStorageSettingProperties object itself. + */ + public DefenderForStorageSettingProperties withCapGBPerMonth(Integer capGBPerMonth) { + if (this.innerMalwareScanning() == null) { + this.innerMalwareScanning = new MalwareScanningProperties(); + } + this.innerMalwareScanning().withCapGBPerMonth(capGBPerMonth); + return this; + } + + /** + * Get the isEnabled property: Indicates whether Sensitive Data Discovery should be enabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabledSensitiveDataDiscoveryIsEnabled() { + return this.innerSensitiveDataDiscovery() == null ? null : this.innerSensitiveDataDiscovery().isEnabled(); + } + + /** + * Set the isEnabled property: Indicates whether Sensitive Data Discovery should be enabled. + * + * @param isEnabled the isEnabled value to set. + * @return the DefenderForStorageSettingProperties object itself. + */ + public DefenderForStorageSettingProperties withIsEnabledSensitiveDataDiscoveryIsEnabled(Boolean isEnabled) { + if (this.innerSensitiveDataDiscovery() == null) { + this.innerSensitiveDataDiscovery = new SensitiveDataDiscoveryProperties(); + } + this.innerSensitiveDataDiscovery().withIsEnabled(isEnabled); + return this; + } + + /** + * Get the operationStatus property: Upon failure or partial success. Additional data describing Sensitive Data + * Discovery enable/disable operation. + * + * @return the operationStatus value. + */ + public OperationStatusAutoGenerated operationStatusSensitiveDataDiscoveryOperationStatus() { + return this.innerSensitiveDataDiscovery() == null ? null : this.innerSensitiveDataDiscovery().operationStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerMalwareScanning() != null) { + innerMalwareScanning().validate(); + } + if (innerSensitiveDataDiscovery() != null) { + innerSensitiveDataDiscovery().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DevOpsConfigurationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DevOpsConfigurationInner.java new file mode 100644 index 000000000000..f32a28a5accc --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DevOpsConfigurationInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.security.models.DevOpsConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** DevOps Configuration resource. */ +@Fluent +public final class DevOpsConfigurationInner extends ProxyResource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * DevOps Configuration properties. + */ + @JsonProperty(value = "properties") + private DevOpsConfigurationProperties properties; + + /** Creates an instance of DevOpsConfigurationInner class. */ + public DevOpsConfigurationInner() { + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the properties property: DevOps Configuration properties. + * + * @return the properties value. + */ + public DevOpsConfigurationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: DevOps Configuration properties. + * + * @param properties the properties value to set. + * @return the DevOpsConfigurationInner object itself. + */ + public DevOpsConfigurationInner withProperties(DevOpsConfigurationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsListResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsListResponseInner.java new file mode 100644 index 000000000000..0e2bf79a0bd5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsListResponseInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list with a single sensitivity settings resource. */ +@Fluent +public final class GetSensitivitySettingsListResponseInner { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of GetSensitivitySettingsListResponseInner class. */ + public GetSensitivitySettingsListResponseInner() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the GetSensitivitySettingsListResponseInner object itself. + */ + public GetSensitivitySettingsListResponseInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsResponseInner.java new file mode 100644 index 000000000000..b1418837f06b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsResponseInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponseProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Data sensitivity settings for sensitive data discovery. */ +@Fluent +public final class GetSensitivitySettingsResponseInner extends ProxyResource { + /* + * The sensitivity settings properties + */ + @JsonProperty(value = "properties") + private GetSensitivitySettingsResponseProperties properties; + + /** Creates an instance of GetSensitivitySettingsResponseInner class. */ + public GetSensitivitySettingsResponseInner() { + } + + /** + * Get the properties property: The sensitivity settings properties. + * + * @return the properties value. + */ + public GetSensitivitySettingsResponseProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The sensitivity settings properties. + * + * @param properties the properties value to set. + * @return the GetSensitivitySettingsResponseInner object itself. + */ + public GetSensitivitySettingsResponseInner withProperties(GetSensitivitySettingsResponseProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerInner.java new file mode 100644 index 000000000000..cba72af3bc9d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.security.models.GitHubOwnerProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** GitHub Owner resource. */ +@Fluent +public final class GitHubOwnerInner extends ProxyResource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * GitHub Owner properties. + */ + @JsonProperty(value = "properties") + private GitHubOwnerProperties properties; + + /** Creates an instance of GitHubOwnerInner class. */ + public GitHubOwnerInner() { + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the properties property: GitHub Owner properties. + * + * @return the properties value. + */ + public GitHubOwnerProperties properties() { + return this.properties; + } + + /** + * Set the properties property: GitHub Owner properties. + * + * @param properties the properties value to set. + * @return the GitHubOwnerInner object itself. + */ + public GitHubOwnerInner withProperties(GitHubOwnerProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerListResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerListResponseInner.java new file mode 100644 index 000000000000..3ecc4dec827a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerListResponseInner.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of RP resources which supports pagination. */ +@Fluent +public final class GitHubOwnerListResponseInner { + /* + * Gets or sets list of resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets next link to scroll over the results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of GitHubOwnerListResponseInner class. */ + public GitHubOwnerListResponseInner() { + } + + /** + * Get the value property: Gets or sets list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets list of resources. + * + * @param value the value value to set. + * @return the GitHubOwnerListResponseInner object itself. + */ + public GitHubOwnerListResponseInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets next link to scroll over the results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets next link to scroll over the results. + * + * @param nextLink the nextLink value to set. + * @return the GitHubOwnerListResponseInner object itself. + */ + public GitHubOwnerListResponseInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubRepositoryInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubRepositoryInner.java new file mode 100644 index 000000000000..8cfaf36c6a2b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubRepositoryInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.security.models.GitHubRepositoryProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** GitHub Repository resource. */ +@Fluent +public final class GitHubRepositoryInner extends ProxyResource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * GitHub Repository properties. + */ + @JsonProperty(value = "properties") + private GitHubRepositoryProperties properties; + + /** Creates an instance of GitHubRepositoryInner class. */ + public GitHubRepositoryInner() { + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the properties property: GitHub Repository properties. + * + * @return the properties value. + */ + public GitHubRepositoryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: GitHub Repository properties. + * + * @param properties the properties value to set. + * @return the GitHubRepositoryInner object itself. + */ + public GitHubRepositoryInner withProperties(GitHubRepositoryProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupInner.java new file mode 100644 index 000000000000..bd590fa17108 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.security.models.GitLabGroupProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** GitLab Group resource. */ +@Fluent +public final class GitLabGroupInner extends ProxyResource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * GitLab Group properties. + */ + @JsonProperty(value = "properties") + private GitLabGroupProperties properties; + + /** Creates an instance of GitLabGroupInner class. */ + public GitLabGroupInner() { + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the properties property: GitLab Group properties. + * + * @return the properties value. + */ + public GitLabGroupProperties properties() { + return this.properties; + } + + /** + * Set the properties property: GitLab Group properties. + * + * @param properties the properties value to set. + * @return the GitLabGroupInner object itself. + */ + public GitLabGroupInner withProperties(GitLabGroupProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupListResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupListResponseInner.java new file mode 100644 index 000000000000..300bd853a62a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupListResponseInner.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of RP resources which supports pagination. */ +@Fluent +public final class GitLabGroupListResponseInner { + /* + * Gets or sets list of resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets next link to scroll over the results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of GitLabGroupListResponseInner class. */ + public GitLabGroupListResponseInner() { + } + + /** + * Get the value property: Gets or sets list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets list of resources. + * + * @param value the value value to set. + * @return the GitLabGroupListResponseInner object itself. + */ + public GitLabGroupListResponseInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets next link to scroll over the results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets next link to scroll over the results. + * + * @param nextLink the nextLink value to set. + * @return the GitLabGroupListResponseInner object itself. + */ + public GitLabGroupListResponseInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabProjectInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabProjectInner.java new file mode 100644 index 000000000000..99447a1a92a4 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabProjectInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.security.models.GitLabProjectProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** GitLab Project resource. */ +@Fluent +public final class GitLabProjectInner extends ProxyResource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * GitLab Project properties. + */ + @JsonProperty(value = "properties") + private GitLabProjectProperties properties; + + /** Creates an instance of GitLabProjectInner class. */ + public GitLabProjectInner() { + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the properties property: GitLab Project properties. + * + * @return the properties value. + */ + public GitLabProjectProperties properties() { + return this.properties; + } + + /** + * Set the properties property: GitLab Project properties. + * + * @param properties the properties value to set. + * @return the GitLabProjectInner object itself. + */ + public GitLabProjectInner withProperties(GitLabProjectProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportInner.java index 31f24ba0c299..313c2339fe03 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportInner.java @@ -13,6 +13,7 @@ import com.azure.resourcemanager.security.models.StatusAutoGenerated; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +import java.util.Map; /** The health report resource. */ @Fluent @@ -151,6 +152,39 @@ public HealthReportInner withAffectedDefendersPlans(List affectedDefende return this; } + /** + * Get the affectedDefendersSubPlans property: The affected defenders sub plans by unhealthy report. + * + * @return the affectedDefendersSubPlans value. + */ + public List affectedDefendersSubPlans() { + return this.innerProperties() == null ? null : this.innerProperties().affectedDefendersSubPlans(); + } + + /** + * Set the affectedDefendersSubPlans property: The affected defenders sub plans by unhealthy report. + * + * @param affectedDefendersSubPlans the affectedDefendersSubPlans value to set. + * @return the HealthReportInner object itself. + */ + public HealthReportInner withAffectedDefendersSubPlans(List affectedDefendersSubPlans) { + if (this.innerProperties() == null) { + this.innerProperties = new HealthReportProperties(); + } + this.innerProperties().withAffectedDefendersSubPlans(affectedDefendersSubPlans); + return this; + } + + /** + * Get the reportAdditionalData property: Additional data for the given health report, this field can include more + * details on the resource and the health scenario. + * + * @return the reportAdditionalData value. + */ + public Map reportAdditionalData() { + return this.innerProperties() == null ? null : this.innerProperties().reportAdditionalData(); + } + /** * Get the issues property: A collection of the issues in the report. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportProperties.java index 98ee1832e128..e0c6c1c0a9b8 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportProperties.java @@ -10,8 +10,10 @@ import com.azure.resourcemanager.security.models.Issue; import com.azure.resourcemanager.security.models.ResourceDetailsAutoGenerated; import com.azure.resourcemanager.security.models.StatusAutoGenerated; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +import java.util.Map; /** Describes properties of the health report. */ @Fluent @@ -46,6 +48,20 @@ public final class HealthReportProperties { @JsonProperty(value = "affectedDefendersPlans") private List affectedDefendersPlans; + /* + * The affected defenders sub plans by unhealthy report + */ + @JsonProperty(value = "affectedDefendersSubPlans") + private List affectedDefendersSubPlans; + + /* + * Additional data for the given health report, this field can include more details on the resource and the health + * scenario. + */ + @JsonProperty(value = "reportAdditionalData", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map reportAdditionalData; + /* * A collection of the issues in the report */ @@ -156,6 +172,36 @@ public HealthReportProperties withAffectedDefendersPlans(List affectedDe return this; } + /** + * Get the affectedDefendersSubPlans property: The affected defenders sub plans by unhealthy report. + * + * @return the affectedDefendersSubPlans value. + */ + public List affectedDefendersSubPlans() { + return this.affectedDefendersSubPlans; + } + + /** + * Set the affectedDefendersSubPlans property: The affected defenders sub plans by unhealthy report. + * + * @param affectedDefendersSubPlans the affectedDefendersSubPlans value to set. + * @return the HealthReportProperties object itself. + */ + public HealthReportProperties withAffectedDefendersSubPlans(List affectedDefendersSubPlans) { + this.affectedDefendersSubPlans = affectedDefendersSubPlans; + return this; + } + + /** + * Get the reportAdditionalData property: Additional data for the given health report, this field can include more + * details on the resource and the health scenario. + * + * @return the reportAdditionalData value. + */ + public Map reportAdditionalData() { + return this.reportAdditionalData; + } + /** * Get the issues property: A collection of the issues in the report. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingInner.java deleted file mode 100644 index 6bf368c4d201..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingInner.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Configures how to correlate scan data and logs with resources associated with the subscription. */ -@Fluent -public final class IngestionSettingInner extends ProxyResource { - /* - * Ingestion setting data - */ - @JsonProperty(value = "properties") - private Object properties; - - /** Creates an instance of IngestionSettingInner class. */ - public IngestionSettingInner() { - } - - /** - * Get the properties property: Ingestion setting data. - * - * @return the properties value. - */ - public Object properties() { - return this.properties; - } - - /** - * Set the properties property: Ingestion setting data. - * - * @param properties the properties value to set. - * @return the IngestionSettingInner object itself. - */ - public IngestionSettingInner withProperties(Object properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingTokenInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingTokenInner.java deleted file mode 100644 index dd95c8c94ce6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingTokenInner.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Configures how to correlate scan data and logs with resources associated with the subscription. */ -@Immutable -public final class IngestionSettingTokenInner { - /* - * The token is used for correlating security data and logs with the resources in the subscription. - */ - @JsonProperty(value = "token", access = JsonProperty.Access.WRITE_ONLY) - private String token; - - /** Creates an instance of IngestionSettingTokenInner class. */ - public IngestionSettingTokenInner() { - } - - /** - * Get the token property: The token is used for correlating security data and logs with the resources in the - * subscription. - * - * @return the token value. - */ - public String token() { - return this.token; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MalwareScanningProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MalwareScanningProperties.java new file mode 100644 index 000000000000..47787eb930de --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MalwareScanningProperties.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.security.models.OperationStatusAutoGenerated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of Malware Scanning. */ +@Fluent +public final class MalwareScanningProperties { + /* + * Properties of On Upload malware scanning. + */ + @JsonProperty(value = "onUpload") + private OnUploadProperties innerOnUpload; + + /* + * Optional. Resource id of an Event Grid Topic to send scan results to. + */ + @JsonProperty(value = "scanResultsEventGridTopicResourceId") + private String scanResultsEventGridTopicResourceId; + + /* + * Upon failure or partial success. Additional data describing Malware Scanning enable/disable operation. + */ + @JsonProperty(value = "operationStatus", access = JsonProperty.Access.WRITE_ONLY) + private OperationStatusAutoGenerated operationStatus; + + /** Creates an instance of MalwareScanningProperties class. */ + public MalwareScanningProperties() { + } + + /** + * Get the innerOnUpload property: Properties of On Upload malware scanning. + * + * @return the innerOnUpload value. + */ + private OnUploadProperties innerOnUpload() { + return this.innerOnUpload; + } + + /** + * Get the scanResultsEventGridTopicResourceId property: Optional. Resource id of an Event Grid Topic to send scan + * results to. + * + * @return the scanResultsEventGridTopicResourceId value. + */ + public String scanResultsEventGridTopicResourceId() { + return this.scanResultsEventGridTopicResourceId; + } + + /** + * Set the scanResultsEventGridTopicResourceId property: Optional. Resource id of an Event Grid Topic to send scan + * results to. + * + * @param scanResultsEventGridTopicResourceId the scanResultsEventGridTopicResourceId value to set. + * @return the MalwareScanningProperties object itself. + */ + public MalwareScanningProperties withScanResultsEventGridTopicResourceId( + String scanResultsEventGridTopicResourceId) { + this.scanResultsEventGridTopicResourceId = scanResultsEventGridTopicResourceId; + return this; + } + + /** + * Get the operationStatus property: Upon failure or partial success. Additional data describing Malware Scanning + * enable/disable operation. + * + * @return the operationStatus value. + */ + public OperationStatusAutoGenerated operationStatus() { + return this.operationStatus; + } + + /** + * Get the isEnabled property: Indicates whether On Upload malware scanning should be enabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.innerOnUpload() == null ? null : this.innerOnUpload().isEnabled(); + } + + /** + * Set the isEnabled property: Indicates whether On Upload malware scanning should be enabled. + * + * @param isEnabled the isEnabled value to set. + * @return the MalwareScanningProperties object itself. + */ + public MalwareScanningProperties withIsEnabled(Boolean isEnabled) { + if (this.innerOnUpload() == null) { + this.innerOnUpload = new OnUploadProperties(); + } + this.innerOnUpload().withIsEnabled(isEnabled); + return this; + } + + /** + * Get the capGBPerMonth property: Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + * + * @return the capGBPerMonth value. + */ + public Integer capGBPerMonth() { + return this.innerOnUpload() == null ? null : this.innerOnUpload().capGBPerMonth(); + } + + /** + * Set the capGBPerMonth property: Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + * + * @param capGBPerMonth the capGBPerMonth value to set. + * @return the MalwareScanningProperties object itself. + */ + public MalwareScanningProperties withCapGBPerMonth(Integer capGBPerMonth) { + if (this.innerOnUpload() == null) { + this.innerOnUpload = new OnUploadProperties(); + } + this.innerOnUpload().withCapGBPerMonth(capGBPerMonth); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerOnUpload() != null) { + innerOnUpload().validate(); + } + if (operationStatus() != null) { + operationStatus().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataInner.java index bd385f7c835d..dad1e98dfee8 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataInner.java @@ -11,6 +11,8 @@ /** The resource of the configuration or data needed to onboard the machine to MDE. */ @Fluent public final class MdeOnboardingDataInner extends ProxyResource { + private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; + /* * Properties of the MDE configuration or data parameter needed to onboard the machine to MDE */ @@ -38,7 +40,7 @@ private MdeOnboardingDataProperties innerProperties() { * @return the onboardingPackageWindows value. */ public byte[] onboardingPackageWindows() { - return this.innerProperties() == null ? new byte[0] : this.innerProperties().onboardingPackageWindows(); + return this.innerProperties() == null ? EMPTY_BYTE_ARRAY : this.innerProperties().onboardingPackageWindows(); } /** @@ -63,7 +65,7 @@ public MdeOnboardingDataInner withOnboardingPackageWindows(byte[] onboardingPack * @return the onboardingPackageLinux value. */ public byte[] onboardingPackageLinux() { - return this.innerProperties() == null ? new byte[0] : this.innerProperties().onboardingPackageLinux(); + return this.innerProperties() == null ? EMPTY_BYTE_ARRAY : this.innerProperties().onboardingPackageLinux(); } /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OnUploadProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OnUploadProperties.java new file mode 100644 index 000000000000..3d5e06a1baae --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OnUploadProperties.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of On Upload malware scanning. */ +@Fluent +public final class OnUploadProperties { + /* + * Indicates whether On Upload malware scanning should be enabled. + */ + @JsonProperty(value = "isEnabled") + private Boolean isEnabled; + + /* + * Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + */ + @JsonProperty(value = "capGBPerMonth") + private Integer capGBPerMonth; + + /** Creates an instance of OnUploadProperties class. */ + public OnUploadProperties() { + } + + /** + * Get the isEnabled property: Indicates whether On Upload malware scanning should be enabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set the isEnabled property: Indicates whether On Upload malware scanning should be enabled. + * + * @param isEnabled the isEnabled value to set. + * @return the OnUploadProperties object itself. + */ + public OnUploadProperties withIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get the capGBPerMonth property: Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + * + * @return the capGBPerMonth value. + */ + public Integer capGBPerMonth() { + return this.capGBPerMonth; + } + + /** + * Set the capGBPerMonth property: Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + * + * @param capGBPerMonth the capGBPerMonth value to set. + * @return the OnUploadProperties object itself. + */ + public OnUploadProperties withCapGBPerMonth(Integer capGBPerMonth) { + this.capGBPerMonth = capGBPerMonth; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationStatusResultInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationStatusResultInner.java new file mode 100644 index 000000000000..30e54eccef6e --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationStatusResultInner.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The current status of an async operation. */ +@Fluent +public final class OperationStatusResultInner { + /* + * Fully qualified ID for the async operation. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Name of the async operation. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Operation status. + */ + @JsonProperty(value = "status", required = true) + private String status; + + /* + * Percent of the operation that is complete. + */ + @JsonProperty(value = "percentComplete") + private Float percentComplete; + + /* + * The start time of the operation. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The end time of the operation. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * The operations list. + */ + @JsonProperty(value = "operations") + private List operations; + + /* + * If present, details of the operation error. + */ + @JsonProperty(value = "error") + private ManagementError error; + + /** Creates an instance of OperationStatusResultInner class. */ + public OperationStatusResultInner() { + } + + /** + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified ID for the async operation. + * + * @param id the id value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Name of the async operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the async operation. + * + * @param name the name value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Operation status. + * + * @param status the status value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + public Float percentComplete() { + return this.percentComplete; + } + + /** + * Set the percentComplete property: Percent of the operation that is complete. + * + * @param percentComplete the percentComplete value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withPercentComplete(Float percentComplete) { + this.percentComplete = percentComplete; + return this; + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time of the operation. + * + * @param startTime the startTime value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time of the operation. + * + * @param endTime the endTime value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the operations property: The operations list. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Set the operations property: The operations list. + * + * @param operations the operations value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withOperations(List operations) { + this.operations = operations; + return this; + } + + /** + * Get the error property: If present, details of the operation error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Set the error property: If present, details of the operation error. + * + * @param error the error value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withError(ManagementError error) { + this.error = error; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property status in model OperationStatusResultInner")); + } + if (operations() != null) { + operations().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OperationStatusResultInner.class); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SensitiveDataDiscoveryProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SensitiveDataDiscoveryProperties.java new file mode 100644 index 000000000000..b44b7ed8f61c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SensitiveDataDiscoveryProperties.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.security.models.OperationStatusAutoGenerated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of Sensitive Data Discovery. */ +@Fluent +public final class SensitiveDataDiscoveryProperties { + /* + * Indicates whether Sensitive Data Discovery should be enabled. + */ + @JsonProperty(value = "isEnabled") + private Boolean isEnabled; + + /* + * Upon failure or partial success. Additional data describing Sensitive Data Discovery enable/disable operation. + */ + @JsonProperty(value = "operationStatus", access = JsonProperty.Access.WRITE_ONLY) + private OperationStatusAutoGenerated operationStatus; + + /** Creates an instance of SensitiveDataDiscoveryProperties class. */ + public SensitiveDataDiscoveryProperties() { + } + + /** + * Get the isEnabled property: Indicates whether Sensitive Data Discovery should be enabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set the isEnabled property: Indicates whether Sensitive Data Discovery should be enabled. + * + * @param isEnabled the isEnabled value to set. + * @return the SensitiveDataDiscoveryProperties object itself. + */ + public SensitiveDataDiscoveryProperties withIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get the operationStatus property: Upon failure or partial success. Additional data describing Sensitive Data + * Discovery enable/disable operation. + * + * @return the operationStatus value. + */ + public OperationStatusAutoGenerated operationStatus() { + return this.operationStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operationStatus() != null) { + operationStatus().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsAzureSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsAzureSettingProperties.java new file mode 100644 index 000000000000..0b7512c36bb2 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsAzureSettingProperties.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsAzureSettingSelectedProvider; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the vulnerability assessments setting properties on Azure servers in the defined scope. */ +@Fluent +public final class ServerVulnerabilityAssessmentsAzureSettingProperties { + /* + * The selected vulnerability assessments provider on Azure servers in the defined scope. + */ + @JsonProperty(value = "selectedProvider", required = true) + private ServerVulnerabilityAssessmentsAzureSettingSelectedProvider selectedProvider; + + /** Creates an instance of ServerVulnerabilityAssessmentsAzureSettingProperties class. */ + public ServerVulnerabilityAssessmentsAzureSettingProperties() { + } + + /** + * Get the selectedProvider property: The selected vulnerability assessments provider on Azure servers in the + * defined scope. + * + * @return the selectedProvider value. + */ + public ServerVulnerabilityAssessmentsAzureSettingSelectedProvider selectedProvider() { + return this.selectedProvider; + } + + /** + * Set the selectedProvider property: The selected vulnerability assessments provider on Azure servers in the + * defined scope. + * + * @param selectedProvider the selectedProvider value to set. + * @return the ServerVulnerabilityAssessmentsAzureSettingProperties object itself. + */ + public ServerVulnerabilityAssessmentsAzureSettingProperties withSelectedProvider( + ServerVulnerabilityAssessmentsAzureSettingSelectedProvider selectedProvider) { + this.selectedProvider = selectedProvider; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (selectedProvider() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedProvider in model" + + " ServerVulnerabilityAssessmentsAzureSettingProperties")); + } + } + + private static final ClientLogger LOGGER = + new ClientLogger(ServerVulnerabilityAssessmentsAzureSettingProperties.class); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsSettingInner.java new file mode 100644 index 000000000000..659bf15b6771 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsSettingInner.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.security.models.AzureServersSetting; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** A base vulnerability assessments setting on servers in the defined scope. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = ServerVulnerabilityAssessmentsSettingInner.class) +@JsonTypeName("ServerVulnerabilityAssessmentsSetting") +@JsonSubTypes({@JsonSubTypes.Type(name = "AzureServersSetting", value = AzureServersSetting.class)}) +@Immutable +public class ServerVulnerabilityAssessmentsSettingInner extends ProxyResource { + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ServerVulnerabilityAssessmentsSettingInner class. */ + public ServerVulnerabilityAssessmentsSettingInner() { + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionImpl.java new file mode 100644 index 000000000000..61a1a1426384 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionImpl.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.resourcemanager.security.fluent.models.ApiCollectionInner; +import com.azure.resourcemanager.security.models.ApiCollection; +import com.azure.resourcemanager.security.models.ProvisioningState; + +public final class ApiCollectionImpl implements ApiCollection { + private ApiCollectionInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + ApiCollectionImpl( + ApiCollectionInner innerObject, com.azure.resourcemanager.security.SecurityManager 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 ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String discoveredVia() { + return this.innerModel().discoveredVia(); + } + + public String baseUrl() { + return this.innerModel().baseUrl(); + } + + public Long numberOfApiEndpoints() { + return this.innerModel().numberOfApiEndpoints(); + } + + public Long numberOfInactiveApiEndpoints() { + return this.innerModel().numberOfInactiveApiEndpoints(); + } + + public Long numberOfUnauthenticatedApiEndpoints() { + return this.innerModel().numberOfUnauthenticatedApiEndpoints(); + } + + public Long numberOfExternalApiEndpoints() { + return this.innerModel().numberOfExternalApiEndpoints(); + } + + public Long numberOfApiEndpointsWithSensitiveDataExposed() { + return this.innerModel().numberOfApiEndpointsWithSensitiveDataExposed(); + } + + public String sensitivityLabel() { + return this.innerModel().sensitivityLabel(); + } + + public ApiCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOffboardingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOffboardingsImpl.java deleted file mode 100644 index 8e6f9091324b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOffboardingsImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.ApiCollectionOffboardingsClient; -import com.azure.resourcemanager.security.models.ApiCollectionOffboardings; - -public final class ApiCollectionOffboardingsImpl implements ApiCollectionOffboardings { - private static final ClientLogger LOGGER = new ClientLogger(ApiCollectionOffboardingsImpl.class); - - private final ApiCollectionOffboardingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ApiCollectionOffboardingsImpl( - ApiCollectionOffboardingsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response deleteWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, apiCollectionId, context); - } - - public void delete(String resourceGroupName, String serviceName, String apiCollectionId) { - this.serviceClient().delete(resourceGroupName, serviceName, apiCollectionId); - } - - private ApiCollectionOffboardingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOnboardingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOnboardingsImpl.java deleted file mode 100644 index 0fc34f165495..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOnboardingsImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.ApiCollectionOnboardingsClient; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionResponseInner; -import com.azure.resourcemanager.security.models.ApiCollectionOnboardings; -import com.azure.resourcemanager.security.models.ApiCollectionResponse; - -public final class ApiCollectionOnboardingsImpl implements ApiCollectionOnboardings { - private static final ClientLogger LOGGER = new ClientLogger(ApiCollectionOnboardingsImpl.class); - - private final ApiCollectionOnboardingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ApiCollectionOnboardingsImpl( - ApiCollectionOnboardingsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response createWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { - Response inner = - this.serviceClient().createWithResponse(resourceGroupName, serviceName, apiCollectionId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ApiCollectionResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ApiCollectionResponse create(String resourceGroupName, String serviceName, String apiCollectionId) { - ApiCollectionResponseInner inner = this.serviceClient().create(resourceGroupName, serviceName, apiCollectionId); - if (inner != null) { - return new ApiCollectionResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private ApiCollectionOnboardingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionResponseImpl.java deleted file mode 100644 index 1427fdd1513f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionResponseImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.ApiCollectionResponseInner; -import com.azure.resourcemanager.security.models.ApiCollectionResponse; -import java.util.Collections; -import java.util.Map; - -public final class ApiCollectionResponseImpl implements ApiCollectionResponse { - private ApiCollectionResponseInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ApiCollectionResponseImpl( - ApiCollectionResponseInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public Map additionalData() { - Map inner = this.innerModel().additionalData(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public ApiCollectionResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsClientImpl.java index 08310c38ed47..36c52999210d 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsClientImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.security.implementation; +import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; @@ -11,6 +12,7 @@ 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; @@ -23,11 +25,16 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.security.fluent.ApiCollectionsClient; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionResponseInner; -import com.azure.resourcemanager.security.models.ApiCollectionResponseList; +import com.azure.resourcemanager.security.fluent.models.ApiCollectionInner; +import com.azure.resourcemanager.security.models.ApiCollectionList; +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 ApiCollectionsClient. */ @@ -56,12 +63,36 @@ public final class ApiCollectionsClientImpl implements ApiCollectionsClient { @Host("{$host}") @ServiceInterface(name = "SecurityCenterApiCol") public interface ApiCollectionsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/apiCollections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/apiCollections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> listByAzureApiManagementService( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @@ -72,15 +103,45 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiCollectionId}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( + Mono> getByAzureApiManagementService( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> onboardAzureApiManagementApi( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> offboardAzureApiManagementApi( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName, - @PathParam("apiCollectionId") String apiCollectionId, + @PathParam("apiId") String apiId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -89,7 +150,27 @@ Mono> get( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAzureApiManagementServiceNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -97,23 +178,171 @@ Mono> listNext( } /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs + * Gets a list of API collections within a subscription + * + *

Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs. + * + * @throws 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 API collections within a subscription that have been onboarded to Microsoft Defender for APIs + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-11-15"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of API collections within a subscription + * + *

Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 API collections within a subscription that have been onboarded to Microsoft Defender for APIs + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-11-15"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of API collections within a subscription * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API - * Management API for intrusive behaviors and provide alerts for attacks that have been detected. + *

Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs. + * + * @throws 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 API collections within a subscription that have been onboarded to Microsoft Defender for APIs + * as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of API collections within a subscription + * + *

Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 API collections within a subscription that have been onboarded to Microsoft Defender for APIs + * as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of API collections within a subscription + * + *

Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs. + * + * @throws 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 API collections within a subscription that have been onboarded to Microsoft Defender for APIs + * as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of API collections within a subscription + * + *

Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 API collections within a subscription that have been onboarded to Microsoft Defender for APIs + * as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets a list of API collections within a resource group + * + *

Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for + * APIs. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Azure API Management APIs that have been onboarded to Defender for APIs along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs + * along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String serviceName) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -130,24 +359,20 @@ private Mono> listSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - final String apiVersion = "2022-11-20-preview"; + final String apiVersion = "2023-11-15"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .list( + .listByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - serviceName, apiVersion, accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -160,24 +385,22 @@ private Mono> listSinglePageAsync( } /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs + * Gets a list of API collections within a resource group * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API - * Management API for intrusive behaviors and provide alerts for attacks that have been detected. + *

Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for + * APIs. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Azure API Management APIs that have been onboarded to Defender for APIs along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs + * along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String serviceName, Context context) { + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -194,18 +417,14 @@ private Mono> listSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - final String apiVersion = "2022-11-20-preview"; + final String apiVersion = "2023-11-15"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( + .listByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - serviceName, apiVersion, accept, context) @@ -221,112 +440,101 @@ private Mono> listSinglePageAsync( } /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs + * Gets a list of API collections within a resource group * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API - * Management API for intrusive behaviors and provide alerts for attacks that have been detected. + *

Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for + * APIs. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedFlux}. + * @return a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs + * as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String serviceName) { + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs + * Gets a list of API collections within a resource group * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API - * Management API for intrusive behaviors and provide alerts for attacks that have been detected. + *

Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for + * APIs. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedFlux}. + * @return a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs + * as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String serviceName, Context context) { + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, serviceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs + * Gets a list of API collections within a resource group * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API - * Management API for intrusive behaviors and provide alerts for attacks that have been detected. + *

Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for + * APIs. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedIterable}. + * @return a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs + * as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String serviceName) { - return new PagedIterable<>(listAsync(resourceGroupName, serviceName)); + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs + * Gets a list of API collections within a resource group * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API - * Management API for intrusive behaviors and provide alerts for attacks that have been detected. + *

Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for + * APIs. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedIterable}. + * @return a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs + * as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String serviceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, serviceName, context)); + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); } /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs + * Gets a list of onboarded Azure API Management APIs * - *

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to Defender for APIs, the system will monitor the operations within the Azure API Management API for - * intrusive behaviors and provide alerts for attacks that have been detected. + *

Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure + * API Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the + * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure API Management API if it has been onboarded to Defender for APIs along with {@link Response} on - * successful completion of {@link Mono}. + * @return a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serviceName, String apiCollectionId) { + private Mono> listByAzureApiManagementServiceSinglePageAsync( + String resourceGroupName, String serviceName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -346,49 +554,51 @@ private Mono> getWithResponseAsync( if (serviceName == null) { return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); } - if (apiCollectionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter apiCollectionId is required and cannot be null.")); - } - final String apiVersion = "2022-11-20-preview"; + final String apiVersion = "2023-11-15"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .get( + .listByAzureApiManagementService( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, serviceName, - apiCollectionId, apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs + * Gets a list of onboarded Azure API Management APIs * - *

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to Defender for APIs, the system will monitor the operations within the Azure API Management API for - * intrusive behaviors and provide alerts for attacks that have been detected. + *

Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure + * API Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the + * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Azure API Management API if it has been onboarded to Defender for APIs along with {@link Response} on - * successful completion of {@link Mono}. + * @return a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { + private Mono> listByAzureApiManagementServiceSinglePageAsync( + String resourceGroupName, String serviceName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -408,123 +618,989 @@ private Mono> getWithResponseAsync( if (serviceName == null) { return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); } - if (apiCollectionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter apiCollectionId is required and cannot be null.")); - } - final String apiVersion = "2022-11-20-preview"; + final String apiVersion = "2023-11-15"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .get( + .listByAzureApiManagementService( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, serviceName, - apiCollectionId, apiVersion, accept, - context); + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs + * Gets a list of onboarded Azure API Management APIs * - *

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to Defender for APIs, the system will monitor the operations within the Azure API Management API for - * intrusive behaviors and provide alerts for attacks that have been detected. + *

Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure + * API Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the + * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure API Management API if it has been onboarded to Defender for APIs on successful completion of - * {@link Mono}. + * @return a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs as paginated + * response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String serviceName, String apiCollectionId) { - return getWithResponseAsync(resourceGroupName, serviceName, apiCollectionId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAzureApiManagementServiceAsync( + String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listByAzureApiManagementServiceSinglePageAsync(resourceGroupName, serviceName), + nextLink -> listByAzureApiManagementServiceNextSinglePageAsync(nextLink)); } /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs + * Gets a list of onboarded Azure API Management APIs * - *

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to Defender for APIs, the system will monitor the operations within the Azure API Management API for - * intrusive behaviors and provide alerts for attacks that have been detected. + *

Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure + * API Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the + * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Azure API Management API if it has been onboarded to Defender for APIs along with {@link Response}. + * @return a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs as paginated + * response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { - return getWithResponseAsync(resourceGroupName, serviceName, apiCollectionId, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAzureApiManagementServiceAsync( + String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listByAzureApiManagementServiceSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listByAzureApiManagementServiceNextSinglePageAsync(nextLink, context)); } /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs + * Gets a list of onboarded Azure API Management APIs * - *

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to Defender for APIs, the system will monitor the operations within the Azure API Management API for - * intrusive behaviors and provide alerts for attacks that have been detected. + *

Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure + * API Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the + * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure API Management API if it has been onboarded to Defender for APIs. + * @return a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs as paginated + * response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApiCollectionResponseInner get(String resourceGroupName, String serviceName, String apiCollectionId) { - return getWithResponse(resourceGroupName, serviceName, apiCollectionId, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAzureApiManagementService( + String resourceGroupName, String serviceName) { + return new PagedIterable<>(listByAzureApiManagementServiceAsync(resourceGroupName, serviceName)); } /** - * Get the next page of items. + * Gets a list of onboarded Azure API Management APIs * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + *

Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure + * API Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the + * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Azure API Management APIs that have been onboarded to Microsoft Defender for APIs as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAzureApiManagementService( + String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listByAzureApiManagementServiceAsync(resourceGroupName, serviceName, context)); + } + + /** + * Gets an onboarded Azure API Management API + * + *

Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API + * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the + * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a list of API collections as represented by Defender for APIs along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return an Azure API Management API if it has been onboarded to Microsoft Defender for APIs along with {@link + * Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } + private Mono> getByAzureApiManagementServiceWithResponseAsync( + String resourceGroupName, String serviceName, String apiId) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + final String apiVersion = "2023-11-15"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByAzureApiManagementService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiId, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an onboarded Azure API Management API + * + *

Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API + * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the + * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Azure API Management API if it has been onboarded to Microsoft Defender for APIs along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByAzureApiManagementServiceWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + final String apiVersion = "2023-11-15"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByAzureApiManagementService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiId, + apiVersion, + accept, + context); + } + + /** + * Gets an onboarded Azure API Management API + * + *

Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API + * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the + * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Azure API Management API if it has been onboarded to Microsoft Defender for APIs on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByAzureApiManagementServiceAsync( + String resourceGroupName, String serviceName, String apiId) { + return getByAzureApiManagementServiceWithResponseAsync(resourceGroupName, serviceName, apiId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an onboarded Azure API Management API + * + *

Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API + * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the + * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Azure API Management API if it has been onboarded to Microsoft Defender for APIs along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByAzureApiManagementServiceWithResponse( + String resourceGroupName, String serviceName, String apiId, Context context) { + return getByAzureApiManagementServiceWithResponseAsync(resourceGroupName, serviceName, apiId, context).block(); + } + + /** + * Gets an onboarded Azure API Management API + * + *

Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API + * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the + * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Azure API Management API if it has been onboarded to Microsoft Defender for APIs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiCollectionInner getByAzureApiManagementService( + String resourceGroupName, String serviceName, String apiId) { + return getByAzureApiManagementServiceWithResponse(resourceGroupName, serviceName, apiId, Context.NONE) + .getValue(); + } + + /** + * Onboard an Azure API Management API to Microsoft Defender for APIs + * + *

Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the + * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been + * detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 API collection as represented by Microsoft Defender for APIs along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> onboardAzureApiManagementApiWithResponseAsync( + String resourceGroupName, String serviceName, String apiId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + final String apiVersion = "2023-11-15"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .onboardAzureApiManagementApi( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiId, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Onboard an Azure API Management API to Microsoft Defender for APIs + * + *

Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the + * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been + * detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 API collection as represented by Microsoft Defender for APIs along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> onboardAzureApiManagementApiWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + final String apiVersion = "2023-11-15"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .onboardAzureApiManagementApi( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiId, + apiVersion, + accept, + context); + } + + /** + * Onboard an Azure API Management API to Microsoft Defender for APIs + * + *

Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the + * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been + * detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 API collection as represented by Microsoft Defender for APIs. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApiCollectionInner> beginOnboardAzureApiManagementApiAsync( + String resourceGroupName, String serviceName, String apiId) { + Mono>> mono = + onboardAzureApiManagementApiWithResponseAsync(resourceGroupName, serviceName, apiId); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApiCollectionInner.class, + ApiCollectionInner.class, + this.client.getContext()); + } + + /** + * Onboard an Azure API Management API to Microsoft Defender for APIs + * + *

Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the + * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been + * detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 API collection as represented by Microsoft Defender for APIs. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApiCollectionInner> beginOnboardAzureApiManagementApiAsync( + String resourceGroupName, String serviceName, String apiId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + onboardAzureApiManagementApiWithResponseAsync(resourceGroupName, serviceName, apiId, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ApiCollectionInner.class, ApiCollectionInner.class, context); + } + + /** + * Onboard an Azure API Management API to Microsoft Defender for APIs + * + *

Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the + * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been + * detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 API collection as represented by Microsoft Defender for APIs. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApiCollectionInner> beginOnboardAzureApiManagementApi( + String resourceGroupName, String serviceName, String apiId) { + return this.beginOnboardAzureApiManagementApiAsync(resourceGroupName, serviceName, apiId).getSyncPoller(); + } + + /** + * Onboard an Azure API Management API to Microsoft Defender for APIs + * + *

Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the + * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been + * detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 API collection as represented by Microsoft Defender for APIs. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApiCollectionInner> beginOnboardAzureApiManagementApi( + String resourceGroupName, String serviceName, String apiId, Context context) { + return this + .beginOnboardAzureApiManagementApiAsync(resourceGroupName, serviceName, apiId, context) + .getSyncPoller(); + } + + /** + * Onboard an Azure API Management API to Microsoft Defender for APIs + * + *

Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the + * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been + * detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 API collection as represented by Microsoft Defender for APIs on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono onboardAzureApiManagementApiAsync( + String resourceGroupName, String serviceName, String apiId) { + return beginOnboardAzureApiManagementApiAsync(resourceGroupName, serviceName, apiId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Onboard an Azure API Management API to Microsoft Defender for APIs + * + *

Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the + * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been + * detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 API collection as represented by Microsoft Defender for APIs on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono onboardAzureApiManagementApiAsync( + String resourceGroupName, String serviceName, String apiId, Context context) { + return beginOnboardAzureApiManagementApiAsync(resourceGroupName, serviceName, apiId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Onboard an Azure API Management API to Microsoft Defender for APIs + * + *

Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the + * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been + * detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 API collection as represented by Microsoft Defender for APIs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiCollectionInner onboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId) { + return onboardAzureApiManagementApiAsync(resourceGroupName, serviceName, apiId).block(); + } + + /** + * Onboard an Azure API Management API to Microsoft Defender for APIs + * + *

Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the + * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been + * detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 API collection as represented by Microsoft Defender for APIs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiCollectionInner onboardAzureApiManagementApi( + String resourceGroupName, String serviceName, String apiId, Context context) { + return onboardAzureApiManagementApiAsync(resourceGroupName, serviceName, apiId, context).block(); + } + + /** + * Offboard an Azure API Management API from Microsoft Defender for APIs + * + *

Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the + * operations within the Azure API Management API for intrusive behaviors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> offboardAzureApiManagementApiWithResponseAsync( + String resourceGroupName, String serviceName, String apiId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + final String apiVersion = "2023-11-15"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .offboardAzureApiManagementApi( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiId, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Offboard an Azure API Management API from Microsoft Defender for APIs + * + *

Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the + * operations within the Azure API Management API for intrusive behaviors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> offboardAzureApiManagementApiWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + final String apiVersion = "2023-11-15"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .offboardAzureApiManagementApi( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiId, + apiVersion, + accept, + context); + } + + /** + * Offboard an Azure API Management API from Microsoft Defender for APIs + * + *

Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the + * operations within the Azure API Management API for intrusive behaviors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 offboardAzureApiManagementApiAsync(String resourceGroupName, String serviceName, String apiId) { + return offboardAzureApiManagementApiWithResponseAsync(resourceGroupName, serviceName, apiId) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Offboard an Azure API Management API from Microsoft Defender for APIs + * + *

Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the + * operations within the Azure API Management API for intrusive behaviors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response offboardAzureApiManagementApiWithResponse( + String resourceGroupName, String serviceName, String apiId, Context context) { + return offboardAzureApiManagementApiWithResponseAsync(resourceGroupName, serviceName, apiId, context).block(); + } + + /** + * Offboard an Azure API Management API from Microsoft Defender for APIs + * + *

Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the + * operations within the Azure API Management API for intrusive behaviors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 offboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId) { + offboardAzureApiManagementApiWithResponse(resourceGroupName, serviceName, apiId, Context.NONE); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return page of a list of API collections as represented by Microsoft Defender for APIs along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return page of a list of API collections as represented by Microsoft Defender for APIs along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return page of a list of API collections as represented by Microsoft Defender for APIs along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return page of a list of API collections as represented by Microsoft Defender for APIs along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return page of a list of API collections as represented by Microsoft Defender for APIs along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAzureApiManagementServiceNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.listByAzureApiManagementServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), @@ -541,11 +1617,12 @@ private Mono> listNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a list of API collections as represented by Defender for APIs along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return page of a list of API collections as represented by Microsoft Defender for APIs along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listByAzureApiManagementServiceNextSinglePageAsync( + String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -558,7 +1635,7 @@ private Mono> listNextSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) + .listByAzureApiManagementServiceNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsImpl.java index 336ea9d21801..a7145adc7fe3 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsImpl.java @@ -10,8 +10,8 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.fluent.ApiCollectionsClient; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionResponseInner; -import com.azure.resourcemanager.security.models.ApiCollectionResponse; +import com.azure.resourcemanager.security.fluent.models.ApiCollectionInner; +import com.azure.resourcemanager.security.models.ApiCollection; import com.azure.resourcemanager.security.models.ApiCollections; public final class ApiCollectionsImpl implements ApiCollections { @@ -27,41 +27,98 @@ public ApiCollectionsImpl( this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String serviceName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName); - return Utils.mapPage(inner, inner1 -> new ApiCollectionResponseImpl(inner1, this.manager())); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ApiCollectionImpl(inner1, this.manager())); } - public PagedIterable list(String resourceGroupName, String serviceName, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, serviceName, context); - return Utils.mapPage(inner, inner1 -> new ApiCollectionResponseImpl(inner1, this.manager())); + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ApiCollectionImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, serviceName, apiCollectionId, context); + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ApiCollectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ApiCollectionImpl(inner1, this.manager())); + } + + public PagedIterable listByAzureApiManagementService(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listByAzureApiManagementService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new ApiCollectionImpl(inner1, this.manager())); + } + + public PagedIterable listByAzureApiManagementService( + String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = + this.serviceClient().listByAzureApiManagementService(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new ApiCollectionImpl(inner1, this.manager())); + } + + public Response getByAzureApiManagementServiceWithResponse( + String resourceGroupName, String serviceName, String apiId, Context context) { + Response inner = + this + .serviceClient() + .getByAzureApiManagementServiceWithResponse(resourceGroupName, serviceName, apiId, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApiCollectionResponseImpl(inner.getValue(), this.manager())); + new ApiCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApiCollection getByAzureApiManagementService(String resourceGroupName, String serviceName, String apiId) { + ApiCollectionInner inner = + this.serviceClient().getByAzureApiManagementService(resourceGroupName, serviceName, apiId); + if (inner != null) { + return new ApiCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApiCollection onboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId) { + ApiCollectionInner inner = + this.serviceClient().onboardAzureApiManagementApi(resourceGroupName, serviceName, apiId); + if (inner != null) { + return new ApiCollectionImpl(inner, this.manager()); } else { return null; } } - public ApiCollectionResponse get(String resourceGroupName, String serviceName, String apiCollectionId) { - ApiCollectionResponseInner inner = this.serviceClient().get(resourceGroupName, serviceName, apiCollectionId); + public ApiCollection onboardAzureApiManagementApi( + String resourceGroupName, String serviceName, String apiId, Context context) { + ApiCollectionInner inner = + this.serviceClient().onboardAzureApiManagementApi(resourceGroupName, serviceName, apiId, context); if (inner != null) { - return new ApiCollectionResponseImpl(inner, this.manager()); + return new ApiCollectionImpl(inner, this.manager()); } else { return null; } } + public Response offboardAzureApiManagementApiWithResponse( + String resourceGroupName, String serviceName, String apiId, Context context) { + return this + .serviceClient() + .offboardAzureApiManagementApiWithResponse(resourceGroupName, serviceName, apiId, context); + } + + public void offboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId) { + this.serviceClient().offboardAzureApiManagementApi(resourceGroupName, serviceName, apiId); + } + private ApiCollectionsClient serviceClient() { return this.innerClient; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgImpl.java new file mode 100644 index 000000000000..40f36d37870d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgImpl.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgInner; +import com.azure.resourcemanager.security.models.AzureDevOpsOrg; +import com.azure.resourcemanager.security.models.AzureDevOpsOrgProperties; + +public final class AzureDevOpsOrgImpl implements AzureDevOpsOrg, AzureDevOpsOrg.Definition, AzureDevOpsOrg.Update { + private AzureDevOpsOrgInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AzureDevOpsOrgProperties properties() { + return this.innerModel().properties(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AzureDevOpsOrgInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String securityConnectorName; + + private String orgName; + + public AzureDevOpsOrgImpl withExistingSecurityConnector(String resourceGroupName, String securityConnectorName) { + this.resourceGroupName = resourceGroupName; + this.securityConnectorName = securityConnectorName; + return this; + } + + public AzureDevOpsOrg create() { + this.innerObject = + serviceManager + .serviceClient() + .getAzureDevOpsOrgs() + .createOrUpdate(resourceGroupName, securityConnectorName, orgName, this.innerModel(), Context.NONE); + return this; + } + + public AzureDevOpsOrg create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAzureDevOpsOrgs() + .createOrUpdate(resourceGroupName, securityConnectorName, orgName, this.innerModel(), context); + return this; + } + + AzureDevOpsOrgImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = new AzureDevOpsOrgInner(); + this.serviceManager = serviceManager; + this.orgName = name; + } + + public AzureDevOpsOrgImpl update() { + return this; + } + + public AzureDevOpsOrg apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAzureDevOpsOrgs() + .update(resourceGroupName, securityConnectorName, orgName, this.innerModel(), Context.NONE); + return this; + } + + public AzureDevOpsOrg apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAzureDevOpsOrgs() + .update(resourceGroupName, securityConnectorName, orgName, this.innerModel(), context); + return this; + } + + AzureDevOpsOrgImpl( + AzureDevOpsOrgInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.securityConnectorName = Utils.getValueFromIdByName(innerObject.id(), "securityConnectors"); + this.orgName = Utils.getValueFromIdByName(innerObject.id(), "azureDevOpsOrgs"); + } + + public AzureDevOpsOrg refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAzureDevOpsOrgs() + .getWithResponse(resourceGroupName, securityConnectorName, orgName, Context.NONE) + .getValue(); + return this; + } + + public AzureDevOpsOrg refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAzureDevOpsOrgs() + .getWithResponse(resourceGroupName, securityConnectorName, orgName, context) + .getValue(); + return this; + } + + public AzureDevOpsOrgImpl withProperties(AzureDevOpsOrgProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgListResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgListResponseImpl.java new file mode 100644 index 000000000000..39a2a75deacb --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgListResponseImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgInner; +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgListResponseInner; +import com.azure.resourcemanager.security.models.AzureDevOpsOrg; +import com.azure.resourcemanager.security.models.AzureDevOpsOrgListResponse; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class AzureDevOpsOrgListResponseImpl implements AzureDevOpsOrgListResponse { + private AzureDevOpsOrgListResponseInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + AzureDevOpsOrgListResponseImpl( + AzureDevOpsOrgListResponseInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new AzureDevOpsOrgImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public AzureDevOpsOrgListResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsClientImpl.java new file mode 100644 index 000000000000..d22a1316201a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsClientImpl.java @@ -0,0 +1,1346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.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.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.security.fluent.AzureDevOpsOrgsClient; +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgInner; +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgListResponseInner; +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 AzureDevOpsOrgsClient. */ +public final class AzureDevOpsOrgsClientImpl implements AzureDevOpsOrgsClient { + /** The proxy service used to perform REST calls. */ + private final AzureDevOpsOrgsService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of AzureDevOpsOrgsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AzureDevOpsOrgsClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy.create(AzureDevOpsOrgsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterAzureDevOpsOrgs to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterAzureD") + public interface AzureDevOpsOrgsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/listAvailableAzureDevOpsOrgs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAvailable( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("orgName") String orgName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("orgName") String orgName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AzureDevOpsOrgInner azureDevOpsOrg, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("orgName") String orgName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AzureDevOpsOrgInner azureDevOpsOrg, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableWithResponseAsync( + String resourceGroupName, String securityConnectorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAvailable( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableWithResponseAsync( + String resourceGroupName, String securityConnectorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAvailable( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + accept, + context); + } + + /** + * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAvailableAsync( + String resourceGroupName, String securityConnectorName) { + return listAvailableWithResponseAsync(resourceGroupName, securityConnectorName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAvailableWithResponse( + String resourceGroupName, String securityConnectorName, Context context) { + return listAvailableWithResponseAsync(resourceGroupName, securityConnectorName, context).block(); + } + + /** + * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureDevOpsOrgListResponseInner listAvailable(String resourceGroupName, String securityConnectorName) { + return listAvailableWithResponse(resourceGroupName, securityConnectorName, Context.NONE).getValue(); + } + + /** + * Returns a list of Azure DevOps organizations onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String securityConnectorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a list of Azure DevOps organizations onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String securityConnectorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of Azure DevOps organizations onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String securityConnectorName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, securityConnectorName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of Azure DevOps organizations onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String securityConnectorName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, securityConnectorName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of Azure DevOps organizations onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String securityConnectorName) { + return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName)); + } + + /** + * Returns a list of Azure DevOps organizations onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String securityConnectorName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, context)); + } + + /** + * Returns a monitored Azure DevOps organization resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String securityConnectorName, String orgName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a monitored Azure DevOps organization resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String securityConnectorName, String orgName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + apiVersion, + accept, + context); + } + + /** + * Returns a monitored Azure DevOps organization resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String securityConnectorName, String orgName) { + return getWithResponseAsync(resourceGroupName, securityConnectorName, orgName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns a monitored Azure DevOps organization resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String securityConnectorName, String orgName, Context context) { + return getWithResponseAsync(resourceGroupName, securityConnectorName, orgName, context).block(); + } + + /** + * Returns a monitored Azure DevOps organization resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureDevOpsOrgInner get(String resourceGroupName, String securityConnectorName, String orgName) { + return getWithResponse(resourceGroupName, securityConnectorName, orgName, Context.NONE).getValue(); + } + + /** + * Creates or updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + if (azureDevOpsOrg == null) { + return Mono.error(new IllegalArgumentException("Parameter azureDevOpsOrg is required and cannot be null.")); + } else { + azureDevOpsOrg.validate(); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + apiVersion, + azureDevOpsOrg, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + AzureDevOpsOrgInner azureDevOpsOrg, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + if (azureDevOpsOrg == null) { + return Mono.error(new IllegalArgumentException("Parameter azureDevOpsOrg is required and cannot be null.")); + } else { + azureDevOpsOrg.validate(); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + apiVersion, + azureDevOpsOrg, + accept, + context); + } + + /** + * Creates or updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AzureDevOpsOrgInner> beginCreateOrUpdateAsync( + String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AzureDevOpsOrgInner.class, + AzureDevOpsOrgInner.class, + this.client.getContext()); + } + + /** + * Creates or updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AzureDevOpsOrgInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + AzureDevOpsOrgInner azureDevOpsOrg, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AzureDevOpsOrgInner.class, AzureDevOpsOrgInner.class, context); + } + + /** + * Creates or updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureDevOpsOrgInner> beginCreateOrUpdate( + String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg) + .getSyncPoller(); + } + + /** + * Creates or updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureDevOpsOrgInner> beginCreateOrUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + AzureDevOpsOrgInner azureDevOpsOrg, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context) + .getSyncPoller(); + } + + /** + * Creates or updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { + return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + AzureDevOpsOrgInner azureDevOpsOrg, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureDevOpsOrgInner createOrUpdate( + String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { + return createOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg).block(); + } + + /** + * Creates or updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureDevOpsOrgInner createOrUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + AzureDevOpsOrgInner azureDevOpsOrg, + Context context) { + return createOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context).block(); + } + + /** + * Updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + if (azureDevOpsOrg == null) { + return Mono.error(new IllegalArgumentException("Parameter azureDevOpsOrg is required and cannot be null.")); + } else { + azureDevOpsOrg.validate(); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + apiVersion, + azureDevOpsOrg, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + AzureDevOpsOrgInner azureDevOpsOrg, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + if (azureDevOpsOrg == null) { + return Mono.error(new IllegalArgumentException("Parameter azureDevOpsOrg is required and cannot be null.")); + } else { + azureDevOpsOrg.validate(); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + apiVersion, + azureDevOpsOrg, + accept, + context); + } + + /** + * Updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AzureDevOpsOrgInner> beginUpdateAsync( + String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AzureDevOpsOrgInner.class, + AzureDevOpsOrgInner.class, + this.client.getContext()); + } + + /** + * Updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AzureDevOpsOrgInner> beginUpdateAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + AzureDevOpsOrgInner azureDevOpsOrg, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AzureDevOpsOrgInner.class, AzureDevOpsOrgInner.class, context); + } + + /** + * Updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureDevOpsOrgInner> beginUpdate( + String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { + return this.beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg).getSyncPoller(); + } + + /** + * Updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureDevOpsOrgInner> beginUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + AzureDevOpsOrgInner azureDevOpsOrg, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context) + .getSyncPoller(); + } + + /** + * Updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { + return beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + AzureDevOpsOrgInner azureDevOpsOrg, + Context context) { + return beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureDevOpsOrgInner update( + String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { + return updateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg).block(); + } + + /** + * Updates monitored Azure DevOps organization details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param azureDevOpsOrg The Azure DevOps organization resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureDevOpsOrgInner update( + String resourceGroupName, + String securityConnectorName, + String orgName, + AzureDevOpsOrgInner azureDevOpsOrg, + Context context) { + return updateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsImpl.java new file mode 100644 index 000000000000..a1839b474e45 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsImpl.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.AzureDevOpsOrgsClient; +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgInner; +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgListResponseInner; +import com.azure.resourcemanager.security.models.AzureDevOpsOrg; +import com.azure.resourcemanager.security.models.AzureDevOpsOrgListResponse; +import com.azure.resourcemanager.security.models.AzureDevOpsOrgs; + +public final class AzureDevOpsOrgsImpl implements AzureDevOpsOrgs { + private static final ClientLogger LOGGER = new ClientLogger(AzureDevOpsOrgsImpl.class); + + private final AzureDevOpsOrgsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public AzureDevOpsOrgsImpl( + AzureDevOpsOrgsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listAvailableWithResponse( + String resourceGroupName, String securityConnectorName, Context context) { + Response inner = + this.serviceClient().listAvailableWithResponse(resourceGroupName, securityConnectorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AzureDevOpsOrgListResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AzureDevOpsOrgListResponse listAvailable(String resourceGroupName, String securityConnectorName) { + AzureDevOpsOrgListResponseInner inner = + this.serviceClient().listAvailable(resourceGroupName, securityConnectorName); + if (inner != null) { + return new AzureDevOpsOrgListResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String securityConnectorName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, securityConnectorName); + return Utils.mapPage(inner, inner1 -> new AzureDevOpsOrgImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String securityConnectorName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, securityConnectorName, context); + return Utils.mapPage(inner, inner1 -> new AzureDevOpsOrgImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String securityConnectorName, String orgName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, orgName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AzureDevOpsOrgImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AzureDevOpsOrg get(String resourceGroupName, String securityConnectorName, String orgName) { + AzureDevOpsOrgInner inner = this.serviceClient().get(resourceGroupName, securityConnectorName, orgName); + if (inner != null) { + return new AzureDevOpsOrgImpl(inner, this.manager()); + } else { + return null; + } + } + + public AzureDevOpsOrg getById(String id) { + String resourceGroupName = Utils.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 securityConnectorName = Utils.getValueFromIdByName(id, "securityConnectors"); + if (securityConnectorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); + } + String orgName = Utils.getValueFromIdByName(id, "azureDevOpsOrgs"); + if (orgName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'azureDevOpsOrgs'.", id))); + } + return this.getWithResponse(resourceGroupName, securityConnectorName, orgName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 securityConnectorName = Utils.getValueFromIdByName(id, "securityConnectors"); + if (securityConnectorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); + } + String orgName = Utils.getValueFromIdByName(id, "azureDevOpsOrgs"); + if (orgName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'azureDevOpsOrgs'.", id))); + } + return this.getWithResponse(resourceGroupName, securityConnectorName, orgName, context); + } + + private AzureDevOpsOrgsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } + + public AzureDevOpsOrgImpl define(String name) { + return new AzureDevOpsOrgImpl(name, this.manager()); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectImpl.java new file mode 100644 index 000000000000..2ca191de7271 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectImpl.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner; +import com.azure.resourcemanager.security.models.AzureDevOpsProject; +import com.azure.resourcemanager.security.models.AzureDevOpsProjectProperties; + +public final class AzureDevOpsProjectImpl + implements AzureDevOpsProject, AzureDevOpsProject.Definition, AzureDevOpsProject.Update { + private AzureDevOpsProjectInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AzureDevOpsProjectProperties properties() { + return this.innerModel().properties(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AzureDevOpsProjectInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String securityConnectorName; + + private String orgName; + + private String projectName; + + public AzureDevOpsProjectImpl withExistingAzureDevOpsOrg( + String resourceGroupName, String securityConnectorName, String orgName) { + this.resourceGroupName = resourceGroupName; + this.securityConnectorName = securityConnectorName; + this.orgName = orgName; + return this; + } + + public AzureDevOpsProject create() { + this.innerObject = + serviceManager + .serviceClient() + .getAzureDevOpsProjects() + .createOrUpdate( + resourceGroupName, securityConnectorName, orgName, projectName, this.innerModel(), Context.NONE); + return this; + } + + public AzureDevOpsProject create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAzureDevOpsProjects() + .createOrUpdate( + resourceGroupName, securityConnectorName, orgName, projectName, this.innerModel(), context); + return this; + } + + AzureDevOpsProjectImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = new AzureDevOpsProjectInner(); + this.serviceManager = serviceManager; + this.projectName = name; + } + + public AzureDevOpsProjectImpl update() { + return this; + } + + public AzureDevOpsProject apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAzureDevOpsProjects() + .update( + resourceGroupName, securityConnectorName, orgName, projectName, this.innerModel(), Context.NONE); + return this; + } + + public AzureDevOpsProject apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAzureDevOpsProjects() + .update(resourceGroupName, securityConnectorName, orgName, projectName, this.innerModel(), context); + return this; + } + + AzureDevOpsProjectImpl( + AzureDevOpsProjectInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.securityConnectorName = Utils.getValueFromIdByName(innerObject.id(), "securityConnectors"); + this.orgName = Utils.getValueFromIdByName(innerObject.id(), "azureDevOpsOrgs"); + this.projectName = Utils.getValueFromIdByName(innerObject.id(), "projects"); + } + + public AzureDevOpsProject refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAzureDevOpsProjects() + .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, Context.NONE) + .getValue(); + return this; + } + + public AzureDevOpsProject refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAzureDevOpsProjects() + .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, context) + .getValue(); + return this; + } + + public AzureDevOpsProjectImpl withProperties(AzureDevOpsProjectProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsClientImpl.java new file mode 100644 index 000000000000..ae9c9ba5f5e1 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsClientImpl.java @@ -0,0 +1,1330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.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.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.security.fluent.AzureDevOpsProjectsClient; +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner; +import com.azure.resourcemanager.security.models.AzureDevOpsProjectListResponse; +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 AzureDevOpsProjectsClient. */ +public final class AzureDevOpsProjectsClientImpl implements AzureDevOpsProjectsClient { + /** The proxy service used to perform REST calls. */ + private final AzureDevOpsProjectsService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of AzureDevOpsProjectsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AzureDevOpsProjectsClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy.create(AzureDevOpsProjectsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterAzureDevOpsProjects to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterAzureD") + public interface AzureDevOpsProjectsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("orgName") String orgName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("orgName") String orgName, + @PathParam("projectName") String projectName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("orgName") String orgName, + @PathParam("projectName") String projectName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AzureDevOpsProjectInner azureDevOpsProject, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("orgName") String orgName, + @PathParam("projectName") String projectName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AzureDevOpsProjectInner azureDevOpsProject, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns a list of Azure DevOps projects onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String securityConnectorName, String orgName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a list of Azure DevOps projects onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String securityConnectorName, String orgName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of Azure DevOps projects onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String securityConnectorName, String orgName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, securityConnectorName, orgName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of Azure DevOps projects onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String securityConnectorName, String orgName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, securityConnectorName, orgName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of Azure DevOps projects onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String securityConnectorName, String orgName) { + return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, orgName)); + } + + /** + * Returns a list of Azure DevOps projects onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String securityConnectorName, String orgName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, orgName, context)); + } + + /** + * Returns a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String securityConnectorName, String orgName, String projectName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + projectName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String securityConnectorName, String orgName, String projectName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + projectName, + apiVersion, + accept, + context); + } + + /** + * Returns a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String securityConnectorName, String orgName, String projectName) { + return getWithResponseAsync(resourceGroupName, securityConnectorName, orgName, projectName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String securityConnectorName, String orgName, String projectName, Context context) { + return getWithResponseAsync(resourceGroupName, securityConnectorName, orgName, projectName, context).block(); + } + + /** + * Returns a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureDevOpsProjectInner get( + String resourceGroupName, String securityConnectorName, String orgName, String projectName) { + return getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, Context.NONE).getValue(); + } + + /** + * Creates or updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (azureDevOpsProject == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureDevOpsProject is required and cannot be null.")); + } else { + azureDevOpsProject.validate(); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + projectName, + apiVersion, + azureDevOpsProject, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (azureDevOpsProject == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureDevOpsProject is required and cannot be null.")); + } else { + azureDevOpsProject.validate(); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + projectName, + apiVersion, + azureDevOpsProject, + accept, + context); + } + + /** + * Creates or updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AzureDevOpsProjectInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AzureDevOpsProjectInner.class, + AzureDevOpsProjectInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AzureDevOpsProjectInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AzureDevOpsProjectInner.class, + AzureDevOpsProjectInner.class, + context); + } + + /** + * Creates or updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureDevOpsProjectInner> beginCreateOrUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject) + .getSyncPoller(); + } + + /** + * Creates or updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureDevOpsProjectInner> beginCreateOrUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject, context) + .getSyncPoller(); + } + + /** + * Creates or updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject) { + return beginCreateOrUpdateAsync( + resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureDevOpsProjectInner createOrUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject) { + return createOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject) + .block(); + } + + /** + * Creates or updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureDevOpsProjectInner createOrUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject, + Context context) { + return createOrUpdateAsync( + resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject, context) + .block(); + } + + /** + * Updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (azureDevOpsProject == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureDevOpsProject is required and cannot be null.")); + } else { + azureDevOpsProject.validate(); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + projectName, + apiVersion, + azureDevOpsProject, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (azureDevOpsProject == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureDevOpsProject is required and cannot be null.")); + } else { + azureDevOpsProject.validate(); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + projectName, + apiVersion, + azureDevOpsProject, + accept, + context); + } + + /** + * Updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AzureDevOpsProjectInner> beginUpdateAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AzureDevOpsProjectInner.class, + AzureDevOpsProjectInner.class, + this.client.getContext()); + } + + /** + * Updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AzureDevOpsProjectInner> beginUpdateAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AzureDevOpsProjectInner.class, + AzureDevOpsProjectInner.class, + context); + } + + /** + * Updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureDevOpsProjectInner> beginUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject) { + return this + .beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject) + .getSyncPoller(); + } + + /** + * Updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureDevOpsProjectInner> beginUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject, + Context context) { + return this + .beginUpdateAsync( + resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject, context) + .getSyncPoller(); + } + + /** + * Updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject) { + return beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject, + Context context) { + return beginUpdateAsync( + resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureDevOpsProjectInner update( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject) { + return updateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject).block(); + } + + /** + * Updates a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param azureDevOpsProject The Azure DevOps project resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureDevOpsProjectInner update( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + AzureDevOpsProjectInner azureDevOpsProject, + Context context) { + return updateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsImpl.java new file mode 100644 index 000000000000..3c310aa3e79d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsImpl.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.AzureDevOpsProjectsClient; +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner; +import com.azure.resourcemanager.security.models.AzureDevOpsProject; +import com.azure.resourcemanager.security.models.AzureDevOpsProjects; + +public final class AzureDevOpsProjectsImpl implements AzureDevOpsProjects { + private static final ClientLogger LOGGER = new ClientLogger(AzureDevOpsProjectsImpl.class); + + private final AzureDevOpsProjectsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public AzureDevOpsProjectsImpl( + AzureDevOpsProjectsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String securityConnectorName, String orgName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, securityConnectorName, orgName); + return Utils.mapPage(inner, inner1 -> new AzureDevOpsProjectImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String securityConnectorName, String orgName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, securityConnectorName, orgName, context); + return Utils.mapPage(inner, inner1 -> new AzureDevOpsProjectImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String securityConnectorName, String orgName, String projectName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AzureDevOpsProjectImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AzureDevOpsProject get( + String resourceGroupName, String securityConnectorName, String orgName, String projectName) { + AzureDevOpsProjectInner inner = + this.serviceClient().get(resourceGroupName, securityConnectorName, orgName, projectName); + if (inner != null) { + return new AzureDevOpsProjectImpl(inner, this.manager()); + } else { + return null; + } + } + + public AzureDevOpsProject getById(String id) { + String resourceGroupName = Utils.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 securityConnectorName = Utils.getValueFromIdByName(id, "securityConnectors"); + if (securityConnectorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); + } + String orgName = Utils.getValueFromIdByName(id, "azureDevOpsOrgs"); + if (orgName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'azureDevOpsOrgs'.", id))); + } + String projectName = Utils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + return this + .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 securityConnectorName = Utils.getValueFromIdByName(id, "securityConnectors"); + if (securityConnectorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); + } + String orgName = Utils.getValueFromIdByName(id, "azureDevOpsOrgs"); + if (orgName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'azureDevOpsOrgs'.", id))); + } + String projectName = Utils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + return this.getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, context); + } + + private AzureDevOpsProjectsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } + + public AzureDevOpsProjectImpl define(String name) { + return new AzureDevOpsProjectImpl(name, this.manager()); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposClientImpl.java new file mode 100644 index 000000000000..c7a9b98d694c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposClientImpl.java @@ -0,0 +1,1484 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.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.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.security.fluent.AzureDevOpsReposClient; +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner; +import com.azure.resourcemanager.security.models.AzureDevOpsRepositoryListResponse; +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 AzureDevOpsReposClient. */ +public final class AzureDevOpsReposClientImpl implements AzureDevOpsReposClient { + /** The proxy service used to perform REST calls. */ + private final AzureDevOpsReposService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of AzureDevOpsReposClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AzureDevOpsReposClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy.create(AzureDevOpsReposService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterAzureDevOpsRepos to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterAzureD") + public interface AzureDevOpsReposService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}/repos") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("orgName") String orgName, + @PathParam("projectName") String projectName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}/repos/{repoName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("orgName") String orgName, + @PathParam("projectName") String projectName, + @PathParam("repoName") String repoName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}/repos/{repoName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("orgName") String orgName, + @PathParam("projectName") String projectName, + @PathParam("repoName") String repoName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AzureDevOpsRepositoryInner azureDevOpsRepository, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}/repos/{repoName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("orgName") String orgName, + @PathParam("projectName") String projectName, + @PathParam("repoName") String repoName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AzureDevOpsRepositoryInner azureDevOpsRepository, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns a list of Azure DevOps repositories onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String securityConnectorName, String orgName, String projectName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + projectName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a list of Azure DevOps repositories onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String securityConnectorName, String orgName, String projectName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + projectName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of Azure DevOps repositories onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String securityConnectorName, String orgName, String projectName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, securityConnectorName, orgName, projectName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of Azure DevOps repositories onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String securityConnectorName, String orgName, String projectName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, securityConnectorName, orgName, projectName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of Azure DevOps repositories onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String securityConnectorName, String orgName, String projectName) { + return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, orgName, projectName)); + } + + /** + * Returns a list of Azure DevOps repositories onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String securityConnectorName, String orgName, String projectName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, orgName, projectName, context)); + } + + /** + * Returns a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (repoName == null) { + return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + projectName, + repoName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (repoName == null) { + return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + projectName, + repoName, + apiVersion, + accept, + context); + } + + /** + * Returns a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName) { + return getWithResponseAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + Context context) { + return getWithResponseAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, context) + .block(); + } + + /** + * Returns a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureDevOpsRepositoryInner get( + String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName) { + return getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, repoName, Context.NONE) + .getValue(); + } + + /** + * Creates or updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (repoName == null) { + return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); + } + if (azureDevOpsRepository == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureDevOpsRepository is required and cannot be null.")); + } else { + azureDevOpsRepository.validate(); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + projectName, + repoName, + apiVersion, + azureDevOpsRepository, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (repoName == null) { + return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); + } + if (azureDevOpsRepository == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureDevOpsRepository is required and cannot be null.")); + } else { + azureDevOpsRepository.validate(); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + projectName, + repoName, + apiVersion, + azureDevOpsRepository, + accept, + context); + } + + /** + * Creates or updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AzureDevOpsRepositoryInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, securityConnectorName, orgName, projectName, repoName, azureDevOpsRepository); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AzureDevOpsRepositoryInner.class, + AzureDevOpsRepositoryInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AzureDevOpsRepositoryInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + securityConnectorName, + orgName, + projectName, + repoName, + azureDevOpsRepository, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AzureDevOpsRepositoryInner.class, + AzureDevOpsRepositoryInner.class, + context); + } + + /** + * Creates or updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureDevOpsRepositoryInner> beginCreateOrUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, securityConnectorName, orgName, projectName, repoName, azureDevOpsRepository) + .getSyncPoller(); + } + + /** + * Creates or updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureDevOpsRepositoryInner> beginCreateOrUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, + securityConnectorName, + orgName, + projectName, + repoName, + azureDevOpsRepository, + context) + .getSyncPoller(); + } + + /** + * Creates or updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository) { + return beginCreateOrUpdateAsync( + resourceGroupName, securityConnectorName, orgName, projectName, repoName, azureDevOpsRepository) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + securityConnectorName, + orgName, + projectName, + repoName, + azureDevOpsRepository, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureDevOpsRepositoryInner createOrUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository) { + return createOrUpdateAsync( + resourceGroupName, securityConnectorName, orgName, projectName, repoName, azureDevOpsRepository) + .block(); + } + + /** + * Creates or updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureDevOpsRepositoryInner createOrUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository, + Context context) { + return createOrUpdateAsync( + resourceGroupName, + securityConnectorName, + orgName, + projectName, + repoName, + azureDevOpsRepository, + context) + .block(); + } + + /** + * Updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (repoName == null) { + return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); + } + if (azureDevOpsRepository == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureDevOpsRepository is required and cannot be null.")); + } else { + azureDevOpsRepository.validate(); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + projectName, + repoName, + apiVersion, + azureDevOpsRepository, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (orgName == null) { + return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (repoName == null) { + return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); + } + if (azureDevOpsRepository == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureDevOpsRepository is required and cannot be null.")); + } else { + azureDevOpsRepository.validate(); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + orgName, + projectName, + repoName, + apiVersion, + azureDevOpsRepository, + accept, + context); + } + + /** + * Updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AzureDevOpsRepositoryInner> beginUpdateAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, securityConnectorName, orgName, projectName, repoName, azureDevOpsRepository); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AzureDevOpsRepositoryInner.class, + AzureDevOpsRepositoryInner.class, + this.client.getContext()); + } + + /** + * Updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AzureDevOpsRepositoryInner> beginUpdateAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, + securityConnectorName, + orgName, + projectName, + repoName, + azureDevOpsRepository, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AzureDevOpsRepositoryInner.class, + AzureDevOpsRepositoryInner.class, + context); + } + + /** + * Updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureDevOpsRepositoryInner> beginUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository) { + return this + .beginUpdateAsync( + resourceGroupName, securityConnectorName, orgName, projectName, repoName, azureDevOpsRepository) + .getSyncPoller(); + } + + /** + * Updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureDevOpsRepositoryInner> beginUpdate( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository, + Context context) { + return this + .beginUpdateAsync( + resourceGroupName, + securityConnectorName, + orgName, + projectName, + repoName, + azureDevOpsRepository, + context) + .getSyncPoller(); + } + + /** + * Updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository) { + return beginUpdateAsync( + resourceGroupName, securityConnectorName, orgName, projectName, repoName, azureDevOpsRepository) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository, + Context context) { + return beginUpdateAsync( + resourceGroupName, + securityConnectorName, + orgName, + projectName, + repoName, + azureDevOpsRepository, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureDevOpsRepositoryInner update( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository) { + return updateAsync( + resourceGroupName, securityConnectorName, orgName, projectName, repoName, azureDevOpsRepository) + .block(); + } + + /** + * Updates a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param azureDevOpsRepository The Azure DevOps repository resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureDevOpsRepositoryInner update( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + AzureDevOpsRepositoryInner azureDevOpsRepository, + Context context) { + return updateAsync( + resourceGroupName, + securityConnectorName, + orgName, + projectName, + repoName, + azureDevOpsRepository, + context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposImpl.java new file mode 100644 index 000000000000..d59aa200dfe6 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposImpl.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.AzureDevOpsReposClient; +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner; +import com.azure.resourcemanager.security.models.AzureDevOpsRepos; +import com.azure.resourcemanager.security.models.AzureDevOpsRepository; + +public final class AzureDevOpsReposImpl implements AzureDevOpsRepos { + private static final ClientLogger LOGGER = new ClientLogger(AzureDevOpsReposImpl.class); + + private final AzureDevOpsReposClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public AzureDevOpsReposImpl( + AzureDevOpsReposClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String securityConnectorName, String orgName, String projectName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, securityConnectorName, orgName, projectName); + return Utils.mapPage(inner, inner1 -> new AzureDevOpsRepositoryImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String securityConnectorName, String orgName, String projectName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, securityConnectorName, orgName, projectName, context); + return Utils.mapPage(inner, inner1 -> new AzureDevOpsRepositoryImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, repoName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AzureDevOpsRepositoryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AzureDevOpsRepository get( + String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName) { + AzureDevOpsRepositoryInner inner = + this.serviceClient().get(resourceGroupName, securityConnectorName, orgName, projectName, repoName); + if (inner != null) { + return new AzureDevOpsRepositoryImpl(inner, this.manager()); + } else { + return null; + } + } + + public AzureDevOpsRepository getById(String id) { + String resourceGroupName = Utils.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 securityConnectorName = Utils.getValueFromIdByName(id, "securityConnectors"); + if (securityConnectorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); + } + String orgName = Utils.getValueFromIdByName(id, "azureDevOpsOrgs"); + if (orgName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'azureDevOpsOrgs'.", id))); + } + String projectName = Utils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String repoName = Utils.getValueFromIdByName(id, "repos"); + if (repoName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'repos'.", id))); + } + return this + .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, repoName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 securityConnectorName = Utils.getValueFromIdByName(id, "securityConnectors"); + if (securityConnectorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); + } + String orgName = Utils.getValueFromIdByName(id, "azureDevOpsOrgs"); + if (orgName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'azureDevOpsOrgs'.", id))); + } + String projectName = Utils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String repoName = Utils.getValueFromIdByName(id, "repos"); + if (repoName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'repos'.", id))); + } + return this.getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, repoName, context); + } + + private AzureDevOpsReposClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } + + public AzureDevOpsRepositoryImpl define(String name) { + return new AzureDevOpsRepositoryImpl(name, this.manager()); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsRepositoryImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsRepositoryImpl.java new file mode 100644 index 000000000000..922bdaf7c6be --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsRepositoryImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner; +import com.azure.resourcemanager.security.models.AzureDevOpsRepository; +import com.azure.resourcemanager.security.models.AzureDevOpsRepositoryProperties; + +public final class AzureDevOpsRepositoryImpl + implements AzureDevOpsRepository, AzureDevOpsRepository.Definition, AzureDevOpsRepository.Update { + private AzureDevOpsRepositoryInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AzureDevOpsRepositoryProperties properties() { + return this.innerModel().properties(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AzureDevOpsRepositoryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String securityConnectorName; + + private String orgName; + + private String projectName; + + private String repoName; + + public AzureDevOpsRepositoryImpl withExistingProject( + String resourceGroupName, String securityConnectorName, String orgName, String projectName) { + this.resourceGroupName = resourceGroupName; + this.securityConnectorName = securityConnectorName; + this.orgName = orgName; + this.projectName = projectName; + return this; + } + + public AzureDevOpsRepository create() { + this.innerObject = + serviceManager + .serviceClient() + .getAzureDevOpsRepos() + .createOrUpdate( + resourceGroupName, + securityConnectorName, + orgName, + projectName, + repoName, + this.innerModel(), + Context.NONE); + return this; + } + + public AzureDevOpsRepository create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAzureDevOpsRepos() + .createOrUpdate( + resourceGroupName, + securityConnectorName, + orgName, + projectName, + repoName, + this.innerModel(), + context); + return this; + } + + AzureDevOpsRepositoryImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = new AzureDevOpsRepositoryInner(); + this.serviceManager = serviceManager; + this.repoName = name; + } + + public AzureDevOpsRepositoryImpl update() { + return this; + } + + public AzureDevOpsRepository apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAzureDevOpsRepos() + .update( + resourceGroupName, + securityConnectorName, + orgName, + projectName, + repoName, + this.innerModel(), + Context.NONE); + return this; + } + + public AzureDevOpsRepository apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAzureDevOpsRepos() + .update( + resourceGroupName, + securityConnectorName, + orgName, + projectName, + repoName, + this.innerModel(), + context); + return this; + } + + AzureDevOpsRepositoryImpl( + AzureDevOpsRepositoryInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.securityConnectorName = Utils.getValueFromIdByName(innerObject.id(), "securityConnectors"); + this.orgName = Utils.getValueFromIdByName(innerObject.id(), "azureDevOpsOrgs"); + this.projectName = Utils.getValueFromIdByName(innerObject.id(), "projects"); + this.repoName = Utils.getValueFromIdByName(innerObject.id(), "repos"); + } + + public AzureDevOpsRepository refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAzureDevOpsRepos() + .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, repoName, Context.NONE) + .getValue(); + return this; + } + + public AzureDevOpsRepository refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAzureDevOpsRepos() + .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, repoName, context) + .getValue(); + return this; + } + + public AzureDevOpsRepositoryImpl withProperties(AzureDevOpsRepositoryProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectionStringsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectionStringsImpl.java deleted file mode 100644 index 9014f64c6f6b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectionStringsImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.ConnectionStringsInner; -import com.azure.resourcemanager.security.models.ConnectionStrings; -import com.azure.resourcemanager.security.models.IngestionConnectionString; -import java.util.Collections; -import java.util.List; - -public final class ConnectionStringsImpl implements ConnectionStrings { - private ConnectionStringsInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ConnectionStringsImpl( - ConnectionStringsInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public ConnectionStringsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStorageSettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStorageSettingImpl.java new file mode 100644 index 000000000000..70fac8f685af --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStorageSettingImpl.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.DefenderForStorageSettingInner; +import com.azure.resourcemanager.security.models.DefenderForStorageSetting; +import com.azure.resourcemanager.security.models.OperationStatusAutoGenerated; +import com.azure.resourcemanager.security.models.SettingNameAutoGenerated; + +public final class DefenderForStorageSettingImpl + implements DefenderForStorageSetting, DefenderForStorageSetting.Definition { + private DefenderForStorageSettingInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + DefenderForStorageSettingImpl( + DefenderForStorageSettingInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Boolean isEnabled() { + return this.innerModel().isEnabled(); + } + + public Boolean overrideSubscriptionLevelSettings() { + return this.innerModel().overrideSubscriptionLevelSettings(); + } + + public String scanResultsEventGridTopicResourceId() { + return this.innerModel().scanResultsEventGridTopicResourceId(); + } + + public OperationStatusAutoGenerated operationStatus() { + return this.innerModel().operationStatus(); + } + + public Boolean isEnabledMalwareScanningIsEnabled() { + return this.innerModel().isEnabledMalwareScanningIsEnabled(); + } + + public Integer capGBPerMonth() { + return this.innerModel().capGBPerMonth(); + } + + public Boolean isEnabledSensitiveDataDiscoveryIsEnabled() { + return this.innerModel().isEnabledSensitiveDataDiscoveryIsEnabled(); + } + + public OperationStatusAutoGenerated operationStatusSensitiveDataDiscoveryOperationStatus() { + return this.innerModel().operationStatusSensitiveDataDiscoveryOperationStatus(); + } + + public DefenderForStorageSettingInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } + + private String resourceId; + + private SettingNameAutoGenerated settingName; + + public DefenderForStorageSettingImpl withExistingResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + public DefenderForStorageSetting create() { + this.innerObject = + serviceManager + .serviceClient() + .getDefenderForStorages() + .createWithResponse(resourceId, settingName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public DefenderForStorageSetting create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDefenderForStorages() + .createWithResponse(resourceId, settingName, this.innerModel(), context) + .getValue(); + return this; + } + + DefenderForStorageSettingImpl( + SettingNameAutoGenerated name, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = new DefenderForStorageSettingInner(); + this.serviceManager = serviceManager; + this.settingName = name; + } + + public DefenderForStorageSetting refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDefenderForStorages() + .getWithResponse(resourceId, settingName, Context.NONE) + .getValue(); + return this; + } + + public DefenderForStorageSetting refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDefenderForStorages() + .getWithResponse(resourceId, settingName, context) + .getValue(); + return this; + } + + public DefenderForStorageSettingImpl withIsEnabled(Boolean isEnabled) { + this.innerModel().withIsEnabled(isEnabled); + return this; + } + + public DefenderForStorageSettingImpl withOverrideSubscriptionLevelSettings( + Boolean overrideSubscriptionLevelSettings) { + this.innerModel().withOverrideSubscriptionLevelSettings(overrideSubscriptionLevelSettings); + return this; + } + + public DefenderForStorageSettingImpl withScanResultsEventGridTopicResourceId( + String scanResultsEventGridTopicResourceId) { + this.innerModel().withScanResultsEventGridTopicResourceId(scanResultsEventGridTopicResourceId); + return this; + } + + public DefenderForStorageSettingImpl withIsEnabledMalwareScanningIsEnabled( + Boolean isEnabledMalwareScanningIsEnabled) { + this.innerModel().withIsEnabledMalwareScanningIsEnabled(isEnabledMalwareScanningIsEnabled); + return this; + } + + public DefenderForStorageSettingImpl withCapGBPerMonth(Integer capGBPerMonth) { + this.innerModel().withCapGBPerMonth(capGBPerMonth); + return this; + } + + public DefenderForStorageSettingImpl withIsEnabledSensitiveDataDiscoveryIsEnabled( + Boolean isEnabledSensitiveDataDiscoveryIsEnabled) { + this.innerModel().withIsEnabledSensitiveDataDiscoveryIsEnabled(isEnabledSensitiveDataDiscoveryIsEnabled); + return this; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesClientImpl.java new file mode 100644 index 000000000000..e453c827e03a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesClientImpl.java @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.security.fluent.DefenderForStoragesClient; +import com.azure.resourcemanager.security.fluent.models.DefenderForStorageSettingInner; +import com.azure.resourcemanager.security.models.SettingNameAutoGenerated; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DefenderForStoragesClient. */ +public final class DefenderForStoragesClientImpl implements DefenderForStoragesClient { + /** The proxy service used to perform REST calls. */ + private final DefenderForStoragesService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of DefenderForStoragesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DefenderForStoragesClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy.create(DefenderForStoragesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterDefenderForStorages to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterDefend") + public interface DefenderForStoragesService { + @Headers({"Content-Type: application/json"}) + @Get("/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceId", encoded = true) String resourceId, + @PathParam("settingName") SettingNameAutoGenerated settingName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceId", encoded = true) String resourceId, + @PathParam("settingName") SettingNameAutoGenerated settingName, + @BodyParam("application/json") DefenderForStorageSettingInner defenderForStorageSetting, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the Defender for Storage settings for the specified storage account. + * + * @param resourceId The identifier of the resource. + * @param settingName Defender for Storage setting name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Defender for Storage settings for the specified storage account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceId, SettingNameAutoGenerated settingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + if (settingName == null) { + return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); + } + final String apiVersion = "2022-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), apiVersion, resourceId, settingName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the Defender for Storage settings for the specified storage account. + * + * @param resourceId The identifier of the resource. + * @param settingName Defender for Storage setting name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Defender for Storage settings for the specified storage account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceId, SettingNameAutoGenerated settingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + if (settingName == null) { + return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); + } + final String apiVersion = "2022-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), apiVersion, resourceId, settingName, accept, context); + } + + /** + * Gets the Defender for Storage settings for the specified storage account. + * + * @param resourceId The identifier of the resource. + * @param settingName Defender for Storage setting name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Defender for Storage settings for the specified storage account on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceId, SettingNameAutoGenerated settingName) { + return getWithResponseAsync(resourceId, settingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the Defender for Storage settings for the specified storage account. + * + * @param resourceId The identifier of the resource. + * @param settingName Defender for Storage setting name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Defender for Storage settings for the specified storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceId, SettingNameAutoGenerated settingName, Context context) { + return getWithResponseAsync(resourceId, settingName, context).block(); + } + + /** + * Gets the Defender for Storage settings for the specified storage account. + * + * @param resourceId The identifier of the resource. + * @param settingName Defender for Storage setting name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Defender for Storage settings for the specified storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DefenderForStorageSettingInner get(String resourceId, SettingNameAutoGenerated settingName) { + return getWithResponse(resourceId, settingName, Context.NONE).getValue(); + } + + /** + * Creates or updates the Defender for Storage settings on a specified storage account. + * + * @param resourceId The identifier of the resource. + * @param settingName Defender for Storage setting name. + * @param defenderForStorageSetting Defender for Storage Settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Defender for Storage resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceId, + SettingNameAutoGenerated settingName, + DefenderForStorageSettingInner defenderForStorageSetting) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + if (settingName == null) { + return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); + } + if (defenderForStorageSetting == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter defenderForStorageSetting is required and cannot be null.")); + } else { + defenderForStorageSetting.validate(); + } + final String apiVersion = "2022-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + apiVersion, + resourceId, + settingName, + defenderForStorageSetting, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the Defender for Storage settings on a specified storage account. + * + * @param resourceId The identifier of the resource. + * @param settingName Defender for Storage setting name. + * @param defenderForStorageSetting Defender for Storage Settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Defender for Storage resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceId, + SettingNameAutoGenerated settingName, + DefenderForStorageSettingInner defenderForStorageSetting, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + if (settingName == null) { + return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); + } + if (defenderForStorageSetting == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter defenderForStorageSetting is required and cannot be null.")); + } else { + defenderForStorageSetting.validate(); + } + final String apiVersion = "2022-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + apiVersion, + resourceId, + settingName, + defenderForStorageSetting, + accept, + context); + } + + /** + * Creates or updates the Defender for Storage settings on a specified storage account. + * + * @param resourceId The identifier of the resource. + * @param settingName Defender for Storage setting name. + * @param defenderForStorageSetting Defender for Storage Settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Defender for Storage resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceId, + SettingNameAutoGenerated settingName, + DefenderForStorageSettingInner defenderForStorageSetting) { + return createWithResponseAsync(resourceId, settingName, defenderForStorageSetting) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates the Defender for Storage settings on a specified storage account. + * + * @param resourceId The identifier of the resource. + * @param settingName Defender for Storage setting name. + * @param defenderForStorageSetting Defender for Storage Settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Defender for Storage resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceId, + SettingNameAutoGenerated settingName, + DefenderForStorageSettingInner defenderForStorageSetting, + Context context) { + return createWithResponseAsync(resourceId, settingName, defenderForStorageSetting, context).block(); + } + + /** + * Creates or updates the Defender for Storage settings on a specified storage account. + * + * @param resourceId The identifier of the resource. + * @param settingName Defender for Storage setting name. + * @param defenderForStorageSetting Defender for Storage Settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Defender for Storage resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DefenderForStorageSettingInner create( + String resourceId, + SettingNameAutoGenerated settingName, + DefenderForStorageSettingInner defenderForStorageSetting) { + return createWithResponse(resourceId, settingName, defenderForStorageSetting, Context.NONE).getValue(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesImpl.java new file mode 100644 index 000000000000..f7f7bd3e3c21 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesImpl.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.DefenderForStoragesClient; +import com.azure.resourcemanager.security.fluent.models.DefenderForStorageSettingInner; +import com.azure.resourcemanager.security.models.DefenderForStorageSetting; +import com.azure.resourcemanager.security.models.DefenderForStorages; +import com.azure.resourcemanager.security.models.SettingNameAutoGenerated; + +public final class DefenderForStoragesImpl implements DefenderForStorages { + private static final ClientLogger LOGGER = new ClientLogger(DefenderForStoragesImpl.class); + + private final DefenderForStoragesClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public DefenderForStoragesImpl( + DefenderForStoragesClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceId, SettingNameAutoGenerated settingName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceId, settingName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DefenderForStorageSettingImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DefenderForStorageSetting get(String resourceId, SettingNameAutoGenerated settingName) { + DefenderForStorageSettingInner inner = this.serviceClient().get(resourceId, settingName); + if (inner != null) { + return new DefenderForStorageSettingImpl(inner, this.manager()); + } else { + return null; + } + } + + public DefenderForStorageSetting getById(String id) { + String resourceId = + Utils + .getValueFromIdByParameterName( + id, + "/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}", + "resourceId"); + if (resourceId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); + } + String settingNameLocal = + Utils + .getValueFromIdByParameterName( + id, + "/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}", + "settingName"); + if (settingNameLocal == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'defenderForStorageSettings'.", + id))); + } + SettingNameAutoGenerated settingName = SettingNameAutoGenerated.fromString(settingNameLocal); + return this.getWithResponse(resourceId, settingName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceId = + Utils + .getValueFromIdByParameterName( + id, + "/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}", + "resourceId"); + if (resourceId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); + } + String settingNameLocal = + Utils + .getValueFromIdByParameterName( + id, + "/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}", + "settingName"); + if (settingNameLocal == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'defenderForStorageSettings'.", + id))); + } + SettingNameAutoGenerated settingName = SettingNameAutoGenerated.fromString(settingNameLocal); + return this.getWithResponse(resourceId, settingName, context); + } + + private DefenderForStoragesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } + + public DefenderForStorageSettingImpl define(SettingNameAutoGenerated name) { + return new DefenderForStorageSettingImpl(name, this.manager()); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationImpl.java new file mode 100644 index 000000000000..f372235d513f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; +import com.azure.resourcemanager.security.models.DevOpsConfiguration; +import com.azure.resourcemanager.security.models.DevOpsConfigurationProperties; + +public final class DevOpsConfigurationImpl implements DevOpsConfiguration { + private DevOpsConfigurationInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + DevOpsConfigurationImpl( + DevOpsConfigurationInner innerObject, com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public DevOpsConfigurationProperties properties() { + return this.innerModel().properties(); + } + + public DevOpsConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsClientImpl.java new file mode 100644 index 000000000000..eee103110b11 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsClientImpl.java @@ -0,0 +1,1384 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.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.security.fluent.DevOpsConfigurationsClient; +import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; +import com.azure.resourcemanager.security.models.DevOpsConfigurationListResponse; +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 DevOpsConfigurationsClient. */ +public final class DevOpsConfigurationsClientImpl implements DevOpsConfigurationsClient { + /** The proxy service used to perform REST calls. */ + private final DevOpsConfigurationsService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of DevOpsConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DevOpsConfigurationsClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy + .create(DevOpsConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterDevOpsConfigurations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterDevOps") + public interface DevOpsConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DevOpsConfigurationInner devOpsConfiguration, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DevOpsConfigurationInner devOpsConfiguration, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List DevOps Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String securityConnectorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List DevOps Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String securityConnectorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List DevOps Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String securityConnectorName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, securityConnectorName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List DevOps Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String securityConnectorName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, securityConnectorName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List DevOps Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String securityConnectorName) { + return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName)); + } + + /** + * List DevOps Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String securityConnectorName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, context)); + } + + /** + * Gets a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DevOps Configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String securityConnectorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 DevOps Configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String securityConnectorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + accept, + context); + } + + /** + * Gets a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DevOps Configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String securityConnectorName) { + return getWithResponseAsync(resourceGroupName, securityConnectorName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 DevOps Configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String securityConnectorName, Context context) { + return getWithResponseAsync(resourceGroupName, securityConnectorName, context).block(); + } + + /** + * Gets a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DevOps Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DevOpsConfigurationInner get(String resourceGroupName, String securityConnectorName) { + return getWithResponse(resourceGroupName, securityConnectorName, Context.NONE).getValue(); + } + + /** + * Creates or updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return devOps Configuration resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (devOpsConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter devOpsConfiguration is required and cannot be null.")); + } else { + devOpsConfiguration.validate(); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + devOpsConfiguration, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return devOps Configuration resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String securityConnectorName, + DevOpsConfigurationInner devOpsConfiguration, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (devOpsConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter devOpsConfiguration is required and cannot be null.")); + } else { + devOpsConfiguration.validate(); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + devOpsConfiguration, + accept, + context); + } + + /** + * Creates or updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of devOps Configuration resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DevOpsConfigurationInner> beginCreateOrUpdateAsync( + String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, devOpsConfiguration); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DevOpsConfigurationInner.class, + DevOpsConfigurationInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of devOps Configuration resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DevOpsConfigurationInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String securityConnectorName, + DevOpsConfigurationInner devOpsConfiguration, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DevOpsConfigurationInner.class, + DevOpsConfigurationInner.class, + context); + } + + /** + * Creates or updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of devOps Configuration resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DevOpsConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration) + .getSyncPoller(); + } + + /** + * Creates or updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of devOps Configuration resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DevOpsConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String securityConnectorName, + DevOpsConfigurationInner devOpsConfiguration, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context) + .getSyncPoller(); + } + + /** + * Creates or updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return devOps Configuration resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { + return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return devOps Configuration resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String securityConnectorName, + DevOpsConfigurationInner devOpsConfiguration, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return devOps Configuration resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DevOpsConfigurationInner createOrUpdate( + String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { + return createOrUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration).block(); + } + + /** + * Creates or updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return devOps Configuration resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DevOpsConfigurationInner createOrUpdate( + String resourceGroupName, + String securityConnectorName, + DevOpsConfigurationInner devOpsConfiguration, + Context context) { + return createOrUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context).block(); + } + + /** + * Updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return devOps Configuration resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (devOpsConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter devOpsConfiguration is required and cannot be null.")); + } else { + devOpsConfiguration.validate(); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + devOpsConfiguration, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return devOps Configuration resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String securityConnectorName, + DevOpsConfigurationInner devOpsConfiguration, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (devOpsConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter devOpsConfiguration is required and cannot be null.")); + } else { + devOpsConfiguration.validate(); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + devOpsConfiguration, + accept, + context); + } + + /** + * Updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of devOps Configuration resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DevOpsConfigurationInner> beginUpdateAsync( + String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, securityConnectorName, devOpsConfiguration); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DevOpsConfigurationInner.class, + DevOpsConfigurationInner.class, + this.client.getContext()); + } + + /** + * Updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of devOps Configuration resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DevOpsConfigurationInner> beginUpdateAsync( + String resourceGroupName, + String securityConnectorName, + DevOpsConfigurationInner devOpsConfiguration, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DevOpsConfigurationInner.class, + DevOpsConfigurationInner.class, + context); + } + + /** + * Updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of devOps Configuration resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DevOpsConfigurationInner> beginUpdate( + String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { + return this.beginUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration).getSyncPoller(); + } + + /** + * Updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of devOps Configuration resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DevOpsConfigurationInner> beginUpdate( + String resourceGroupName, + String securityConnectorName, + DevOpsConfigurationInner devOpsConfiguration, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context) + .getSyncPoller(); + } + + /** + * Updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return devOps Configuration resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { + return beginUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return devOps Configuration resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String securityConnectorName, + DevOpsConfigurationInner devOpsConfiguration, + Context context) { + return beginUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return devOps Configuration resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DevOpsConfigurationInner update( + String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { + return updateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration).block(); + } + + /** + * Updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return devOps Configuration resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DevOpsConfigurationInner update( + String resourceGroupName, + String securityConnectorName, + DevOpsConfigurationInner devOpsConfiguration, + Context context) { + return updateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context).block(); + } + + /** + * Deletes a DevOps Connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String securityConnectorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a DevOps Connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 securityConnectorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + accept, + context); + } + + /** + * Deletes a DevOps Connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String securityConnectorName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, securityConnectorName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a DevOps Connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 securityConnectorName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, securityConnectorName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a DevOps Connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String securityConnectorName) { + return this.beginDeleteAsync(resourceGroupName, securityConnectorName).getSyncPoller(); + } + + /** + * Deletes a DevOps Connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 securityConnectorName, Context context) { + return this.beginDeleteAsync(resourceGroupName, securityConnectorName, context).getSyncPoller(); + } + + /** + * Deletes a DevOps Connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String securityConnectorName) { + return beginDeleteAsync(resourceGroupName, securityConnectorName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a DevOps Connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 securityConnectorName, Context context) { + return beginDeleteAsync(resourceGroupName, securityConnectorName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a DevOps Connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String securityConnectorName) { + deleteAsync(resourceGroupName, securityConnectorName).block(); + } + + /** + * Deletes a DevOps Connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 securityConnectorName, Context context) { + deleteAsync(resourceGroupName, securityConnectorName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsImpl.java new file mode 100644 index 000000000000..003718f18f62 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsImpl.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.DevOpsConfigurationsClient; +import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; +import com.azure.resourcemanager.security.models.DevOpsConfiguration; +import com.azure.resourcemanager.security.models.DevOpsConfigurations; + +public final class DevOpsConfigurationsImpl implements DevOpsConfigurations { + private static final ClientLogger LOGGER = new ClientLogger(DevOpsConfigurationsImpl.class); + + private final DevOpsConfigurationsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public DevOpsConfigurationsImpl( + DevOpsConfigurationsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String securityConnectorName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, securityConnectorName); + return Utils.mapPage(inner, inner1 -> new DevOpsConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String securityConnectorName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, securityConnectorName, context); + return Utils.mapPage(inner, inner1 -> new DevOpsConfigurationImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String securityConnectorName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DevOpsConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DevOpsConfiguration get(String resourceGroupName, String securityConnectorName) { + DevOpsConfigurationInner inner = this.serviceClient().get(resourceGroupName, securityConnectorName); + if (inner != null) { + return new DevOpsConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public DevOpsConfiguration createOrUpdate( + String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { + DevOpsConfigurationInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, securityConnectorName, devOpsConfiguration); + if (inner != null) { + return new DevOpsConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public DevOpsConfiguration createOrUpdate( + String resourceGroupName, + String securityConnectorName, + DevOpsConfigurationInner devOpsConfiguration, + Context context) { + DevOpsConfigurationInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, securityConnectorName, devOpsConfiguration, context); + if (inner != null) { + return new DevOpsConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public DevOpsConfiguration update( + String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { + DevOpsConfigurationInner inner = + this.serviceClient().update(resourceGroupName, securityConnectorName, devOpsConfiguration); + if (inner != null) { + return new DevOpsConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public DevOpsConfiguration update( + String resourceGroupName, + String securityConnectorName, + DevOpsConfigurationInner devOpsConfiguration, + Context context) { + DevOpsConfigurationInner inner = + this.serviceClient().update(resourceGroupName, securityConnectorName, devOpsConfiguration, context); + if (inner != null) { + return new DevOpsConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String securityConnectorName) { + this.serviceClient().delete(resourceGroupName, securityConnectorName); + } + + public void delete(String resourceGroupName, String securityConnectorName, Context context) { + this.serviceClient().delete(resourceGroupName, securityConnectorName, context); + } + + private DevOpsConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOnboardingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsClientImpl.java similarity index 50% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOnboardingsClientImpl.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsClientImpl.java index f2eab89967ab..2e0d9194eab6 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOnboardingsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsClientImpl.java @@ -5,12 +5,12 @@ package com.azure.resourcemanager.security.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.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -21,72 +21,68 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.ApiCollectionOnboardingsClient; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionResponseInner; +import com.azure.resourcemanager.security.fluent.DevOpsOperationResultsClient; +import com.azure.resourcemanager.security.fluent.models.OperationStatusResultInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ApiCollectionOnboardingsClient. */ -public final class ApiCollectionOnboardingsClientImpl implements ApiCollectionOnboardingsClient { +/** An instance of this class provides access to all the operations defined in DevOpsOperationResultsClient. */ +public final class DevOpsOperationResultsClientImpl implements DevOpsOperationResultsClient { /** The proxy service used to perform REST calls. */ - private final ApiCollectionOnboardingsService service; + private final DevOpsOperationResultsService service; /** The service client containing this operation class. */ private final SecurityCenterImpl client; /** - * Initializes an instance of ApiCollectionOnboardingsClientImpl. + * Initializes an instance of DevOpsOperationResultsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ApiCollectionOnboardingsClientImpl(SecurityCenterImpl client) { + DevOpsOperationResultsClientImpl(SecurityCenterImpl client) { this.service = RestProxy - .create(ApiCollectionOnboardingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + .create(DevOpsOperationResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for SecurityCenterApiCollectionOnboardings to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for SecurityCenterDevOpsOperationResults to be used by the proxy service + * to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "SecurityCenterApiCol") - public interface ApiCollectionOnboardingsService { + @ServiceInterface(name = "SecurityCenterDevOps") + public interface DevOpsOperationResultsService { @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiCollectionId}") + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/operationResults/{operationResultId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( + Mono> get( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serviceName") String serviceName, - @PathParam("apiCollectionId") String apiCollectionId, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("operationResultId") String operationResultId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to Defender for APIs. The system will start monitoring the operations - * within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected. + * Get devops long running operation result. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @param securityConnectorName The security connector name. + * @param operationResultId The operation result Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 API collection as represented by Defender for APIs along with {@link Response} on successful - * completion of {@link Mono}. + * @return devops long running operation result along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String serviceName, String apiCollectionId) { + private Mono> getWithResponseAsync( + String resourceGroupName, String securityConnectorName, String operationResultId) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -103,25 +99,26 @@ private Mono> createWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); } - if (apiCollectionId == null) { + if (operationResultId == null) { return Mono - .error(new IllegalArgumentException("Parameter apiCollectionId is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter operationResultId is required and cannot be null.")); } - final String apiVersion = "2022-11-20-preview"; + final String apiVersion = "2023-09-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .create( + .get( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - serviceName, - apiCollectionId, + securityConnectorName, + operationResultId, apiVersion, accept, context)) @@ -129,25 +126,21 @@ private Mono> createWithResponseAsync( } /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to Defender for APIs. The system will start monitoring the operations - * within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected. + * Get devops long running operation result. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @param securityConnectorName The security connector name. + * @param operationResultId The operation result 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 an API collection as represented by Defender for APIs along with {@link Response} on successful - * completion of {@link Mono}. + * @return devops long running operation result along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { + private Mono> getWithResponseAsync( + String resourceGroupName, String securityConnectorName, String operationResultId, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -164,89 +157,79 @@ private Mono> createWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); } - if (apiCollectionId == null) { + if (operationResultId == null) { return Mono - .error(new IllegalArgumentException("Parameter apiCollectionId is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter operationResultId is required and cannot be null.")); } - final String apiVersion = "2022-11-20-preview"; + final String apiVersion = "2023-09-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .create( + .get( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - serviceName, - apiCollectionId, + securityConnectorName, + operationResultId, apiVersion, accept, context); } /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to Defender for APIs. The system will start monitoring the operations - * within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected. + * Get devops long running operation result. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @param securityConnectorName The security connector name. + * @param operationResultId The operation result Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 API collection as represented by Defender for APIs on successful completion of {@link Mono}. + * @return devops long running operation result on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String serviceName, String apiCollectionId) { - return createWithResponseAsync(resourceGroupName, serviceName, apiCollectionId) + private Mono getAsync( + String resourceGroupName, String securityConnectorName, String operationResultId) { + return getWithResponseAsync(resourceGroupName, securityConnectorName, operationResultId) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to Defender for APIs. The system will start monitoring the operations - * within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected. + * Get devops long running operation result. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @param securityConnectorName The security connector name. + * @param operationResultId The operation result 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 an API collection as represented by Defender for APIs along with {@link Response}. + * @return devops long running operation result along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { - return createWithResponseAsync(resourceGroupName, serviceName, apiCollectionId, context).block(); + public Response getWithResponse( + String resourceGroupName, String securityConnectorName, String operationResultId, Context context) { + return getWithResponseAsync(resourceGroupName, securityConnectorName, operationResultId, context).block(); } /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to Defender for APIs. The system will start monitoring the operations - * within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected. + * Get devops long running operation result. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @param securityConnectorName The security connector name. + * @param operationResultId The operation result Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 API collection as represented by Defender for APIs. + * @return devops long running operation result. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ApiCollectionResponseInner create(String resourceGroupName, String serviceName, String apiCollectionId) { - return createWithResponse(resourceGroupName, serviceName, apiCollectionId, Context.NONE).getValue(); + public OperationStatusResultInner get( + String resourceGroupName, String securityConnectorName, String operationResultId) { + return getWithResponse(resourceGroupName, securityConnectorName, operationResultId, Context.NONE).getValue(); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsImpl.java new file mode 100644 index 000000000000..1cbd0d1c09d4 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.DevOpsOperationResultsClient; +import com.azure.resourcemanager.security.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.security.models.DevOpsOperationResults; +import com.azure.resourcemanager.security.models.OperationStatusResult; + +public final class DevOpsOperationResultsImpl implements DevOpsOperationResults { + private static final ClientLogger LOGGER = new ClientLogger(DevOpsOperationResultsImpl.class); + + private final DevOpsOperationResultsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public DevOpsOperationResultsImpl( + DevOpsOperationResultsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String securityConnectorName, String operationResultId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, operationResultId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationStatusResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OperationStatusResult get(String resourceGroupName, String securityConnectorName, String operationResultId) { + OperationStatusResultInner inner = + this.serviceClient().get(resourceGroupName, securityConnectorName, operationResultId); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private DevOpsOperationResultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsListResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsListResponseImpl.java new file mode 100644 index 000000000000..cf452cee7ba5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsListResponseImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; +import com.azure.resourcemanager.security.models.GetSensitivitySettingsListResponse; +import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponse; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class GetSensitivitySettingsListResponseImpl implements GetSensitivitySettingsListResponse { + private GetSensitivitySettingsListResponseInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + GetSensitivitySettingsListResponseImpl( + GetSensitivitySettingsListResponseInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new GetSensitivitySettingsResponseImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public GetSensitivitySettingsListResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsResponseImpl.java new file mode 100644 index 000000000000..b0a80f10452a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsResponseImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; +import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponse; +import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponseProperties; + +public final class GetSensitivitySettingsResponseImpl implements GetSensitivitySettingsResponse { + private GetSensitivitySettingsResponseInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + GetSensitivitySettingsResponseImpl( + GetSensitivitySettingsResponseInner innerObject, + com.azure.resourcemanager.security.SecurityManager 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 GetSensitivitySettingsResponseProperties properties() { + return this.innerModel().properties(); + } + + public GetSensitivitySettingsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerImpl.java new file mode 100644 index 000000000000..c8983ce0b00d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.security.fluent.models.GitHubOwnerInner; +import com.azure.resourcemanager.security.models.GitHubOwner; +import com.azure.resourcemanager.security.models.GitHubOwnerProperties; + +public final class GitHubOwnerImpl implements GitHubOwner { + private GitHubOwnerInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + GitHubOwnerImpl(GitHubOwnerInner innerObject, com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public GitHubOwnerProperties properties() { + return this.innerModel().properties(); + } + + public GitHubOwnerInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerListResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerListResponseImpl.java new file mode 100644 index 000000000000..a48b1cdffcf2 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerListResponseImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.resourcemanager.security.fluent.models.GitHubOwnerInner; +import com.azure.resourcemanager.security.fluent.models.GitHubOwnerListResponseInner; +import com.azure.resourcemanager.security.models.GitHubOwner; +import com.azure.resourcemanager.security.models.GitHubOwnerListResponse; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class GitHubOwnerListResponseImpl implements GitHubOwnerListResponse { + private GitHubOwnerListResponseInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + GitHubOwnerListResponseImpl( + GitHubOwnerListResponseInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new GitHubOwnerImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public GitHubOwnerListResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersClientImpl.java new file mode 100644 index 000000000000..2b4c8557d716 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersClientImpl.java @@ -0,0 +1,682 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.security.fluent.GitHubOwnersClient; +import com.azure.resourcemanager.security.fluent.models.GitHubOwnerInner; +import com.azure.resourcemanager.security.fluent.models.GitHubOwnerListResponseInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in GitHubOwnersClient. */ +public final class GitHubOwnersClientImpl implements GitHubOwnersClient { + /** The proxy service used to perform REST calls. */ + private final GitHubOwnersService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of GitHubOwnersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GitHubOwnersClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy.create(GitHubOwnersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterGitHubOwners to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterGitHub") + public interface GitHubOwnersService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/listAvailableGitHubOwners") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAvailable( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitHubOwners") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitHubOwners/{ownerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("ownerName") String ownerName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns a list of all GitHub owners accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableWithResponseAsync( + String resourceGroupName, String securityConnectorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAvailable( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a list of all GitHub owners accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableWithResponseAsync( + String resourceGroupName, String securityConnectorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAvailable( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + accept, + context); + } + + /** + * Returns a list of all GitHub owners accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAvailableAsync( + String resourceGroupName, String securityConnectorName) { + return listAvailableWithResponseAsync(resourceGroupName, securityConnectorName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns a list of all GitHub owners accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAvailableWithResponse( + String resourceGroupName, String securityConnectorName, Context context) { + return listAvailableWithResponseAsync(resourceGroupName, securityConnectorName, context).block(); + } + + /** + * Returns a list of all GitHub owners accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GitHubOwnerListResponseInner listAvailable(String resourceGroupName, String securityConnectorName) { + return listAvailableWithResponse(resourceGroupName, securityConnectorName, Context.NONE).getValue(); + } + + /** + * Returns a list of GitHub owners onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String securityConnectorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a list of GitHub owners onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String securityConnectorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of GitHub owners onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String securityConnectorName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, securityConnectorName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of GitHub owners onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String securityConnectorName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, securityConnectorName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of GitHub owners onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String securityConnectorName) { + return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName)); + } + + /** + * Returns a list of GitHub owners onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String securityConnectorName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, context)); + } + + /** + * Returns a monitored GitHub owner. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitHub Owner resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String securityConnectorName, String ownerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (ownerName == null) { + return Mono.error(new IllegalArgumentException("Parameter ownerName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + ownerName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a monitored GitHub owner. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitHub Owner resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String securityConnectorName, String ownerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (ownerName == null) { + return Mono.error(new IllegalArgumentException("Parameter ownerName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + ownerName, + apiVersion, + accept, + context); + } + + /** + * Returns a monitored GitHub owner. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitHub Owner resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String securityConnectorName, String ownerName) { + return getWithResponseAsync(resourceGroupName, securityConnectorName, ownerName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns a monitored GitHub owner. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitHub Owner resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String securityConnectorName, String ownerName, Context context) { + return getWithResponseAsync(resourceGroupName, securityConnectorName, ownerName, context).block(); + } + + /** + * Returns a monitored GitHub owner. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitHub Owner resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GitHubOwnerInner get(String resourceGroupName, String securityConnectorName, String ownerName) { + return getWithResponse(resourceGroupName, securityConnectorName, ownerName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersImpl.java new file mode 100644 index 000000000000..b82123c74cdb --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersImpl.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.GitHubOwnersClient; +import com.azure.resourcemanager.security.fluent.models.GitHubOwnerInner; +import com.azure.resourcemanager.security.fluent.models.GitHubOwnerListResponseInner; +import com.azure.resourcemanager.security.models.GitHubOwner; +import com.azure.resourcemanager.security.models.GitHubOwnerListResponse; +import com.azure.resourcemanager.security.models.GitHubOwners; + +public final class GitHubOwnersImpl implements GitHubOwners { + private static final ClientLogger LOGGER = new ClientLogger(GitHubOwnersImpl.class); + + private final GitHubOwnersClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public GitHubOwnersImpl( + GitHubOwnersClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listAvailableWithResponse( + String resourceGroupName, String securityConnectorName, Context context) { + Response inner = + this.serviceClient().listAvailableWithResponse(resourceGroupName, securityConnectorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GitHubOwnerListResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GitHubOwnerListResponse listAvailable(String resourceGroupName, String securityConnectorName) { + GitHubOwnerListResponseInner inner = + this.serviceClient().listAvailable(resourceGroupName, securityConnectorName); + if (inner != null) { + return new GitHubOwnerListResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String securityConnectorName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, securityConnectorName); + return Utils.mapPage(inner, inner1 -> new GitHubOwnerImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String securityConnectorName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, securityConnectorName, context); + return Utils.mapPage(inner, inner1 -> new GitHubOwnerImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String securityConnectorName, String ownerName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, ownerName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GitHubOwnerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GitHubOwner get(String resourceGroupName, String securityConnectorName, String ownerName) { + GitHubOwnerInner inner = this.serviceClient().get(resourceGroupName, securityConnectorName, ownerName); + if (inner != null) { + return new GitHubOwnerImpl(inner, this.manager()); + } else { + return null; + } + } + + private GitHubOwnersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposClientImpl.java new file mode 100644 index 000000000000..8942ab90c832 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposClientImpl.java @@ -0,0 +1,551 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.GitHubReposClient; +import com.azure.resourcemanager.security.fluent.models.GitHubRepositoryInner; +import com.azure.resourcemanager.security.models.GitHubRepositoryListResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in GitHubReposClient. */ +public final class GitHubReposClientImpl implements GitHubReposClient { + /** The proxy service used to perform REST calls. */ + private final GitHubReposService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of GitHubReposClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GitHubReposClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy.create(GitHubReposService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterGitHubRepos to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterGitHub") + public interface GitHubReposService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitHubOwners/{ownerName}/repos") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("ownerName") String ownerName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitHubOwners/{ownerName}/repos/{repoName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("ownerName") String ownerName, + @PathParam("repoName") String repoName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns a list of GitHub repositories onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String securityConnectorName, String ownerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (ownerName == null) { + return Mono.error(new IllegalArgumentException("Parameter ownerName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + ownerName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a list of GitHub repositories onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String securityConnectorName, String ownerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (ownerName == null) { + return Mono.error(new IllegalArgumentException("Parameter ownerName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + ownerName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of GitHub repositories onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String securityConnectorName, String ownerName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, securityConnectorName, ownerName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of GitHub repositories onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String securityConnectorName, String ownerName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, securityConnectorName, ownerName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of GitHub repositories onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String securityConnectorName, String ownerName) { + return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, ownerName)); + } + + /** + * Returns a list of GitHub repositories onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String securityConnectorName, String ownerName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, ownerName, context)); + } + + /** + * Returns a monitored GitHub repository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @param repoName The repository name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitHub Repository resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String securityConnectorName, String ownerName, String repoName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (ownerName == null) { + return Mono.error(new IllegalArgumentException("Parameter ownerName is required and cannot be null.")); + } + if (repoName == null) { + return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + ownerName, + repoName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a monitored GitHub repository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @param repoName The repository name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitHub Repository resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String securityConnectorName, String ownerName, String repoName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (ownerName == null) { + return Mono.error(new IllegalArgumentException("Parameter ownerName is required and cannot be null.")); + } + if (repoName == null) { + return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + ownerName, + repoName, + apiVersion, + accept, + context); + } + + /** + * Returns a monitored GitHub repository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @param repoName The repository name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitHub Repository resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String securityConnectorName, String ownerName, String repoName) { + return getWithResponseAsync(resourceGroupName, securityConnectorName, ownerName, repoName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns a monitored GitHub repository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @param repoName The repository name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitHub Repository resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String securityConnectorName, String ownerName, String repoName, Context context) { + return getWithResponseAsync(resourceGroupName, securityConnectorName, ownerName, repoName, context).block(); + } + + /** + * Returns a monitored GitHub repository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @param repoName The repository name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitHub Repository resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GitHubRepositoryInner get( + String resourceGroupName, String securityConnectorName, String ownerName, String repoName) { + return getWithResponse(resourceGroupName, securityConnectorName, ownerName, repoName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposImpl.java new file mode 100644 index 000000000000..17c0f9381c76 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.GitHubReposClient; +import com.azure.resourcemanager.security.fluent.models.GitHubRepositoryInner; +import com.azure.resourcemanager.security.models.GitHubRepos; +import com.azure.resourcemanager.security.models.GitHubRepository; + +public final class GitHubReposImpl implements GitHubRepos { + private static final ClientLogger LOGGER = new ClientLogger(GitHubReposImpl.class); + + private final GitHubReposClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public GitHubReposImpl( + GitHubReposClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String securityConnectorName, String ownerName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, securityConnectorName, ownerName); + return Utils.mapPage(inner, inner1 -> new GitHubRepositoryImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String securityConnectorName, String ownerName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, securityConnectorName, ownerName, context); + return Utils.mapPage(inner, inner1 -> new GitHubRepositoryImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String securityConnectorName, String ownerName, String repoName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, securityConnectorName, ownerName, repoName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GitHubRepositoryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GitHubRepository get( + String resourceGroupName, String securityConnectorName, String ownerName, String repoName) { + GitHubRepositoryInner inner = + this.serviceClient().get(resourceGroupName, securityConnectorName, ownerName, repoName); + if (inner != null) { + return new GitHubRepositoryImpl(inner, this.manager()); + } else { + return null; + } + } + + private GitHubReposClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubRepositoryImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubRepositoryImpl.java new file mode 100644 index 000000000000..a3b4116afaec --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubRepositoryImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.security.fluent.models.GitHubRepositoryInner; +import com.azure.resourcemanager.security.models.GitHubRepository; +import com.azure.resourcemanager.security.models.GitHubRepositoryProperties; + +public final class GitHubRepositoryImpl implements GitHubRepository { + private GitHubRepositoryInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + GitHubRepositoryImpl( + GitHubRepositoryInner innerObject, com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public GitHubRepositoryProperties properties() { + return this.innerModel().properties(); + } + + public GitHubRepositoryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupImpl.java new file mode 100644 index 000000000000..76325ed4607f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.security.fluent.models.GitLabGroupInner; +import com.azure.resourcemanager.security.models.GitLabGroup; +import com.azure.resourcemanager.security.models.GitLabGroupProperties; + +public final class GitLabGroupImpl implements GitLabGroup { + private GitLabGroupInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + GitLabGroupImpl(GitLabGroupInner innerObject, com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public GitLabGroupProperties properties() { + return this.innerModel().properties(); + } + + public GitLabGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupListResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupListResponseImpl.java new file mode 100644 index 000000000000..ae863e487e85 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupListResponseImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.resourcemanager.security.fluent.models.GitLabGroupInner; +import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; +import com.azure.resourcemanager.security.models.GitLabGroup; +import com.azure.resourcemanager.security.models.GitLabGroupListResponse; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class GitLabGroupListResponseImpl implements GitLabGroupListResponse { + private GitLabGroupListResponseInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + GitLabGroupListResponseImpl( + GitLabGroupListResponseInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new GitLabGroupImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public GitLabGroupListResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsClientImpl.java new file mode 100644 index 000000000000..ed2a9cfdf5ea --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsClientImpl.java @@ -0,0 +1,683 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.security.fluent.GitLabGroupsClient; +import com.azure.resourcemanager.security.fluent.models.GitLabGroupInner; +import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in GitLabGroupsClient. */ +public final class GitLabGroupsClientImpl implements GitLabGroupsClient { + /** The proxy service used to perform REST calls. */ + private final GitLabGroupsService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of GitLabGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GitLabGroupsClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy.create(GitLabGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterGitLabGroups to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterGitLab") + public interface GitLabGroupsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/listAvailableGitLabGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAvailable( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitLabGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitLabGroups/{groupFQName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("groupFQName") String groupFQName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns a list of all GitLab groups accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableWithResponseAsync( + String resourceGroupName, String securityConnectorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAvailable( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a list of all GitLab groups accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableWithResponseAsync( + String resourceGroupName, String securityConnectorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAvailable( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + accept, + context); + } + + /** + * Returns a list of all GitLab groups accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAvailableAsync( + String resourceGroupName, String securityConnectorName) { + return listAvailableWithResponseAsync(resourceGroupName, securityConnectorName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns a list of all GitLab groups accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAvailableWithResponse( + String resourceGroupName, String securityConnectorName, Context context) { + return listAvailableWithResponseAsync(resourceGroupName, securityConnectorName, context).block(); + } + + /** + * Returns a list of all GitLab groups accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GitLabGroupListResponseInner listAvailable(String resourceGroupName, String securityConnectorName) { + return listAvailableWithResponse(resourceGroupName, securityConnectorName, Context.NONE).getValue(); + } + + /** + * Returns a list of GitLab groups onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String securityConnectorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a list of GitLab groups onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String securityConnectorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of GitLab groups onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String securityConnectorName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, securityConnectorName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of GitLab groups onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String securityConnectorName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, securityConnectorName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of GitLab groups onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String securityConnectorName) { + return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName)); + } + + /** + * Returns a list of GitLab groups onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String securityConnectorName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, context)); + } + + /** + * Returns a monitored GitLab Group resource for a given fully-qualified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitLab Group resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String securityConnectorName, String groupFQName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (groupFQName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + groupFQName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a monitored GitLab Group resource for a given fully-qualified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitLab Group resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String securityConnectorName, String groupFQName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (groupFQName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + groupFQName, + apiVersion, + accept, + context); + } + + /** + * Returns a monitored GitLab Group resource for a given fully-qualified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitLab Group resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String securityConnectorName, String groupFQName) { + return getWithResponseAsync(resourceGroupName, securityConnectorName, groupFQName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns a monitored GitLab Group resource for a given fully-qualified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitLab Group resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String securityConnectorName, String groupFQName, Context context) { + return getWithResponseAsync(resourceGroupName, securityConnectorName, groupFQName, context).block(); + } + + /** + * Returns a monitored GitLab Group resource for a given fully-qualified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitLab Group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GitLabGroupInner get(String resourceGroupName, String securityConnectorName, String groupFQName) { + return getWithResponse(resourceGroupName, securityConnectorName, groupFQName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsImpl.java new file mode 100644 index 000000000000..4dbd9b0ebae2 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsImpl.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.GitLabGroupsClient; +import com.azure.resourcemanager.security.fluent.models.GitLabGroupInner; +import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; +import com.azure.resourcemanager.security.models.GitLabGroup; +import com.azure.resourcemanager.security.models.GitLabGroupListResponse; +import com.azure.resourcemanager.security.models.GitLabGroups; + +public final class GitLabGroupsImpl implements GitLabGroups { + private static final ClientLogger LOGGER = new ClientLogger(GitLabGroupsImpl.class); + + private final GitLabGroupsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public GitLabGroupsImpl( + GitLabGroupsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listAvailableWithResponse( + String resourceGroupName, String securityConnectorName, Context context) { + Response inner = + this.serviceClient().listAvailableWithResponse(resourceGroupName, securityConnectorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GitLabGroupListResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GitLabGroupListResponse listAvailable(String resourceGroupName, String securityConnectorName) { + GitLabGroupListResponseInner inner = + this.serviceClient().listAvailable(resourceGroupName, securityConnectorName); + if (inner != null) { + return new GitLabGroupListResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String securityConnectorName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, securityConnectorName); + return Utils.mapPage(inner, inner1 -> new GitLabGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String securityConnectorName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, securityConnectorName, context); + return Utils.mapPage(inner, inner1 -> new GitLabGroupImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String securityConnectorName, String groupFQName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, groupFQName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GitLabGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GitLabGroup get(String resourceGroupName, String securityConnectorName, String groupFQName) { + GitLabGroupInner inner = this.serviceClient().get(resourceGroupName, securityConnectorName, groupFQName); + if (inner != null) { + return new GitLabGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + private GitLabGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectImpl.java new file mode 100644 index 000000000000..48c55b268e4a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.security.fluent.models.GitLabProjectInner; +import com.azure.resourcemanager.security.models.GitLabProject; +import com.azure.resourcemanager.security.models.GitLabProjectProperties; + +public final class GitLabProjectImpl implements GitLabProject { + private GitLabProjectInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + GitLabProjectImpl( + GitLabProjectInner innerObject, com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public GitLabProjectProperties properties() { + return this.innerModel().properties(); + } + + public GitLabProjectInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsClientImpl.java new file mode 100644 index 000000000000..b2017dd2afd2 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsClientImpl.java @@ -0,0 +1,565 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.GitLabProjectsClient; +import com.azure.resourcemanager.security.fluent.models.GitLabProjectInner; +import com.azure.resourcemanager.security.models.GitLabProjectListResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in GitLabProjectsClient. */ +public final class GitLabProjectsClientImpl implements GitLabProjectsClient { + /** The proxy service used to perform REST calls. */ + private final GitLabProjectsService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of GitLabProjectsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GitLabProjectsClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy.create(GitLabProjectsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterGitLabProjects to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterGitLab") + public interface GitLabProjectsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitLabGroups/{groupFQName}/projects") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("groupFQName") String groupFQName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitLabGroups/{groupFQName}/projects/{projectName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("groupFQName") String groupFQName, + @PathParam("projectName") String projectName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of GitLab projects that are directly owned by given group and onboarded to the connector along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String securityConnectorName, String groupFQName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (groupFQName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + groupFQName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 GitLab projects that are directly owned by given group and onboarded to the connector along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String securityConnectorName, String groupFQName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (groupFQName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + groupFQName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of GitLab projects that are directly owned by given group and onboarded to the connector as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String securityConnectorName, String groupFQName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, securityConnectorName, groupFQName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 GitLab projects that are directly owned by given group and onboarded to the connector as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String securityConnectorName, String groupFQName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, securityConnectorName, groupFQName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of GitLab projects that are directly owned by given group and onboarded to the connector as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String securityConnectorName, String groupFQName) { + return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, groupFQName)); + } + + /** + * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 GitLab projects that are directly owned by given group and onboarded to the connector as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String securityConnectorName, String groupFQName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, groupFQName, context)); + } + + /** + * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @param projectName The project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitLab Project resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String securityConnectorName, String groupFQName, String projectName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (groupFQName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + groupFQName, + projectName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @param projectName The project name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitLab Project resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String securityConnectorName, + String groupFQName, + String projectName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (groupFQName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + groupFQName, + projectName, + apiVersion, + accept, + context); + } + + /** + * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @param projectName The project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitLab Project resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String securityConnectorName, String groupFQName, String projectName) { + return getWithResponseAsync(resourceGroupName, securityConnectorName, groupFQName, projectName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @param projectName The project name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitLab Project resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String securityConnectorName, + String groupFQName, + String projectName, + Context context) { + return getWithResponseAsync(resourceGroupName, securityConnectorName, groupFQName, projectName, context) + .block(); + } + + /** + * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @param projectName The project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitLab Project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GitLabProjectInner get( + String resourceGroupName, String securityConnectorName, String groupFQName, String projectName) { + return getWithResponse(resourceGroupName, securityConnectorName, groupFQName, projectName, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsImpl.java new file mode 100644 index 000000000000..3b7faba08da7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsImpl.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.GitLabProjectsClient; +import com.azure.resourcemanager.security.fluent.models.GitLabProjectInner; +import com.azure.resourcemanager.security.models.GitLabProject; +import com.azure.resourcemanager.security.models.GitLabProjects; + +public final class GitLabProjectsImpl implements GitLabProjects { + private static final ClientLogger LOGGER = new ClientLogger(GitLabProjectsImpl.class); + + private final GitLabProjectsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public GitLabProjectsImpl( + GitLabProjectsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String securityConnectorName, String groupFQName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, securityConnectorName, groupFQName); + return Utils.mapPage(inner, inner1 -> new GitLabProjectImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String securityConnectorName, String groupFQName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, securityConnectorName, groupFQName, context); + return Utils.mapPage(inner, inner1 -> new GitLabProjectImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, + String securityConnectorName, + String groupFQName, + String projectName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, securityConnectorName, groupFQName, projectName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GitLabProjectImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GitLabProject get( + String resourceGroupName, String securityConnectorName, String groupFQName, String projectName) { + GitLabProjectInner inner = + this.serviceClient().get(resourceGroupName, securityConnectorName, groupFQName, projectName); + if (inner != null) { + return new GitLabProjectImpl(inner, this.manager()); + } else { + return null; + } + } + + private GitLabProjectsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOffboardingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsClientImpl.java similarity index 53% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOffboardingsClientImpl.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsClientImpl.java index ca575de7d8a7..b15f9cc6d9cb 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOffboardingsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsClientImpl.java @@ -4,13 +4,13 @@ package com.azure.resourcemanager.security.implementation; -import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -21,71 +21,67 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.ApiCollectionOffboardingsClient; +import com.azure.resourcemanager.security.fluent.GitLabSubgroupsClient; +import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ApiCollectionOffboardingsClient. */ -public final class ApiCollectionOffboardingsClientImpl implements ApiCollectionOffboardingsClient { +/** An instance of this class provides access to all the operations defined in GitLabSubgroupsClient. */ +public final class GitLabSubgroupsClientImpl implements GitLabSubgroupsClient { /** The proxy service used to perform REST calls. */ - private final ApiCollectionOffboardingsService service; + private final GitLabSubgroupsService service; /** The service client containing this operation class. */ private final SecurityCenterImpl client; /** - * Initializes an instance of ApiCollectionOffboardingsClientImpl. + * Initializes an instance of GitLabSubgroupsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ApiCollectionOffboardingsClientImpl(SecurityCenterImpl client) { + GitLabSubgroupsClientImpl(SecurityCenterImpl client) { this.service = - RestProxy - .create( - ApiCollectionOffboardingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + RestProxy.create(GitLabSubgroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for SecurityCenterApiCollectionOffboardings to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for SecurityCenterGitLabSubgroups to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "SecurityCenterApiCol") - public interface ApiCollectionOffboardingsService { + @ServiceInterface(name = "SecurityCenterGitLab") + public interface GitLabSubgroupsService { @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiCollectionId}") - @ExpectedResponses({200, 204}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitLabGroups/{groupFQName}/listSubgroups") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( + Mono> list( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serviceName") String serviceName, - @PathParam("apiCollectionId") String apiCollectionId, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("groupFQName") String groupFQName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** - * Offboard an Azure API Management API from Defender for APIs - * - *

Offboard an Azure API Management API from Defender for APIs. The system will stop monitoring the operations - * within the Azure API Management API for intrusive behaviors. + * Gets nested subgroups of given GitLab Group which are onboarded to the connector. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return nested subgroups of given GitLab Group which are onboarded to the connector along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String serviceName, String apiCollectionId) { + private Mono> listWithResponseAsync( + String resourceGroupName, String securityConnectorName, String groupFQName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -102,25 +98,25 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - if (apiCollectionId == null) { + if (securityConnectorName == null) { return Mono - .error(new IllegalArgumentException("Parameter apiCollectionId is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + } + if (groupFQName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); } - final String apiVersion = "2022-11-20-preview"; + final String apiVersion = "2023-09-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .delete( + .list( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - serviceName, - apiCollectionId, + securityConnectorName, + groupFQName, apiVersion, accept, context)) @@ -128,24 +124,21 @@ private Mono> deleteWithResponseAsync( } /** - * Offboard an Azure API Management API from Defender for APIs - * - *

Offboard an Azure API Management API from Defender for APIs. The system will stop monitoring the operations - * within the Azure API Management API for intrusive behaviors. + * Gets nested subgroups of given GitLab Group which are onboarded to the connector. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return nested subgroups of given GitLab Group which are onboarded to the connector along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { + private Mono> listWithResponseAsync( + String resourceGroupName, String securityConnectorName, String groupFQName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -162,87 +155,79 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - if (apiCollectionId == null) { + if (securityConnectorName == null) { return Mono - .error(new IllegalArgumentException("Parameter apiCollectionId is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); } - final String apiVersion = "2022-11-20-preview"; + if (groupFQName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); + } + final String apiVersion = "2023-09-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .delete( + .list( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - serviceName, - apiCollectionId, + securityConnectorName, + groupFQName, apiVersion, accept, context); } /** - * Offboard an Azure API Management API from Defender for APIs - * - *

Offboard an Azure API Management API from Defender for APIs. The system will stop monitoring the operations - * within the Azure API Management API for intrusive behaviors. + * Gets nested subgroups of given GitLab Group which are onboarded to the connector. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return nested subgroups of given GitLab Group which are onboarded to the connector on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String serviceName, String apiCollectionId) { - return deleteWithResponseAsync(resourceGroupName, serviceName, apiCollectionId) - .flatMap(ignored -> Mono.empty()); + private Mono listAsync( + String resourceGroupName, String securityConnectorName, String groupFQName) { + return listWithResponseAsync(resourceGroupName, securityConnectorName, groupFQName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Offboard an Azure API Management API from Defender for APIs - * - *

Offboard an Azure API Management API from Defender for APIs. The system will stop monitoring the operations - * within the Azure API Management API for intrusive behaviors. + * Gets nested subgroups of given GitLab Group which are onboarded to the connector. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return nested subgroups of given GitLab Group which are onboarded to the connector along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { - return deleteWithResponseAsync(resourceGroupName, serviceName, apiCollectionId, context).block(); + public Response listWithResponse( + String resourceGroupName, String securityConnectorName, String groupFQName, Context context) { + return listWithResponseAsync(resourceGroupName, securityConnectorName, groupFQName, context).block(); } /** - * Offboard an Azure API Management API from Defender for APIs - * - *

Offboard an Azure API Management API from Defender for APIs. The system will stop monitoring the operations - * within the Azure API Management API for intrusive behaviors. + * Gets nested subgroups of given GitLab Group which are onboarded to the connector. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nested subgroups of given GitLab Group which are onboarded to the connector. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String serviceName, String apiCollectionId) { - deleteWithResponse(resourceGroupName, serviceName, apiCollectionId, Context.NONE); + public GitLabGroupListResponseInner list( + String resourceGroupName, String securityConnectorName, String groupFQName) { + return listWithResponse(resourceGroupName, securityConnectorName, groupFQName, Context.NONE).getValue(); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsImpl.java new file mode 100644 index 000000000000..65d066aa2945 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.GitLabSubgroupsClient; +import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; +import com.azure.resourcemanager.security.models.GitLabGroupListResponse; +import com.azure.resourcemanager.security.models.GitLabSubgroups; + +public final class GitLabSubgroupsImpl implements GitLabSubgroups { + private static final ClientLogger LOGGER = new ClientLogger(GitLabSubgroupsImpl.class); + + private final GitLabSubgroupsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public GitLabSubgroupsImpl( + GitLabSubgroupsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse( + String resourceGroupName, String securityConnectorName, String groupFQName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, securityConnectorName, groupFQName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GitLabGroupListResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GitLabGroupListResponse list(String resourceGroupName, String securityConnectorName, String groupFQName) { + GitLabGroupListResponseInner inner = + this.serviceClient().list(resourceGroupName, securityConnectorName, groupFQName); + if (inner != null) { + return new GitLabGroupListResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private GitLabSubgroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportImpl.java index e93fab68ae8e..f238c398a50c 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportImpl.java @@ -13,6 +13,7 @@ import com.azure.resourcemanager.security.models.StatusAutoGenerated; import java.util.Collections; import java.util.List; +import java.util.Map; public final class HealthReportImpl implements HealthReport { private HealthReportInner innerObject; @@ -61,6 +62,24 @@ public List affectedDefendersPlans() { } } + public List affectedDefendersSubPlans() { + List inner = this.innerModel().affectedDefendersSubPlans(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Map reportAdditionalData() { + Map inner = this.innerModel().reportAdditionalData(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public List issues() { List inner = this.innerModel().issues(); if (inner != null) { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsClientImpl.java deleted file mode 100644 index d2c16f0a8577..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsClientImpl.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.HealthReportOperationsClient; -import com.azure.resourcemanager.security.fluent.models.HealthReportInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in HealthReportOperationsClient. */ -public final class HealthReportOperationsClientImpl implements HealthReportOperationsClient { - /** The proxy service used to perform REST calls. */ - private final HealthReportOperationsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of HealthReportOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - HealthReportOperationsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create(HealthReportOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterHealthReportOperations to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterHealth") - public interface HealthReportOperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/{resourceId}/providers/Microsoft.Security/healthReports/{healthReportName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("healthReportName") String healthReportName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, String healthReportName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (healthReportName == null) { - return Mono - .error(new IllegalArgumentException("Parameter healthReportName is required and cannot be null.")); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.get(this.client.getEndpoint(), apiVersion, resourceId, healthReportName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceId, String healthReportName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (healthReportName == null) { - return Mono - .error(new IllegalArgumentException("Parameter healthReportName is required and cannot be null.")); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, resourceId, healthReportName, accept, context); - } - - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId, String healthReportName) { - return getWithResponseAsync(resourceId, healthReportName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceId, String healthReportName, Context context) { - return getWithResponseAsync(resourceId, healthReportName, context).block(); - } - - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HealthReportInner get(String resourceId, String healthReportName) { - return getWithResponse(resourceId, healthReportName, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsImpl.java deleted file mode 100644 index 6824b37162f9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.HealthReportOperationsClient; -import com.azure.resourcemanager.security.fluent.models.HealthReportInner; -import com.azure.resourcemanager.security.models.HealthReport; -import com.azure.resourcemanager.security.models.HealthReportOperations; - -public final class HealthReportOperationsImpl implements HealthReportOperations { - private static final ClientLogger LOGGER = new ClientLogger(HealthReportOperationsImpl.class); - - private final HealthReportOperationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public HealthReportOperationsImpl( - HealthReportOperationsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceId, String healthReportName, Context context) { - Response inner = this.serviceClient().getWithResponse(resourceId, healthReportName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new HealthReportImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public HealthReport get(String resourceId, String healthReportName) { - HealthReportInner inner = this.serviceClient().get(resourceId, healthReportName); - if (inner != null) { - return new HealthReportImpl(inner, this.manager()); - } else { - return null; - } - } - - private HealthReportOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsClientImpl.java index 06047bcaac58..729e04fc57e3 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsClientImpl.java @@ -67,6 +67,18 @@ Mono> list( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Get("/{resourceId}/providers/Microsoft.Security/healthReports/{healthReportName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceId", encoded = true) String resourceId, + @PathParam("healthReportName") String healthReportName, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -101,7 +113,7 @@ private Mono> listSinglePageAsync(String scope) if (scope == null) { return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } - final String apiVersion = "2023-02-01-preview"; + final String apiVersion = "2023-05-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, accept, context)) @@ -141,7 +153,7 @@ private Mono> listSinglePageAsync(String scope, if (scope == null) { return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } - final String apiVersion = "2023-02-01-preview"; + final String apiVersion = "2023-05-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -224,6 +236,119 @@ public PagedIterable list(String scope, Context context) { return new PagedIterable<>(listAsync(scope, context)); } + /** + * Get health report of resource. + * + * @param resourceId The identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health report of resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceId, String healthReportName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + if (healthReportName == null) { + return Mono + .error(new IllegalArgumentException("Parameter healthReportName is required and cannot be null.")); + } + final String apiVersion = "2023-05-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.get(this.client.getEndpoint(), apiVersion, resourceId, healthReportName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get health report of resource. + * + * @param resourceId The identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health report of resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceId, String healthReportName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + if (healthReportName == null) { + return Mono + .error(new IllegalArgumentException("Parameter healthReportName is required and cannot be null.")); + } + final String apiVersion = "2023-05-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), apiVersion, resourceId, healthReportName, accept, context); + } + + /** + * Get health report of resource. + * + * @param resourceId The identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health report of resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceId, String healthReportName) { + return getWithResponseAsync(resourceId, healthReportName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get health report of resource. + * + * @param resourceId The identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health report of resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceId, String healthReportName, Context context) { + return getWithResponseAsync(resourceId, healthReportName, context).block(); + } + + /** + * Get health report of resource. + * + * @param resourceId The identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health report of resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HealthReportInner get(String resourceId, String healthReportName) { + return getWithResponse(resourceId, healthReportName, Context.NONE).getValue(); + } + /** * Get the next page of items. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsImpl.java index cf87726c0272..25b8654b5480 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsImpl.java @@ -5,6 +5,8 @@ package com.azure.resourcemanager.security.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.security.fluent.HealthReportsClient; @@ -35,6 +37,28 @@ public PagedIterable list(String scope, Context context) { return Utils.mapPage(inner, inner1 -> new HealthReportImpl(inner1, this.manager())); } + public Response getWithResponse(String resourceId, String healthReportName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceId, healthReportName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new HealthReportImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public HealthReport get(String resourceId, String healthReportName) { + HealthReportInner inner = this.serviceClient().get(resourceId, healthReportName); + if (inner != null) { + return new HealthReportImpl(inner, this.manager()); + } else { + return null; + } + } + private HealthReportsClient serviceClient() { return this.innerClient; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingImpl.java deleted file mode 100644 index 0100de28a14d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingImpl.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingInner; -import com.azure.resourcemanager.security.models.ConnectionStrings; -import com.azure.resourcemanager.security.models.IngestionSetting; -import com.azure.resourcemanager.security.models.IngestionSettingToken; - -public final class IngestionSettingImpl implements IngestionSetting, IngestionSetting.Definition { - private IngestionSettingInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IngestionSettingImpl( - IngestionSettingInner innerObject, com.azure.resourcemanager.security.SecurityManager 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 Object properties() { - return this.innerModel().properties(); - } - - public IngestionSettingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String ingestionSettingName; - - public IngestionSetting create() { - this.innerObject = - serviceManager - .serviceClient() - .getIngestionSettings() - .createWithResponse(ingestionSettingName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public IngestionSetting create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getIngestionSettings() - .createWithResponse(ingestionSettingName, this.innerModel(), context) - .getValue(); - return this; - } - - IngestionSettingImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new IngestionSettingInner(); - this.serviceManager = serviceManager; - this.ingestionSettingName = name; - } - - public IngestionSetting refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getIngestionSettings() - .getWithResponse(ingestionSettingName, Context.NONE) - .getValue(); - return this; - } - - public IngestionSetting refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getIngestionSettings() - .getWithResponse(ingestionSettingName, context) - .getValue(); - return this; - } - - public Response listTokensWithResponse(Context context) { - return serviceManager.ingestionSettings().listTokensWithResponse(ingestionSettingName, context); - } - - public IngestionSettingToken listTokens() { - return serviceManager.ingestionSettings().listTokens(ingestionSettingName); - } - - public Response listConnectionStringsWithResponse(Context context) { - return serviceManager.ingestionSettings().listConnectionStringsWithResponse(ingestionSettingName, context); - } - - public ConnectionStrings listConnectionStrings() { - return serviceManager.ingestionSettings().listConnectionStrings(ingestionSettingName); - } - - public IngestionSettingImpl withProperties(Object properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingTokenImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingTokenImpl.java deleted file mode 100644 index 260f3548df8f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingTokenImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.IngestionSettingTokenInner; -import com.azure.resourcemanager.security.models.IngestionSettingToken; - -public final class IngestionSettingTokenImpl implements IngestionSettingToken { - private IngestionSettingTokenInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IngestionSettingTokenImpl( - IngestionSettingTokenInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String token() { - return this.innerModel().token(); - } - - public IngestionSettingTokenInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingsClientImpl.java deleted file mode 100644 index 0ded97111c93..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingsClientImpl.java +++ /dev/null @@ -1,1030 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.IngestionSettingsClient; -import com.azure.resourcemanager.security.fluent.models.ConnectionStringsInner; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingInner; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingTokenInner; -import com.azure.resourcemanager.security.models.IngestionSettingList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in IngestionSettingsClient. */ -public final class IngestionSettingsClientImpl implements IngestionSettingsClient { - /** The proxy service used to perform REST calls. */ - private final IngestionSettingsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IngestionSettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IngestionSettingsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(IngestionSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIngestionSettings to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIngest") - public interface IngestionSettingsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ingestionSettingName") String ingestionSettingName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ingestionSettingName") String ingestionSettingName, - @BodyParam("application/json") IngestionSettingInner ingestionSetting, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ingestionSettingName") String ingestionSettingName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listTokens") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listTokens( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ingestionSettingName") String ingestionSettingName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listConnectionStrings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listConnectionStrings( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ingestionSettingName") String ingestionSettingName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String ingestionSettingName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String ingestionSettingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String ingestionSettingName) { - return getWithResponseAsync(ingestionSettingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String ingestionSettingName, Context context) { - return getWithResponseAsync(ingestionSettingName, context).block(); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IngestionSettingInner get(String ingestionSettingName) { - return getWithResponse(ingestionSettingName, Context.NONE).getValue(); - } - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String ingestionSettingName, IngestionSettingInner ingestionSetting) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - if (ingestionSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSetting is required and cannot be null.")); - } else { - ingestionSetting.validate(); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - ingestionSetting, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String ingestionSettingName, IngestionSettingInner ingestionSetting, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - if (ingestionSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSetting is required and cannot be null.")); - } else { - ingestionSetting.validate(); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - ingestionSetting, - accept, - context); - } - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String ingestionSettingName, IngestionSettingInner ingestionSetting) { - return createWithResponseAsync(ingestionSettingName, ingestionSetting) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String ingestionSettingName, IngestionSettingInner ingestionSetting, Context context) { - return createWithResponseAsync(ingestionSettingName, ingestionSetting, context).block(); - } - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IngestionSettingInner create(String ingestionSettingName, IngestionSettingInner ingestionSetting) { - return createWithResponse(ingestionSettingName, ingestionSetting, Context.NONE).getValue(); - } - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 ingestionSettingName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 ingestionSettingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context); - } - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 ingestionSettingName) { - return deleteWithResponseAsync(ingestionSettingName).flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String ingestionSettingName, Context context) { - return deleteWithResponseAsync(ingestionSettingName, context).block(); - } - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 ingestionSettingName) { - deleteWithResponse(ingestionSettingName, Context.NONE); - } - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTokensWithResponseAsync(String ingestionSettingName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listTokens( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTokensWithResponseAsync( - String ingestionSettingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listTokens( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context); - } - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listTokensAsync(String ingestionSettingName) { - return listTokensWithResponseAsync(ingestionSettingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listTokensWithResponse(String ingestionSettingName, Context context) { - return listTokensWithResponseAsync(ingestionSettingName, context).block(); - } - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IngestionSettingTokenInner listTokens(String ingestionSettingName) { - return listTokensWithResponse(ingestionSettingName, Context.NONE).getValue(); - } - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConnectionStringsWithResponseAsync(String ingestionSettingName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listConnectionStrings( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConnectionStringsWithResponseAsync( - String ingestionSettingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listConnectionStrings( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context); - } - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listConnectionStringsAsync(String ingestionSettingName) { - return listConnectionStringsWithResponseAsync(ingestionSettingName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listConnectionStringsWithResponse( - String ingestionSettingName, Context context) { - return listConnectionStringsWithResponseAsync(ingestionSettingName, context).block(); - } - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionStringsInner listConnectionStrings(String ingestionSettingName) { - return listConnectionStringsWithResponse(ingestionSettingName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingsImpl.java deleted file mode 100644 index da9c5111770e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingsImpl.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.IngestionSettingsClient; -import com.azure.resourcemanager.security.fluent.models.ConnectionStringsInner; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingInner; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingTokenInner; -import com.azure.resourcemanager.security.models.ConnectionStrings; -import com.azure.resourcemanager.security.models.IngestionSetting; -import com.azure.resourcemanager.security.models.IngestionSettingToken; -import com.azure.resourcemanager.security.models.IngestionSettings; - -public final class IngestionSettingsImpl implements IngestionSettings { - private static final ClientLogger LOGGER = new ClientLogger(IngestionSettingsImpl.class); - - private final IngestionSettingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IngestionSettingsImpl( - IngestionSettingsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new IngestionSettingImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new IngestionSettingImpl(inner1, this.manager())); - } - - public Response getWithResponse(String ingestionSettingName, Context context) { - Response inner = this.serviceClient().getWithResponse(ingestionSettingName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IngestionSettingImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IngestionSetting get(String ingestionSettingName) { - IngestionSettingInner inner = this.serviceClient().get(ingestionSettingName); - if (inner != null) { - return new IngestionSettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String ingestionSettingName, Context context) { - return this.serviceClient().deleteWithResponse(ingestionSettingName, context); - } - - public void delete(String ingestionSettingName) { - this.serviceClient().delete(ingestionSettingName); - } - - public Response listTokensWithResponse(String ingestionSettingName, Context context) { - Response inner = - this.serviceClient().listTokensWithResponse(ingestionSettingName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IngestionSettingTokenImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IngestionSettingToken listTokens(String ingestionSettingName) { - IngestionSettingTokenInner inner = this.serviceClient().listTokens(ingestionSettingName); - if (inner != null) { - return new IngestionSettingTokenImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listConnectionStringsWithResponse(String ingestionSettingName, Context context) { - Response inner = - this.serviceClient().listConnectionStringsWithResponse(ingestionSettingName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ConnectionStringsImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ConnectionStrings listConnectionStrings(String ingestionSettingName) { - ConnectionStringsInner inner = this.serviceClient().listConnectionStrings(ingestionSettingName); - if (inner != null) { - return new ConnectionStringsImpl(inner, this.manager()); - } else { - return null; - } - } - - public IngestionSetting getById(String id) { - String ingestionSettingName = Utils.getValueFromIdByName(id, "ingestionSettings"); - if (ingestionSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'ingestionSettings'.", id))); - } - return this.getWithResponse(ingestionSettingName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String ingestionSettingName = Utils.getValueFromIdByName(id, "ingestionSettings"); - if (ingestionSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'ingestionSettings'.", id))); - } - return this.getWithResponse(ingestionSettingName, context); - } - - public void deleteById(String id) { - String ingestionSettingName = Utils.getValueFromIdByName(id, "ingestionSettings"); - if (ingestionSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'ingestionSettings'.", id))); - } - this.deleteWithResponse(ingestionSettingName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String ingestionSettingName = Utils.getValueFromIdByName(id, "ingestionSettings"); - if (ingestionSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'ingestionSettings'.", id))); - } - return this.deleteWithResponse(ingestionSettingName, context); - } - - private IngestionSettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public IngestionSettingImpl define(String name) { - return new IngestionSettingImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationStatusResultImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationStatusResultImpl.java new file mode 100644 index 000000000000..bc3ea415fbc8 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationStatusResultImpl.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.security.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.security.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.security.SecurityManager serviceManager; + + OperationStatusResultImpl( + OperationStatusResultInner innerObject, com.azure.resourcemanager.security.SecurityManager 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 Float 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 OperationStatusResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersClientImpl.java new file mode 100644 index 000000000000..9b600fe64146 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.security.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; +import com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { + /** The proxy service used to perform REST calls. */ + private final ResourceProvidersService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterResourceProviders to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterResour") + public interface ResourceProvidersService { + @Headers({"Content-Type: application/json"}) + @Put("/providers/Microsoft.Security/sensitivitySettings/current") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateSensitivitySettings( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateSensitivitySettingsRequest sensitivitySettings, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Security/sensitivitySettings/current") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getSensitivitySettings( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Updates data sensitivity settings for sensitive data discovery. + * + * @param sensitivitySettings The data sensitivity settings to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateSensitivitySettingsWithResponseAsync( + UpdateSensitivitySettingsRequest sensitivitySettings) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (sensitivitySettings == null) { + return Mono + .error(new IllegalArgumentException("Parameter sensitivitySettings is required and cannot be null.")); + } else { + sensitivitySettings.validate(); + } + final String apiVersion = "2023-02-15-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateSensitivitySettings( + this.client.getEndpoint(), apiVersion, sensitivitySettings, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates data sensitivity settings for sensitive data discovery. + * + * @param sensitivitySettings The data sensitivity settings to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateSensitivitySettingsWithResponseAsync( + UpdateSensitivitySettingsRequest sensitivitySettings, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (sensitivitySettings == null) { + return Mono + .error(new IllegalArgumentException("Parameter sensitivitySettings is required and cannot be null.")); + } else { + sensitivitySettings.validate(); + } + final String apiVersion = "2023-02-15-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateSensitivitySettings(this.client.getEndpoint(), apiVersion, sensitivitySettings, accept, context); + } + + /** + * Updates data sensitivity settings for sensitive data discovery. + * + * @param sensitivitySettings The data sensitivity settings to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateSensitivitySettingsAsync( + UpdateSensitivitySettingsRequest sensitivitySettings) { + return updateSensitivitySettingsWithResponseAsync(sensitivitySettings) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates data sensitivity settings for sensitive data discovery. + * + * @param sensitivitySettings The data sensitivity settings to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateSensitivitySettingsWithResponse( + UpdateSensitivitySettingsRequest sensitivitySettings, Context context) { + return updateSensitivitySettingsWithResponseAsync(sensitivitySettings, context).block(); + } + + /** + * Updates data sensitivity settings for sensitive data discovery. + * + * @param sensitivitySettings The data sensitivity settings to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GetSensitivitySettingsResponseInner updateSensitivitySettings( + UpdateSensitivitySettingsRequest sensitivitySettings) { + return updateSensitivitySettingsWithResponse(sensitivitySettings, Context.NONE).getValue(); + } + + /** + * Gets data sensitivity settings for sensitive data discovery. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSensitivitySettingsWithResponseAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2023-02-15-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getSensitivitySettings(this.client.getEndpoint(), apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets data sensitivity settings for sensitive data discovery. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSensitivitySettingsWithResponseAsync( + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2023-02-15-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getSensitivitySettings(this.client.getEndpoint(), apiVersion, accept, context); + } + + /** + * Gets data sensitivity settings for sensitive data discovery. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getSensitivitySettingsAsync() { + return getSensitivitySettingsWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets data sensitivity settings for sensitive data discovery. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSensitivitySettingsWithResponse(Context context) { + return getSensitivitySettingsWithResponseAsync(context).block(); + } + + /** + * Gets data sensitivity settings for sensitive data discovery. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GetSensitivitySettingsResponseInner getSensitivitySettings() { + return getSensitivitySettingsWithResponse(Context.NONE).getValue(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersImpl.java new file mode 100644 index 000000000000..ea74d0b57fd0 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersImpl.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; +import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponse; +import com.azure.resourcemanager.security.models.ResourceProviders; +import com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest; + +public final class ResourceProvidersImpl implements ResourceProviders { + private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public ResourceProvidersImpl( + ResourceProvidersClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response updateSensitivitySettingsWithResponse( + UpdateSensitivitySettingsRequest sensitivitySettings, Context context) { + Response inner = + this.serviceClient().updateSensitivitySettingsWithResponse(sensitivitySettings, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GetSensitivitySettingsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GetSensitivitySettingsResponse updateSensitivitySettings( + UpdateSensitivitySettingsRequest sensitivitySettings) { + GetSensitivitySettingsResponseInner inner = this.serviceClient().updateSensitivitySettings(sensitivitySettings); + if (inner != null) { + return new GetSensitivitySettingsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getSensitivitySettingsWithResponse(Context context) { + Response inner = + this.serviceClient().getSensitivitySettingsWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GetSensitivitySettingsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GetSensitivitySettingsResponse getSensitivitySettings() { + GetSensitivitySettingsResponseInner inner = this.serviceClient().getSensitivitySettings(); + if (inner != null) { + return new GetSensitivitySettingsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private ResourceProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterBuilder.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterBuilder.java index ff42af6d88d6..f732dfe83a45 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterBuilder.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterBuilder.java @@ -137,7 +137,7 @@ public SecurityCenterImpl buildClient() { localSerializerAdapter, localDefaultPollInterval, localEnvironment, - subscriptionId, + this.subscriptionId, localEndpoint); return client; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java index 2f43f2f9a553..f6e75e135c12 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java @@ -28,8 +28,6 @@ import com.azure.resourcemanager.security.fluent.AlertsClient; import com.azure.resourcemanager.security.fluent.AlertsSuppressionRulesClient; import com.azure.resourcemanager.security.fluent.AllowedConnectionsClient; -import com.azure.resourcemanager.security.fluent.ApiCollectionOffboardingsClient; -import com.azure.resourcemanager.security.fluent.ApiCollectionOnboardingsClient; import com.azure.resourcemanager.security.fluent.ApiCollectionsClient; import com.azure.resourcemanager.security.fluent.ApplicationOperationsClient; import com.azure.resourcemanager.security.fluent.ApplicationsClient; @@ -37,20 +35,29 @@ import com.azure.resourcemanager.security.fluent.AssessmentsMetadatasClient; import com.azure.resourcemanager.security.fluent.AutoProvisioningSettingsClient; import com.azure.resourcemanager.security.fluent.AutomationsClient; +import com.azure.resourcemanager.security.fluent.AzureDevOpsOrgsClient; +import com.azure.resourcemanager.security.fluent.AzureDevOpsProjectsClient; +import com.azure.resourcemanager.security.fluent.AzureDevOpsReposClient; import com.azure.resourcemanager.security.fluent.ComplianceResultsClient; import com.azure.resourcemanager.security.fluent.CompliancesClient; import com.azure.resourcemanager.security.fluent.ConnectorsClient; import com.azure.resourcemanager.security.fluent.CustomAssessmentAutomationsClient; import com.azure.resourcemanager.security.fluent.CustomEntityStoreAssignmentsClient; +import com.azure.resourcemanager.security.fluent.DefenderForStoragesClient; +import com.azure.resourcemanager.security.fluent.DevOpsConfigurationsClient; +import com.azure.resourcemanager.security.fluent.DevOpsOperationResultsClient; import com.azure.resourcemanager.security.fluent.DeviceSecurityGroupsClient; import com.azure.resourcemanager.security.fluent.DiscoveredSecuritySolutionsClient; import com.azure.resourcemanager.security.fluent.ExternalSecuritySolutionsClient; +import com.azure.resourcemanager.security.fluent.GitHubOwnersClient; +import com.azure.resourcemanager.security.fluent.GitHubReposClient; +import com.azure.resourcemanager.security.fluent.GitLabGroupsClient; +import com.azure.resourcemanager.security.fluent.GitLabProjectsClient; +import com.azure.resourcemanager.security.fluent.GitLabSubgroupsClient; import com.azure.resourcemanager.security.fluent.GovernanceAssignmentsClient; import com.azure.resourcemanager.security.fluent.GovernanceRulesClient; -import com.azure.resourcemanager.security.fluent.HealthReportOperationsClient; import com.azure.resourcemanager.security.fluent.HealthReportsClient; import com.azure.resourcemanager.security.fluent.InformationProtectionPoliciesClient; -import com.azure.resourcemanager.security.fluent.IngestionSettingsClient; import com.azure.resourcemanager.security.fluent.IotSecuritySolutionAnalyticsClient; import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsAnalyticsAggregatedAlertsClient; import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsAnalyticsRecommendationsClient; @@ -63,6 +70,7 @@ import com.azure.resourcemanager.security.fluent.RegulatoryComplianceAssessmentsClient; import com.azure.resourcemanager.security.fluent.RegulatoryComplianceControlsClient; import com.azure.resourcemanager.security.fluent.RegulatoryComplianceStandardsClient; +import com.azure.resourcemanager.security.fluent.ResourceProvidersClient; import com.azure.resourcemanager.security.fluent.SecureScoreControlDefinitionsClient; import com.azure.resourcemanager.security.fluent.SecureScoreControlsClient; import com.azure.resourcemanager.security.fluent.SecureScoresClient; @@ -74,7 +82,9 @@ import com.azure.resourcemanager.security.fluent.SecurityOperatorsClient; import com.azure.resourcemanager.security.fluent.SecuritySolutionsClient; import com.azure.resourcemanager.security.fluent.SecuritySolutionsReferenceDatasClient; +import com.azure.resourcemanager.security.fluent.SensitivitySettingsClient; import com.azure.resourcemanager.security.fluent.ServerVulnerabilityAssessmentsClient; +import com.azure.resourcemanager.security.fluent.ServerVulnerabilityAssessmentsSettingsClient; import com.azure.resourcemanager.security.fluent.SettingsClient; import com.azure.resourcemanager.security.fluent.SoftwareInventoriesClient; import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentBaselineRulesClient; @@ -648,6 +658,30 @@ public ConnectorsClient getConnectors() { return this.connectors; } + /** The ResourceProvidersClient object to access its operations. */ + private final ResourceProvidersClient resourceProviders; + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; + } + + /** The SensitivitySettingsClient object to access its operations. */ + private final SensitivitySettingsClient sensitivitySettings; + + /** + * Gets the SensitivitySettingsClient object to access its operations. + * + * @return the SensitivitySettingsClient object. + */ + public SensitivitySettingsClient getSensitivitySettings() { + return this.sensitivitySettings; + } + /** The AlertsClient object to access its operations. */ private final AlertsClient alerts; @@ -672,18 +706,6 @@ public SettingsClient getSettings() { return this.settings; } - /** The IngestionSettingsClient object to access its operations. */ - private final IngestionSettingsClient ingestionSettings; - - /** - * Gets the IngestionSettingsClient object to access its operations. - * - * @return the IngestionSettingsClient object. - */ - public IngestionSettingsClient getIngestionSettings() { - return this.ingestionSettings; - } - /** The SoftwareInventoriesClient object to access its operations. */ private final SoftwareInventoriesClient softwareInventories; @@ -780,28 +802,64 @@ public ApiCollectionsClient getApiCollections() { return this.apiCollections; } - /** The ApiCollectionOnboardingsClient object to access its operations. */ - private final ApiCollectionOnboardingsClient apiCollectionOnboardings; + /** The SqlVulnerabilityAssessmentScansClient object to access its operations. */ + private final SqlVulnerabilityAssessmentScansClient sqlVulnerabilityAssessmentScans; + + /** + * Gets the SqlVulnerabilityAssessmentScansClient object to access its operations. + * + * @return the SqlVulnerabilityAssessmentScansClient object. + */ + public SqlVulnerabilityAssessmentScansClient getSqlVulnerabilityAssessmentScans() { + return this.sqlVulnerabilityAssessmentScans; + } + + /** The SqlVulnerabilityAssessmentScanResultsClient object to access its operations. */ + private final SqlVulnerabilityAssessmentScanResultsClient sqlVulnerabilityAssessmentScanResults; + + /** + * Gets the SqlVulnerabilityAssessmentScanResultsClient object to access its operations. + * + * @return the SqlVulnerabilityAssessmentScanResultsClient object. + */ + public SqlVulnerabilityAssessmentScanResultsClient getSqlVulnerabilityAssessmentScanResults() { + return this.sqlVulnerabilityAssessmentScanResults; + } + + /** The SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. */ + private final SqlVulnerabilityAssessmentBaselineRulesClient sqlVulnerabilityAssessmentBaselineRules; + + /** + * Gets the SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. + * + * @return the SqlVulnerabilityAssessmentBaselineRulesClient object. + */ + public SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessmentBaselineRules() { + return this.sqlVulnerabilityAssessmentBaselineRules; + } + + /** The SecurityOperatorsClient object to access its operations. */ + private final SecurityOperatorsClient securityOperators; /** - * Gets the ApiCollectionOnboardingsClient object to access its operations. + * Gets the SecurityOperatorsClient object to access its operations. * - * @return the ApiCollectionOnboardingsClient object. + * @return the SecurityOperatorsClient object. */ - public ApiCollectionOnboardingsClient getApiCollectionOnboardings() { - return this.apiCollectionOnboardings; + public SecurityOperatorsClient getSecurityOperators() { + return this.securityOperators; } - /** The ApiCollectionOffboardingsClient object to access its operations. */ - private final ApiCollectionOffboardingsClient apiCollectionOffboardings; + /** The ServerVulnerabilityAssessmentsSettingsClient object to access its operations. */ + private final ServerVulnerabilityAssessmentsSettingsClient serverVulnerabilityAssessmentsSettings; /** - * Gets the ApiCollectionOffboardingsClient object to access its operations. + * Gets the ServerVulnerabilityAssessmentsSettingsClient object to access its operations. * - * @return the ApiCollectionOffboardingsClient object. + * @return the ServerVulnerabilityAssessmentsSettingsClient object. */ - public ApiCollectionOffboardingsClient getApiCollectionOffboardings() { - return this.apiCollectionOffboardings; + public ServerVulnerabilityAssessmentsSettingsClient getServerVulnerabilityAssessmentsSettings() { + return this.serverVulnerabilityAssessmentsSettings; } /** The HealthReportsClient object to access its operations. */ @@ -816,76 +874,148 @@ public HealthReportsClient getHealthReports() { return this.healthReports; } - /** The HealthReportOperationsClient object to access its operations. */ - private final HealthReportOperationsClient healthReportOperations; + /** The DefenderForStoragesClient object to access its operations. */ + private final DefenderForStoragesClient defenderForStorages; /** - * Gets the HealthReportOperationsClient object to access its operations. + * Gets the DefenderForStoragesClient object to access its operations. * - * @return the HealthReportOperationsClient object. + * @return the DefenderForStoragesClient object. */ - public HealthReportOperationsClient getHealthReportOperations() { - return this.healthReportOperations; + public DefenderForStoragesClient getDefenderForStorages() { + return this.defenderForStorages; } - /** The SqlVulnerabilityAssessmentScansClient object to access its operations. */ - private final SqlVulnerabilityAssessmentScansClient sqlVulnerabilityAssessmentScans; + /** The AzureDevOpsOrgsClient object to access its operations. */ + private final AzureDevOpsOrgsClient azureDevOpsOrgs; /** - * Gets the SqlVulnerabilityAssessmentScansClient object to access its operations. + * Gets the AzureDevOpsOrgsClient object to access its operations. * - * @return the SqlVulnerabilityAssessmentScansClient object. + * @return the AzureDevOpsOrgsClient object. */ - public SqlVulnerabilityAssessmentScansClient getSqlVulnerabilityAssessmentScans() { - return this.sqlVulnerabilityAssessmentScans; + public AzureDevOpsOrgsClient getAzureDevOpsOrgs() { + return this.azureDevOpsOrgs; } - /** The SqlVulnerabilityAssessmentScanResultsClient object to access its operations. */ - private final SqlVulnerabilityAssessmentScanResultsClient sqlVulnerabilityAssessmentScanResults; + /** The AzureDevOpsProjectsClient object to access its operations. */ + private final AzureDevOpsProjectsClient azureDevOpsProjects; /** - * Gets the SqlVulnerabilityAssessmentScanResultsClient object to access its operations. + * Gets the AzureDevOpsProjectsClient object to access its operations. * - * @return the SqlVulnerabilityAssessmentScanResultsClient object. + * @return the AzureDevOpsProjectsClient object. */ - public SqlVulnerabilityAssessmentScanResultsClient getSqlVulnerabilityAssessmentScanResults() { - return this.sqlVulnerabilityAssessmentScanResults; + public AzureDevOpsProjectsClient getAzureDevOpsProjects() { + return this.azureDevOpsProjects; } - /** The SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. */ - private final SqlVulnerabilityAssessmentBaselineRulesClient sqlVulnerabilityAssessmentBaselineRules; + /** The AzureDevOpsReposClient object to access its operations. */ + private final AzureDevOpsReposClient azureDevOpsRepos; /** - * Gets the SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. + * Gets the AzureDevOpsReposClient object to access its operations. * - * @return the SqlVulnerabilityAssessmentBaselineRulesClient object. + * @return the AzureDevOpsReposClient object. */ - public SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessmentBaselineRules() { - return this.sqlVulnerabilityAssessmentBaselineRules; + public AzureDevOpsReposClient getAzureDevOpsRepos() { + return this.azureDevOpsRepos; } - /** The SecurityConnectorsClient object to access its operations. */ - private final SecurityConnectorsClient securityConnectors; + /** The DevOpsConfigurationsClient object to access its operations. */ + private final DevOpsConfigurationsClient devOpsConfigurations; /** - * Gets the SecurityConnectorsClient object to access its operations. + * Gets the DevOpsConfigurationsClient object to access its operations. * - * @return the SecurityConnectorsClient object. + * @return the DevOpsConfigurationsClient object. */ - public SecurityConnectorsClient getSecurityConnectors() { - return this.securityConnectors; + public DevOpsConfigurationsClient getDevOpsConfigurations() { + return this.devOpsConfigurations; } - /** The SecurityOperatorsClient object to access its operations. */ - private final SecurityOperatorsClient securityOperators; + /** The GitHubOwnersClient object to access its operations. */ + private final GitHubOwnersClient gitHubOwners; /** - * Gets the SecurityOperatorsClient object to access its operations. + * Gets the GitHubOwnersClient object to access its operations. * - * @return the SecurityOperatorsClient object. + * @return the GitHubOwnersClient object. */ - public SecurityOperatorsClient getSecurityOperators() { - return this.securityOperators; + public GitHubOwnersClient getGitHubOwners() { + return this.gitHubOwners; + } + + /** The GitHubReposClient object to access its operations. */ + private final GitHubReposClient gitHubRepos; + + /** + * Gets the GitHubReposClient object to access its operations. + * + * @return the GitHubReposClient object. + */ + public GitHubReposClient getGitHubRepos() { + return this.gitHubRepos; + } + + /** The GitLabGroupsClient object to access its operations. */ + private final GitLabGroupsClient gitLabGroups; + + /** + * Gets the GitLabGroupsClient object to access its operations. + * + * @return the GitLabGroupsClient object. + */ + public GitLabGroupsClient getGitLabGroups() { + return this.gitLabGroups; + } + + /** The GitLabSubgroupsClient object to access its operations. */ + private final GitLabSubgroupsClient gitLabSubgroups; + + /** + * Gets the GitLabSubgroupsClient object to access its operations. + * + * @return the GitLabSubgroupsClient object. + */ + public GitLabSubgroupsClient getGitLabSubgroups() { + return this.gitLabSubgroups; + } + + /** The GitLabProjectsClient object to access its operations. */ + private final GitLabProjectsClient gitLabProjects; + + /** + * Gets the GitLabProjectsClient object to access its operations. + * + * @return the GitLabProjectsClient object. + */ + public GitLabProjectsClient getGitLabProjects() { + return this.gitLabProjects; + } + + /** The DevOpsOperationResultsClient object to access its operations. */ + private final DevOpsOperationResultsClient devOpsOperationResults; + + /** + * Gets the DevOpsOperationResultsClient object to access its operations. + * + * @return the DevOpsOperationResultsClient object. + */ + public DevOpsOperationResultsClient getDevOpsOperationResults() { + return this.devOpsOperationResults; + } + + /** The SecurityConnectorsClient object to access its operations. */ + private final SecurityConnectorsClient securityConnectors; + + /** + * Gets the SecurityConnectorsClient object to access its operations. + * + * @return the SecurityConnectorsClient object. + */ + public SecurityConnectorsClient getSecurityConnectors() { + return this.securityConnectors; } /** @@ -953,9 +1083,10 @@ public SecurityOperatorsClient getSecurityOperators() { this.secureScoreControlDefinitions = new SecureScoreControlDefinitionsClientImpl(this); this.securitySolutions = new SecuritySolutionsClientImpl(this); this.connectors = new ConnectorsClientImpl(this); + this.resourceProviders = new ResourceProvidersClientImpl(this); + this.sensitivitySettings = new SensitivitySettingsClientImpl(this); this.alerts = new AlertsClientImpl(this); this.settings = new SettingsClientImpl(this); - this.ingestionSettings = new IngestionSettingsClientImpl(this); this.softwareInventories = new SoftwareInventoriesClientImpl(this); this.governanceRules = new GovernanceRulesClientImpl(this); this.governanceAssignments = new GovernanceAssignmentsClientImpl(this); @@ -964,15 +1095,24 @@ public SecurityOperatorsClient getSecurityOperators() { this.securityConnectorApplications = new SecurityConnectorApplicationsClientImpl(this); this.securityConnectorApplicationOperations = new SecurityConnectorApplicationOperationsClientImpl(this); this.apiCollections = new ApiCollectionsClientImpl(this); - this.apiCollectionOnboardings = new ApiCollectionOnboardingsClientImpl(this); - this.apiCollectionOffboardings = new ApiCollectionOffboardingsClientImpl(this); - this.healthReports = new HealthReportsClientImpl(this); - this.healthReportOperations = new HealthReportOperationsClientImpl(this); this.sqlVulnerabilityAssessmentScans = new SqlVulnerabilityAssessmentScansClientImpl(this); this.sqlVulnerabilityAssessmentScanResults = new SqlVulnerabilityAssessmentScanResultsClientImpl(this); this.sqlVulnerabilityAssessmentBaselineRules = new SqlVulnerabilityAssessmentBaselineRulesClientImpl(this); - this.securityConnectors = new SecurityConnectorsClientImpl(this); this.securityOperators = new SecurityOperatorsClientImpl(this); + this.serverVulnerabilityAssessmentsSettings = new ServerVulnerabilityAssessmentsSettingsClientImpl(this); + this.healthReports = new HealthReportsClientImpl(this); + this.defenderForStorages = new DefenderForStoragesClientImpl(this); + this.azureDevOpsOrgs = new AzureDevOpsOrgsClientImpl(this); + this.azureDevOpsProjects = new AzureDevOpsProjectsClientImpl(this); + this.azureDevOpsRepos = new AzureDevOpsReposClientImpl(this); + this.devOpsConfigurations = new DevOpsConfigurationsClientImpl(this); + this.gitHubOwners = new GitHubOwnersClientImpl(this); + this.gitHubRepos = new GitHubReposClientImpl(this); + this.gitLabGroups = new GitLabGroupsClientImpl(this); + this.gitLabSubgroups = new GitLabSubgroupsClientImpl(this); + this.gitLabProjects = new GitLabProjectsClientImpl(this); + this.devOpsOperationResults = new DevOpsOperationResultsClientImpl(this); + this.securityConnectors = new SecurityConnectorsClientImpl(this); } /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsClientImpl.java index 2092e42d6eb4..84bd9caf4846 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsClientImpl.java @@ -186,7 +186,7 @@ private Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -230,7 +230,7 @@ private Mono> listSinglePageAsync(Context new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -333,7 +333,7 @@ private Mono> listByResourceGroupSinglePag return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -390,7 +390,7 @@ private Mono> listByResourceGroupSinglePag return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -516,7 +516,7 @@ private Mono> getByResourceGroupWithResponseAsy return Mono .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -568,7 +568,7 @@ private Mono> getByResourceGroupWithResponseAsy return Mono .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -676,7 +676,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { securityConnector.validate(); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -740,7 +740,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { securityConnector.validate(); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -860,7 +860,7 @@ private Mono> updateWithResponseAsync( } else { securityConnector.validate(); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -923,7 +923,7 @@ private Mono> updateWithResponseAsync( } else { securityConnector.validate(); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1030,7 +1030,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1082,7 +1082,7 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsClientImpl.java new file mode 100644 index 000000000000..c771f61b3a11 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsClientImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.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.security.fluent.SensitivitySettingsClient; +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SensitivitySettingsClient. */ +public final class SensitivitySettingsClientImpl implements SensitivitySettingsClient { + /** The proxy service used to perform REST calls. */ + private final SensitivitySettingsService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of SensitivitySettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SensitivitySettingsClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy.create(SensitivitySettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterSensitivitySettings to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterSensit") + public interface SensitivitySettingsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Security/sensitivitySettings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list with a single sensitivity settings resource. + * + * @throws 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 with a single sensitivity settings resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2023-02-15-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list with a single sensitivity settings 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 list with a single sensitivity settings resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2023-02-15-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), apiVersion, accept, context); + } + + /** + * Gets a list with a single sensitivity settings resource. + * + * @throws 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 with a single sensitivity settings resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync() { + return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a list with a single sensitivity settings 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 list with a single sensitivity settings resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(Context context) { + return listWithResponseAsync(context).block(); + } + + /** + * Gets a list with a single sensitivity settings resource. + * + * @throws 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 with a single sensitivity settings resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GetSensitivitySettingsListResponseInner list() { + return listWithResponse(Context.NONE).getValue(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsImpl.java new file mode 100644 index 000000000000..209d1528fb41 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.SensitivitySettingsClient; +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; +import com.azure.resourcemanager.security.models.GetSensitivitySettingsListResponse; +import com.azure.resourcemanager.security.models.SensitivitySettings; + +public final class SensitivitySettingsImpl implements SensitivitySettings { + private static final ClientLogger LOGGER = new ClientLogger(SensitivitySettingsImpl.class); + + private final SensitivitySettingsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public SensitivitySettingsImpl( + SensitivitySettingsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse(Context context) { + Response inner = this.serviceClient().listWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GetSensitivitySettingsListResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GetSensitivitySettingsListResponse list() { + GetSensitivitySettingsListResponseInner inner = this.serviceClient().list(); + if (inner != null) { + return new GetSensitivitySettingsListResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private SensitivitySettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingImpl.java new file mode 100644 index 000000000000..b17fd95bfb88 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsSettingInner; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSetting; + +public final class ServerVulnerabilityAssessmentsSettingImpl implements ServerVulnerabilityAssessmentsSetting { + private ServerVulnerabilityAssessmentsSettingInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + ServerVulnerabilityAssessmentsSettingImpl( + ServerVulnerabilityAssessmentsSettingInner innerObject, + com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public ServerVulnerabilityAssessmentsSettingInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingsClientImpl.java new file mode 100644 index 000000000000..1f84251d69ed --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingsClientImpl.java @@ -0,0 +1,762 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.security.fluent.ServerVulnerabilityAssessmentsSettingsClient; +import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsSettingInner; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingsList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ServerVulnerabilityAssessmentsSettingsClient. + */ +public final class ServerVulnerabilityAssessmentsSettingsClientImpl + implements ServerVulnerabilityAssessmentsSettingsClient { + /** The proxy service used to perform REST calls. */ + private final ServerVulnerabilityAssessmentsSettingsService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of ServerVulnerabilityAssessmentsSettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServerVulnerabilityAssessmentsSettingsClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy + .create( + ServerVulnerabilityAssessmentsSettingsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterServerVulnerabilityAssessmentsSettings to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterServer") + public interface ServerVulnerabilityAssessmentsSettingsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings/{settingKind}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("settingKind") ServerVulnerabilityAssessmentsSettingKindName settingKind, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings/{settingKind}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("settingKind") ServerVulnerabilityAssessmentsSettingKindName settingKind, + @BodyParam("application/json") + ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings/{settingKind}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("settingKind") ServerVulnerabilityAssessmentsSettingKindName settingKind, + @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("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a list of all the server vulnerability assessments settings over a subscription level scope. + * + * @throws 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 all the server vulnerability assessments settings over a subscription level scope along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a list of all the server vulnerability assessments settings over a subscription level scope. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 all the server vulnerability assessments settings over a subscription level scope along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get a list of all the server vulnerability assessments settings over a subscription level scope. + * + * @throws 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 all the server vulnerability assessments settings over a subscription level scope as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Get a list of all the server vulnerability assessments settings over a subscription level scope. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 all the server vulnerability assessments settings over a subscription level scope as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Get a list of all the server vulnerability assessments settings over a subscription level scope. + * + * @throws 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 all the server vulnerability assessments settings over a subscription level scope as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Get a list of all the server vulnerability assessments settings over a subscription level scope. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 all the server vulnerability assessments settings over a subscription level scope as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get a server vulnerability assessments setting of the requested kind, that is set on the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 server vulnerability assessments setting of the requested kind, that is set on the subscription along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + ServerVulnerabilityAssessmentsSettingKindName settingKind) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (settingKind == null) { + return Mono.error(new IllegalArgumentException("Parameter settingKind is required and cannot be null.")); + } + final String apiVersion = "2023-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + settingKind, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a server vulnerability assessments setting of the requested kind, that is set on the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 server vulnerability assessments setting of the requested kind, that is set on the subscription along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + ServerVulnerabilityAssessmentsSettingKindName settingKind, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (settingKind == null) { + return Mono.error(new IllegalArgumentException("Parameter settingKind is required and cannot be null.")); + } + final String apiVersion = "2023-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), settingKind, accept, context); + } + + /** + * Get a server vulnerability assessments setting of the requested kind, that is set on the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 server vulnerability assessments setting of the requested kind, that is set on the subscription on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + ServerVulnerabilityAssessmentsSettingKindName settingKind) { + return getWithResponseAsync(settingKind).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a server vulnerability assessments setting of the requested kind, that is set on the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 server vulnerability assessments setting of the requested kind, that is set on the subscription along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + ServerVulnerabilityAssessmentsSettingKindName settingKind, Context context) { + return getWithResponseAsync(settingKind, context).block(); + } + + /** + * Get a server vulnerability assessments setting of the requested kind, that is set on the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 server vulnerability assessments setting of the requested kind, that is set on the subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerVulnerabilityAssessmentsSettingInner get(ServerVulnerabilityAssessmentsSettingKindName settingKind) { + return getWithResponse(settingKind, Context.NONE).getValue(); + } + + /** + * Create or update a server vulnerability assessments setting of the requested kind on the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @param serverVulnerabilityAssessmentsSetting A server vulnerability assessments setting over a predefined scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 base vulnerability assessments setting on servers in the defined scope along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + ServerVulnerabilityAssessmentsSettingKindName settingKind, + ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (settingKind == null) { + return Mono.error(new IllegalArgumentException("Parameter settingKind is required and cannot be null.")); + } + if (serverVulnerabilityAssessmentsSetting == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serverVulnerabilityAssessmentsSetting is required and cannot be null.")); + } else { + serverVulnerabilityAssessmentsSetting.validate(); + } + final String apiVersion = "2023-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + settingKind, + serverVulnerabilityAssessmentsSetting, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a server vulnerability assessments setting of the requested kind on the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @param serverVulnerabilityAssessmentsSetting A server vulnerability assessments setting over a predefined scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 base vulnerability assessments setting on servers in the defined scope along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + ServerVulnerabilityAssessmentsSettingKindName settingKind, + ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (settingKind == null) { + return Mono.error(new IllegalArgumentException("Parameter settingKind is required and cannot be null.")); + } + if (serverVulnerabilityAssessmentsSetting == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serverVulnerabilityAssessmentsSetting is required and cannot be null.")); + } else { + serverVulnerabilityAssessmentsSetting.validate(); + } + final String apiVersion = "2023-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + settingKind, + serverVulnerabilityAssessmentsSetting, + accept, + context); + } + + /** + * Create or update a server vulnerability assessments setting of the requested kind on the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @param serverVulnerabilityAssessmentsSetting A server vulnerability assessments setting over a predefined scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 base vulnerability assessments setting on servers in the defined scope on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + ServerVulnerabilityAssessmentsSettingKindName settingKind, + ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting) { + return createOrUpdateWithResponseAsync(settingKind, serverVulnerabilityAssessmentsSetting) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update a server vulnerability assessments setting of the requested kind on the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @param serverVulnerabilityAssessmentsSetting A server vulnerability assessments setting over a predefined scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 base vulnerability assessments setting on servers in the defined scope along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + ServerVulnerabilityAssessmentsSettingKindName settingKind, + ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting, + Context context) { + return createOrUpdateWithResponseAsync(settingKind, serverVulnerabilityAssessmentsSetting, context).block(); + } + + /** + * Create or update a server vulnerability assessments setting of the requested kind on the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @param serverVulnerabilityAssessmentsSetting A server vulnerability assessments setting over a predefined scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 base vulnerability assessments setting on servers in the defined scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerVulnerabilityAssessmentsSettingInner createOrUpdate( + ServerVulnerabilityAssessmentsSettingKindName settingKind, + ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting) { + return createOrUpdateWithResponse(settingKind, serverVulnerabilityAssessmentsSetting, Context.NONE).getValue(); + } + + /** + * Delete the server vulnerability assessments setting of the requested kind from the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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(ServerVulnerabilityAssessmentsSettingKindName settingKind) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (settingKind == null) { + return Mono.error(new IllegalArgumentException("Parameter settingKind is required and cannot be null.")); + } + final String apiVersion = "2023-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + settingKind, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the server vulnerability assessments setting of the requested kind from the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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( + ServerVulnerabilityAssessmentsSettingKindName settingKind, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (settingKind == null) { + return Mono.error(new IllegalArgumentException("Parameter settingKind is required and cannot be null.")); + } + final String apiVersion = "2023-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), settingKind, accept, context); + } + + /** + * Delete the server vulnerability assessments setting of the requested kind from the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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(ServerVulnerabilityAssessmentsSettingKindName settingKind) { + return deleteWithResponseAsync(settingKind).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete the server vulnerability assessments setting of the requested kind from the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + ServerVulnerabilityAssessmentsSettingKindName settingKind, Context context) { + return deleteWithResponseAsync(settingKind, context).block(); + } + + /** + * Delete the server vulnerability assessments setting of the requested kind from the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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(ServerVulnerabilityAssessmentsSettingKindName settingKind) { + deleteWithResponse(settingKind, Context.NONE); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a page of a server vulnerability assessments settings list along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a page of a server vulnerability assessments settings list along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingsImpl.java new file mode 100644 index 000000000000..9fede1af25f2 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingsImpl.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.ServerVulnerabilityAssessmentsSettingsClient; +import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsSettingInner; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSetting; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettings; + +public final class ServerVulnerabilityAssessmentsSettingsImpl implements ServerVulnerabilityAssessmentsSettings { + private static final ClientLogger LOGGER = new ClientLogger(ServerVulnerabilityAssessmentsSettingsImpl.class); + + private final ServerVulnerabilityAssessmentsSettingsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public ServerVulnerabilityAssessmentsSettingsImpl( + ServerVulnerabilityAssessmentsSettingsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ServerVulnerabilityAssessmentsSettingImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ServerVulnerabilityAssessmentsSettingImpl(inner1, this.manager())); + } + + public Response getWithResponse( + ServerVulnerabilityAssessmentsSettingKindName settingKind, Context context) { + Response inner = + this.serviceClient().getWithResponse(settingKind, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServerVulnerabilityAssessmentsSettingImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ServerVulnerabilityAssessmentsSetting get(ServerVulnerabilityAssessmentsSettingKindName settingKind) { + ServerVulnerabilityAssessmentsSettingInner inner = this.serviceClient().get(settingKind); + if (inner != null) { + return new ServerVulnerabilityAssessmentsSettingImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + ServerVulnerabilityAssessmentsSettingKindName settingKind, + ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(settingKind, serverVulnerabilityAssessmentsSetting, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServerVulnerabilityAssessmentsSettingImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ServerVulnerabilityAssessmentsSetting createOrUpdate( + ServerVulnerabilityAssessmentsSettingKindName settingKind, + ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting) { + ServerVulnerabilityAssessmentsSettingInner inner = + this.serviceClient().createOrUpdate(settingKind, serverVulnerabilityAssessmentsSetting); + if (inner != null) { + return new ServerVulnerabilityAssessmentsSettingImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse( + ServerVulnerabilityAssessmentsSettingKindName settingKind, Context context) { + return this.serviceClient().deleteWithResponse(settingKind, context); + } + + public void delete(ServerVulnerabilityAssessmentsSettingKindName settingKind) { + this.serviceClient().delete(settingKind); + } + + private ServerVulnerabilityAssessmentsSettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/Utils.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/Utils.java index 210bf291fe60..8fed191a3f0b 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/Utils.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/Utils.java @@ -20,6 +20,9 @@ import reactor.core.publisher.Flux; final class Utils { + private Utils() { + } + static String getValueFromIdByName(String id, String name) { if (id == null) { return null; @@ -60,7 +63,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri segments.add(idSegment); idItrReverted.forEachRemaining(segments::add); Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { + if (!segments.isEmpty() && segments.get(0).isEmpty()) { segments.remove(0); } return String.join("/", segments); @@ -74,7 +77,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); + return new PagedIterableImpl<>(pageIterable, mapper); } private static final class PagedIterableImpl extends PagedIterable { @@ -133,30 +136,27 @@ public Stream> streamByPage(String continuationToken, int prefe @Override public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); + return new IteratorImpl<>(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } @@ -198,7 +198,7 @@ private IterableImpl(Iterable iterable, Function mapper) { @Override public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); + return new IteratorImpl<>(iterable.iterator(), mapper); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediation.java new file mode 100644 index 000000000000..9dbbe48807cf --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediation.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Configuration payload for PR Annotations. */ +@Fluent +public final class ActionableRemediation { + /* + * ActionableRemediation Setting. + * None - the setting was never set. + * Enabled - ActionableRemediation is enabled. + * Disabled - ActionableRemediation is disabled. + */ + @JsonProperty(value = "state") + private ActionableRemediationState state; + + /* + * Gets or sets list of categories and severity levels. + */ + @JsonProperty(value = "categoryConfigurations") + private List categoryConfigurations; + + /* + * Repository branch configuration for PR Annotations. + */ + @JsonProperty(value = "branchConfiguration") + private TargetBranchConfiguration branchConfiguration; + + /* + * Update Settings. + * + * Enabled - Resource should inherit configurations from parent. + * Disabled - Resource should not inherit configurations from parent. + */ + @JsonProperty(value = "inheritFromParentState") + private InheritFromParentState inheritFromParentState; + + /** Creates an instance of ActionableRemediation class. */ + public ActionableRemediation() { + } + + /** + * Get the state property: ActionableRemediation Setting. None - the setting was never set. Enabled - + * ActionableRemediation is enabled. Disabled - ActionableRemediation is disabled. + * + * @return the state value. + */ + public ActionableRemediationState state() { + return this.state; + } + + /** + * Set the state property: ActionableRemediation Setting. None - the setting was never set. Enabled - + * ActionableRemediation is enabled. Disabled - ActionableRemediation is disabled. + * + * @param state the state value to set. + * @return the ActionableRemediation object itself. + */ + public ActionableRemediation withState(ActionableRemediationState state) { + this.state = state; + return this; + } + + /** + * Get the categoryConfigurations property: Gets or sets list of categories and severity levels. + * + * @return the categoryConfigurations value. + */ + public List categoryConfigurations() { + return this.categoryConfigurations; + } + + /** + * Set the categoryConfigurations property: Gets or sets list of categories and severity levels. + * + * @param categoryConfigurations the categoryConfigurations value to set. + * @return the ActionableRemediation object itself. + */ + public ActionableRemediation withCategoryConfigurations(List categoryConfigurations) { + this.categoryConfigurations = categoryConfigurations; + return this; + } + + /** + * Get the branchConfiguration property: Repository branch configuration for PR Annotations. + * + * @return the branchConfiguration value. + */ + public TargetBranchConfiguration branchConfiguration() { + return this.branchConfiguration; + } + + /** + * Set the branchConfiguration property: Repository branch configuration for PR Annotations. + * + * @param branchConfiguration the branchConfiguration value to set. + * @return the ActionableRemediation object itself. + */ + public ActionableRemediation withBranchConfiguration(TargetBranchConfiguration branchConfiguration) { + this.branchConfiguration = branchConfiguration; + return this; + } + + /** + * Get the inheritFromParentState property: Update Settings. + * + *

Enabled - Resource should inherit configurations from parent. Disabled - Resource should not inherit + * configurations from parent. + * + * @return the inheritFromParentState value. + */ + public InheritFromParentState inheritFromParentState() { + return this.inheritFromParentState; + } + + /** + * Set the inheritFromParentState property: Update Settings. + * + *

Enabled - Resource should inherit configurations from parent. Disabled - Resource should not inherit + * configurations from parent. + * + * @param inheritFromParentState the inheritFromParentState value to set. + * @return the ActionableRemediation object itself. + */ + public ActionableRemediation withInheritFromParentState(InheritFromParentState inheritFromParentState) { + this.inheritFromParentState = inheritFromParentState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (categoryConfigurations() != null) { + categoryConfigurations().forEach(e -> e.validate()); + } + if (branchConfiguration() != null) { + branchConfiguration().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediationState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediationState.java new file mode 100644 index 000000000000..93cd3e998625 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediationState.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * ActionableRemediation Setting. None - the setting was never set. Enabled - ActionableRemediation is enabled. Disabled + * - ActionableRemediation is disabled. + */ +public final class ActionableRemediationState extends ExpandableStringEnum { + /** Static value None for ActionableRemediationState. */ + public static final ActionableRemediationState NONE = fromString("None"); + + /** Static value Disabled for ActionableRemediationState. */ + public static final ActionableRemediationState DISABLED = fromString("Disabled"); + + /** Static value Enabled for ActionableRemediationState. */ + public static final ActionableRemediationState ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of ActionableRemediationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionableRemediationState() { + } + + /** + * Creates or finds a ActionableRemediationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionableRemediationState. + */ + @JsonCreator + public static ActionableRemediationState fromString(String name) { + return fromString(name, ActionableRemediationState.class); + } + + /** + * Gets known ActionableRemediationState values. + * + * @return known ActionableRemediationState values. + */ + public static Collection values() { + return values(ActionableRemediationState.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlGroup.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlGroup.java index cb789472d089..22e4de3f6db0 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlGroup.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlGroup.java @@ -122,11 +122,13 @@ public interface AdaptiveApplicationControlGroup { interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } + /** The AdaptiveApplicationControlGroup definition stages. */ interface DefinitionStages { /** The first stage of the AdaptiveApplicationControlGroup definition. */ interface Blank extends WithParentResource { } + /** The stage of the AdaptiveApplicationControlGroup definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -138,6 +140,7 @@ interface WithParentResource { */ WithCreate withExistingLocation(String ascLocation); } + /** * The stage of the AdaptiveApplicationControlGroup 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. @@ -162,6 +165,7 @@ interface WithCreate */ AdaptiveApplicationControlGroup create(Context context); } + /** The stage of the AdaptiveApplicationControlGroup definition allowing to specify enforcementMode. */ interface WithEnforcementMode { /** @@ -173,6 +177,7 @@ interface WithEnforcementMode { */ WithCreate withEnforcementMode(EnforcementMode enforcementMode); } + /** The stage of the AdaptiveApplicationControlGroup definition allowing to specify protectionMode. */ interface WithProtectionMode { /** @@ -185,6 +190,7 @@ interface WithProtectionMode { */ WithCreate withProtectionMode(ProtectionMode protectionMode); } + /** The stage of the AdaptiveApplicationControlGroup definition allowing to specify vmRecommendations. */ interface WithVmRecommendations { /** @@ -195,6 +201,7 @@ interface WithVmRecommendations { */ WithCreate withVmRecommendations(List vmRecommendations); } + /** The stage of the AdaptiveApplicationControlGroup definition allowing to specify pathRecommendations. */ interface WithPathRecommendations { /** @@ -206,6 +213,7 @@ interface WithPathRecommendations { WithCreate withPathRecommendations(List pathRecommendations); } } + /** * Begins update for the AdaptiveApplicationControlGroup resource. * @@ -234,6 +242,7 @@ interface Update */ AdaptiveApplicationControlGroup apply(Context context); } + /** The AdaptiveApplicationControlGroup update stages. */ interface UpdateStages { /** The stage of the AdaptiveApplicationControlGroup update allowing to specify enforcementMode. */ @@ -247,6 +256,7 @@ interface WithEnforcementMode { */ Update withEnforcementMode(EnforcementMode enforcementMode); } + /** The stage of the AdaptiveApplicationControlGroup update allowing to specify protectionMode. */ interface WithProtectionMode { /** @@ -259,6 +269,7 @@ interface WithProtectionMode { */ Update withProtectionMode(ProtectionMode protectionMode); } + /** The stage of the AdaptiveApplicationControlGroup update allowing to specify vmRecommendations. */ interface WithVmRecommendations { /** @@ -269,6 +280,7 @@ interface WithVmRecommendations { */ Update withVmRecommendations(List vmRecommendations); } + /** The stage of the AdaptiveApplicationControlGroup update allowing to specify pathRecommendations. */ interface WithPathRecommendations { /** @@ -280,6 +292,7 @@ interface WithPathRecommendations { Update withPathRecommendations(List pathRecommendations); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdvancedThreatProtectionSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdvancedThreatProtectionSetting.java index d7a8bd563ad0..472eb1cc9253 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdvancedThreatProtectionSetting.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdvancedThreatProtectionSetting.java @@ -47,11 +47,13 @@ public interface AdvancedThreatProtectionSetting { /** The entirety of the AdvancedThreatProtectionSetting definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { } + /** The AdvancedThreatProtectionSetting definition stages. */ interface DefinitionStages { /** The first stage of the AdvancedThreatProtectionSetting definition. */ interface Blank extends WithScope { } + /** The stage of the AdvancedThreatProtectionSetting definition allowing to specify parent resource. */ interface WithScope { /** @@ -62,6 +64,7 @@ interface WithScope { */ WithCreate withExistingResourceId(String resourceId); } + /** * The stage of the AdvancedThreatProtectionSetting 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. @@ -82,6 +85,7 @@ interface WithCreate extends DefinitionStages.WithIsEnabled { */ AdvancedThreatProtectionSetting create(Context context); } + /** The stage of the AdvancedThreatProtectionSetting definition allowing to specify isEnabled. */ interface WithIsEnabled { /** @@ -93,6 +97,7 @@ interface WithIsEnabled { WithCreate withIsEnabled(Boolean isEnabled); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AnnotateDefaultBranchState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AnnotateDefaultBranchState.java new file mode 100644 index 000000000000..15cc2e2f2383 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AnnotateDefaultBranchState.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Configuration of PR Annotations on default branch. + * + *

Enabled - PR Annotations are enabled on the resource's default branch. Disabled - PR Annotations are disabled on + * the resource's default branch. + */ +public final class AnnotateDefaultBranchState extends ExpandableStringEnum { + /** Static value Disabled for AnnotateDefaultBranchState. */ + public static final AnnotateDefaultBranchState DISABLED = fromString("Disabled"); + + /** Static value Enabled for AnnotateDefaultBranchState. */ + public static final AnnotateDefaultBranchState ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of AnnotateDefaultBranchState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AnnotateDefaultBranchState() { + } + + /** + * Creates or finds a AnnotateDefaultBranchState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AnnotateDefaultBranchState. + */ + @JsonCreator + public static AnnotateDefaultBranchState fromString(String name) { + return fromString(name, AnnotateDefaultBranchState.class); + } + + /** + * Gets known AnnotateDefaultBranchState values. + * + * @return known AnnotateDefaultBranchState values. + */ + public static Collection values() { + return values(AnnotateDefaultBranchState.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollection.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollection.java new file mode 100644 index 000000000000..f621e093e5c7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollection.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.resourcemanager.security.fluent.models.ApiCollectionInner; + +/** An immutable client-side representation of ApiCollection. */ +public interface ApiCollection { + /** + * 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 provisioningState property: Gets the provisioning state of the API collection. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the displayName property: The display name of the API collection. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the discoveredVia property: The resource Id of the resource from where this API collection was discovered. + * + * @return the discoveredVia value. + */ + String discoveredVia(); + + /** + * Gets the baseUrl property: The base URI for this API collection. All endpoints of this API collection extend this + * base URI. + * + * @return the baseUrl value. + */ + String baseUrl(); + + /** + * Gets the numberOfApiEndpoints property: The number of API endpoints discovered in this API collection. + * + * @return the numberOfApiEndpoints value. + */ + Long numberOfApiEndpoints(); + + /** + * Gets the numberOfInactiveApiEndpoints property: The number of API endpoints in this API collection that have not + * received any API traffic in the last 30 days. + * + * @return the numberOfInactiveApiEndpoints value. + */ + Long numberOfInactiveApiEndpoints(); + + /** + * Gets the numberOfUnauthenticatedApiEndpoints property: The number of API endpoints in this API collection that + * are unauthenticated. + * + * @return the numberOfUnauthenticatedApiEndpoints value. + */ + Long numberOfUnauthenticatedApiEndpoints(); + + /** + * Gets the numberOfExternalApiEndpoints property: The number of API endpoints in this API collection for which API + * traffic from the internet was observed. + * + * @return the numberOfExternalApiEndpoints value. + */ + Long numberOfExternalApiEndpoints(); + + /** + * Gets the numberOfApiEndpointsWithSensitiveDataExposed property: The number of API endpoints in this API + * collection which are exposing sensitive data in their requests and/or responses. + * + * @return the numberOfApiEndpointsWithSensitiveDataExposed value. + */ + Long numberOfApiEndpointsWithSensitiveDataExposed(); + + /** + * Gets the sensitivityLabel property: The highest priority sensitivity label from Microsoft Purview in this API + * collection. + * + * @return the sensitivityLabel value. + */ + String sensitivityLabel(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.ApiCollectionInner object. + * + * @return the inner object. + */ + ApiCollectionInner innerModel(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionResponseList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionList.java similarity index 78% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionResponseList.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionList.java index 2666ef531123..630560e6ec75 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionResponseList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionList.java @@ -5,18 +5,18 @@ package com.azure.resourcemanager.security.models; import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionResponseInner; +import com.azure.resourcemanager.security.fluent.models.ApiCollectionInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Page of a list of API collections as represented by Defender for APIs. */ +/** Page of a list of API collections as represented by Microsoft Defender for APIs. */ @Immutable -public final class ApiCollectionResponseList { +public final class ApiCollectionList { /* * API collections in this page. */ @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; + private List value; /* * The URI to fetch the next page. @@ -24,8 +24,8 @@ public final class ApiCollectionResponseList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of ApiCollectionResponseList class. */ - public ApiCollectionResponseList() { + /** Creates an instance of ApiCollectionList class. */ + public ApiCollectionList() { } /** @@ -33,7 +33,7 @@ public ApiCollectionResponseList() { * * @return the value value. */ - public List value() { + public List value() { return this.value; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionOffboardings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionOffboardings.java deleted file mode 100644 index 8fbc3ffe617e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionOffboardings.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of ApiCollectionOffboardings. */ -public interface ApiCollectionOffboardings { - /** - * Offboard an Azure API Management API from Defender for APIs - * - *

Offboard an Azure API Management API from Defender for APIs. The system will stop monitoring the operations - * within the Azure API Management API for intrusive behaviors. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context); - - /** - * Offboard an Azure API Management API from Defender for APIs - * - *

Offboard an Azure API Management API from Defender for APIs. The system will stop monitoring the operations - * within the Azure API Management API for intrusive behaviors. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String serviceName, String apiCollectionId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionOnboardings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionOnboardings.java deleted file mode 100644 index c4109ca69adb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionOnboardings.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of ApiCollectionOnboardings. */ -public interface ApiCollectionOnboardings { - /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to Defender for APIs. The system will start monitoring the operations - * within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 API collection as represented by Defender for APIs along with {@link Response}. - */ - Response createWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context); - - /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to Defender for APIs. The system will start monitoring the operations - * within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an API collection as represented by Defender for APIs. - */ - ApiCollectionResponse create(String resourceGroupName, String serviceName, String apiCollectionId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollections.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollections.java index d21a442595cb..0d0ca94a3311 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollections.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollections.java @@ -11,75 +11,207 @@ /** Resource collection API of ApiCollections. */ public interface ApiCollections { /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs + * Gets a list of API collections within a subscription * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API - * Management API for intrusive behaviors and provide alerts for attacks that have been detected. + *

Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs. + * + * @throws com.azure.core.management.exception.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 API collections within a subscription that have been onboarded to Microsoft Defender for APIs + * as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets a list of API collections within a subscription + * + *

Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 API collections within a subscription that have been onboarded to Microsoft Defender for APIs + * as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets a list of API collections within a resource group + * + *

Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for + * APIs. + * + * @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 a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs + * as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of API collections within a resource group + * + *

Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for + * APIs. + * + * @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 a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs + * as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a list of onboarded Azure API Management APIs + * + *

Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure + * API Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the + * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Azure API Management APIs that have been onboarded to Microsoft Defender for APIs as paginated + * response with {@link PagedIterable}. + */ + PagedIterable listByAzureApiManagementService(String resourceGroupName, String serviceName); + + /** + * Gets a list of onboarded Azure API Management APIs + * + *

Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure + * API Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the + * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Azure API Management APIs that have been onboarded to Microsoft Defender for APIs as paginated + * response with {@link PagedIterable}. + */ + PagedIterable listByAzureApiManagementService( + String resourceGroupName, String serviceName, Context context); + + /** + * Gets an onboarded Azure API Management API + * + *

Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API + * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the + * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Azure API Management API if it has been onboarded to Microsoft Defender for APIs along with {@link + * Response}. + */ + Response getByAzureApiManagementServiceWithResponse( + String resourceGroupName, String serviceName, String apiId, Context context); + + /** + * Gets an onboarded Azure API Management API + * + *

Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API + * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the + * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Azure API Management API if it has been onboarded to Microsoft Defender for APIs. + */ + ApiCollection getByAzureApiManagementService(String resourceGroupName, String serviceName, String apiId); + + /** + * Onboard an Azure API Management API to Microsoft Defender for APIs + * + *

Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the + * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been + * detected. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedIterable}. + * @return an API collection as represented by Microsoft Defender for APIs. */ - PagedIterable list(String resourceGroupName, String serviceName); + ApiCollection onboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId); /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs + * Onboard an Azure API Management API to Microsoft Defender for APIs * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API - * Management API for intrusive behaviors and provide alerts for attacks that have been detected. + *

Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the + * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been + * detected. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedIterable}. + * @return an API collection as represented by Microsoft Defender for APIs. */ - PagedIterable list(String resourceGroupName, String serviceName, Context context); + ApiCollection onboardAzureApiManagementApi( + String resourceGroupName, String serviceName, String apiId, Context context); /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs + * Offboard an Azure API Management API from Microsoft Defender for APIs * - *

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to Defender for APIs, the system will monitor the operations within the Azure API Management API for - * intrusive behaviors and provide alerts for attacks that have been detected. + *

Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the + * operations within the Azure API Management API for intrusive behaviors. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Azure API Management API if it has been onboarded to Defender for APIs along with {@link Response}. + * @return the {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context); + Response offboardAzureApiManagementApiWithResponse( + String resourceGroupName, String serviceName, String apiId, Context context); /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs + * Offboard an Azure API Management API from Microsoft Defender for APIs * - *

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to Defender for APIs, the system will monitor the operations within the Azure API Management API for - * intrusive behaviors and provide alerts for attacks that have been detected. + *

Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the + * operations within the Azure API Management API for intrusive behaviors. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision + * has ;rev=n as a suffix where n is the revision number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Azure API Management API if it has been onboarded to Defender for APIs. */ - ApiCollectionResponse get(String resourceGroupName, String serviceName, String apiCollectionId); + void offboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Application.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Application.java index 9a2925359582..f6f6b6233171 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Application.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Application.java @@ -69,11 +69,13 @@ public interface Application { /** The entirety of the Application definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { } + /** The Application definition stages. */ interface DefinitionStages { /** The first stage of the Application definition. */ interface Blank extends WithCreate { } + /** * The stage of the Application 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. @@ -98,6 +100,7 @@ interface WithCreate */ Application create(Context context); } + /** The stage of the Application definition allowing to specify displayName. */ interface WithDisplayName { /** @@ -108,6 +111,7 @@ interface WithDisplayName { */ WithCreate withDisplayName(String displayName); } + /** The stage of the Application definition allowing to specify description. */ interface WithDescription { /** @@ -118,6 +122,7 @@ interface WithDescription { */ WithCreate withDescription(String description); } + /** The stage of the Application definition allowing to specify sourceResourceType. */ interface WithSourceResourceType { /** @@ -128,6 +133,7 @@ interface WithSourceResourceType { */ WithCreate withSourceResourceType(ApplicationSourceResourceType sourceResourceType); } + /** The stage of the Application definition allowing to specify conditionSets. */ interface WithConditionSets { /** @@ -139,6 +145,7 @@ interface WithConditionSets { WithCreate withConditionSets(List conditionSets); } } + /** * Begins update for the Application resource. * @@ -167,6 +174,7 @@ interface Update */ Application apply(Context context); } + /** The Application update stages. */ interface UpdateStages { /** The stage of the Application update allowing to specify displayName. */ @@ -179,6 +187,7 @@ interface WithDisplayName { */ Update withDisplayName(String displayName); } + /** The stage of the Application update allowing to specify description. */ interface WithDescription { /** @@ -189,6 +198,7 @@ interface WithDescription { */ Update withDescription(String description); } + /** The stage of the Application update allowing to specify sourceResourceType. */ interface WithSourceResourceType { /** @@ -199,6 +209,7 @@ interface WithSourceResourceType { */ Update withSourceResourceType(ApplicationSourceResourceType sourceResourceType); } + /** The stage of the Application update allowing to specify conditionSets. */ interface WithConditionSets { /** @@ -210,6 +221,7 @@ interface WithConditionSets { Update withConditionSets(List conditionSets); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Authorization.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Authorization.java new file mode 100644 index 000000000000..bced8431edc0 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Authorization.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Authorization payload. */ +@Fluent +public final class Authorization { + /* + * Gets or sets one-time OAuth code to exchange for refresh and access tokens. + * + * Only used during PUT/PATCH operations. The secret is cleared during GET. + */ + @JsonProperty(value = "code") + private String code; + + /** Creates an instance of Authorization class. */ + public Authorization() { + } + + /** + * Get the code property: Gets or sets one-time OAuth code to exchange for refresh and access tokens. + * + *

Only used during PUT/PATCH operations. The secret is cleared during GET. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: Gets or sets one-time OAuth code to exchange for refresh and access tokens. + * + *

Only used during PUT/PATCH operations. The secret is cleared during GET. + * + * @param code the code value to set. + * @return the Authorization object itself. + */ + public Authorization withCode(String code) { + this.code = code; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoDiscovery.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoDiscovery.java new file mode 100644 index 000000000000..ea59d3ae1328 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoDiscovery.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** AutoDiscovery states. */ +public final class AutoDiscovery extends ExpandableStringEnum { + /** Static value Disabled for AutoDiscovery. */ + public static final AutoDiscovery DISABLED = fromString("Disabled"); + + /** Static value Enabled for AutoDiscovery. */ + public static final AutoDiscovery ENABLED = fromString("Enabled"); + + /** Static value NotApplicable for AutoDiscovery. */ + public static final AutoDiscovery NOT_APPLICABLE = fromString("NotApplicable"); + + /** + * Creates a new instance of AutoDiscovery value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutoDiscovery() { + } + + /** + * Creates or finds a AutoDiscovery from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoDiscovery. + */ + @JsonCreator + public static AutoDiscovery fromString(String name) { + return fromString(name, AutoDiscovery.class); + } + + /** + * Gets known AutoDiscovery values. + * + * @return known AutoDiscovery values. + */ + public static Collection values() { + return values(AutoDiscovery.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSetting.java index df4279031dd7..bf1d68193122 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSetting.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSetting.java @@ -47,11 +47,13 @@ public interface AutoProvisioningSetting { /** The entirety of the AutoProvisioningSetting definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { } + /** The AutoProvisioningSetting definition stages. */ interface DefinitionStages { /** The first stage of the AutoProvisioningSetting definition. */ interface Blank extends WithCreate { } + /** * The stage of the AutoProvisioningSetting 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. @@ -72,6 +74,7 @@ interface WithCreate extends DefinitionStages.WithAutoProvision { */ AutoProvisioningSetting create(Context context); } + /** The stage of the AutoProvisioningSetting definition allowing to specify autoProvision. */ interface WithAutoProvision { /** @@ -83,6 +86,7 @@ interface WithAutoProvision { WithCreate withAutoProvision(AutoProvision autoProvision); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automation.java index b584f1a114a3..5b62dc96975d 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automation.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automation.java @@ -122,11 +122,13 @@ interface Definition DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } + /** The Automation definition stages. */ interface DefinitionStages { /** The first stage of the Automation definition. */ interface Blank extends WithLocation { } + /** The stage of the Automation definition allowing to specify location. */ interface WithLocation { /** @@ -145,6 +147,7 @@ interface WithLocation { */ WithResourceGroup withRegion(String location); } + /** The stage of the Automation definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -156,6 +159,7 @@ interface WithResourceGroup { */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the Automation 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. @@ -182,6 +186,7 @@ interface WithCreate */ Automation create(Context context); } + /** The stage of the Automation definition allowing to specify tags. */ interface WithTags { /** @@ -192,6 +197,7 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the Automation definition allowing to specify description. */ interface WithDescription { /** @@ -202,6 +208,7 @@ interface WithDescription { */ WithCreate withDescription(String description); } + /** The stage of the Automation definition allowing to specify isEnabled. */ interface WithIsEnabled { /** @@ -212,6 +219,7 @@ interface WithIsEnabled { */ WithCreate withIsEnabled(Boolean isEnabled); } + /** The stage of the Automation definition allowing to specify scopes. */ interface WithScopes { /** @@ -226,6 +234,7 @@ interface WithScopes { */ WithCreate withScopes(List scopes); } + /** The stage of the Automation definition allowing to specify sources. */ interface WithSources { /** @@ -238,6 +247,7 @@ interface WithSources { */ WithCreate withSources(List sources); } + /** The stage of the Automation definition allowing to specify actions. */ interface WithActions { /** @@ -251,6 +261,7 @@ interface WithActions { WithCreate withActions(List actions); } } + /** * Begins update for the Automation resource. * @@ -281,6 +292,7 @@ interface Update */ Automation apply(Context context); } + /** The Automation update stages. */ interface UpdateStages { /** The stage of the Automation update allowing to specify tags. */ @@ -293,6 +305,7 @@ interface WithTags { */ Update withTags(Map tags); } + /** The stage of the Automation update allowing to specify description. */ interface WithDescription { /** @@ -303,6 +316,7 @@ interface WithDescription { */ Update withDescription(String description); } + /** The stage of the Automation update allowing to specify isEnabled. */ interface WithIsEnabled { /** @@ -313,6 +327,7 @@ interface WithIsEnabled { */ Update withIsEnabled(Boolean isEnabled); } + /** The stage of the Automation update allowing to specify scopes. */ interface WithScopes { /** @@ -327,6 +342,7 @@ interface WithScopes { */ Update withScopes(List scopes); } + /** The stage of the Automation update allowing to specify sources. */ interface WithSources { /** @@ -339,6 +355,7 @@ interface WithSources { */ Update withSources(List sources); } + /** The stage of the Automation update allowing to specify actions. */ interface WithActions { /** @@ -352,6 +369,7 @@ interface WithActions { Update withActions(List actions); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsEnvironmentData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsEnvironmentData.java index bfcd9c358cfd..f2b56f92d6cb 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsEnvironmentData.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsEnvironmentData.java @@ -33,6 +33,12 @@ public final class AwsEnvironmentData extends EnvironmentData { @JsonProperty(value = "accountName", access = JsonProperty.Access.WRITE_ONLY) private String accountName; + /* + * Scan interval in hours (value should be between 1-hour to 24-hours) + */ + @JsonProperty(value = "scanInterval") + private Long scanInterval; + /** Creates an instance of AwsEnvironmentData class. */ public AwsEnvironmentData() { } @@ -86,6 +92,26 @@ public String accountName() { return this.accountName; } + /** + * Get the scanInterval property: Scan interval in hours (value should be between 1-hour to 24-hours). + * + * @return the scanInterval value. + */ + public Long scanInterval() { + return this.scanInterval; + } + + /** + * Set the scanInterval property: Scan interval in hours (value should be between 1-hour to 24-hours). + * + * @param scanInterval the scanInterval value to set. + * @return the AwsEnvironmentData object itself. + */ + public AwsEnvironmentData withScanInterval(Long scanInterval) { + this.scanInterval = scanInterval; + return this; + } + /** * Validates the instance. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrg.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrg.java new file mode 100644 index 000000000000..97e9d8f28373 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrg.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgInner; + +/** An immutable client-side representation of AzureDevOpsOrg. */ +public interface AzureDevOpsOrg { + /** + * 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the properties property: Azure DevOps Organization properties. + * + * @return the properties value. + */ + AzureDevOpsOrgProperties properties(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgInner object. + * + * @return the inner object. + */ + AzureDevOpsOrgInner innerModel(); + + /** The entirety of the AzureDevOpsOrg definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The AzureDevOpsOrg definition stages. */ + interface DefinitionStages { + /** The first stage of the AzureDevOpsOrg definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the AzureDevOpsOrg definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, securityConnectorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @return the next definition stage. + */ + WithCreate withExistingSecurityConnector(String resourceGroupName, String securityConnectorName); + } + + /** + * The stage of the AzureDevOpsOrg 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. + */ + AzureDevOpsOrg create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AzureDevOpsOrg create(Context context); + } + + /** The stage of the AzureDevOpsOrg definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Azure DevOps Organization properties.. + * + * @param properties Azure DevOps Organization properties. + * @return the next definition stage. + */ + WithCreate withProperties(AzureDevOpsOrgProperties properties); + } + } + + /** + * Begins update for the AzureDevOpsOrg resource. + * + * @return the stage of resource update. + */ + AzureDevOpsOrg.Update update(); + + /** The template for AzureDevOpsOrg update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AzureDevOpsOrg apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AzureDevOpsOrg apply(Context context); + } + + /** The AzureDevOpsOrg update stages. */ + interface UpdateStages { + /** The stage of the AzureDevOpsOrg update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Azure DevOps Organization properties.. + * + * @param properties Azure DevOps Organization properties. + * @return the next definition stage. + */ + Update withProperties(AzureDevOpsOrgProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AzureDevOpsOrg refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AzureDevOpsOrg refresh(Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgListResponse.java new file mode 100644 index 000000000000..375f52646431 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgListResponse.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgListResponseInner; +import java.util.List; + +/** An immutable client-side representation of AzureDevOpsOrgListResponse. */ +public interface AzureDevOpsOrgListResponse { + /** + * Gets the value property: Gets or sets list of resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: Gets or sets next link to scroll over the results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgListResponseInner object. + * + * @return the inner object. + */ + AzureDevOpsOrgListResponseInner innerModel(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgProperties.java new file mode 100644 index 000000000000..dc91d116be82 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgProperties.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Azure DevOps Organization properties. */ +@Fluent +public final class AzureDevOpsOrgProperties { + /* + * Gets or sets resource status message. + */ + @JsonProperty(value = "provisioningStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningStatusMessage; + + /* + * Gets or sets time when resource was last checked. + */ + @JsonProperty(value = "provisioningStatusUpdateTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime provisioningStatusUpdateTimeUtc; + + /* + * The provisioning state of the resource. + * + * Pending - Provisioning pending. + * Failed - Provisioning failed. + * Succeeded - Successful provisioning. + * Canceled - Provisioning canceled. + * PendingDeletion - Deletion pending. + * DeletionSuccess - Deletion successful. + * DeletionFailure - Deletion failure. + */ + @JsonProperty(value = "provisioningState") + private DevOpsProvisioningState provisioningState; + + /* + * Details about resource onboarding status across all connectors. + * + * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only + * applicable to top-level resources. + * Onboarded - this resource has already been onboarded by the specified connector. + * NotOnboarded - this resource has not been onboarded to any connector. + * NotApplicable - the onboarding state is not applicable to the current endpoint. + */ + @JsonProperty(value = "onboardingState") + private OnboardingState onboardingState; + + /* + * Configuration payload for PR Annotations. + */ + @JsonProperty(value = "actionableRemediation") + private ActionableRemediation actionableRemediation; + + /** Creates an instance of AzureDevOpsOrgProperties class. */ + public AzureDevOpsOrgProperties() { + } + + /** + * Get the provisioningStatusMessage property: Gets or sets resource status message. + * + * @return the provisioningStatusMessage value. + */ + public String provisioningStatusMessage() { + return this.provisioningStatusMessage; + } + + /** + * Get the provisioningStatusUpdateTimeUtc property: Gets or sets time when resource was last checked. + * + * @return the provisioningStatusUpdateTimeUtc value. + */ + public OffsetDateTime provisioningStatusUpdateTimeUtc() { + return this.provisioningStatusUpdateTimeUtc; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + *

Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - + * Provisioning canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion successful. DeletionFailure + * - Deletion failure. + * + * @return the provisioningState value. + */ + public DevOpsProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioning state of the resource. + * + *

Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - + * Provisioning canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion successful. DeletionFailure + * - Deletion failure. + * + * @param provisioningState the provisioningState value to set. + * @return the AzureDevOpsOrgProperties object itself. + */ + public AzureDevOpsOrgProperties withProvisioningState(DevOpsProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the onboardingState property: Details about resource onboarding status across all connectors. + * + *

OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only + * applicable to top-level resources. Onboarded - this resource has already been onboarded by the specified + * connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + * state is not applicable to the current endpoint. + * + * @return the onboardingState value. + */ + public OnboardingState onboardingState() { + return this.onboardingState; + } + + /** + * Set the onboardingState property: Details about resource onboarding status across all connectors. + * + *

OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only + * applicable to top-level resources. Onboarded - this resource has already been onboarded by the specified + * connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + * state is not applicable to the current endpoint. + * + * @param onboardingState the onboardingState value to set. + * @return the AzureDevOpsOrgProperties object itself. + */ + public AzureDevOpsOrgProperties withOnboardingState(OnboardingState onboardingState) { + this.onboardingState = onboardingState; + return this; + } + + /** + * Get the actionableRemediation property: Configuration payload for PR Annotations. + * + * @return the actionableRemediation value. + */ + public ActionableRemediation actionableRemediation() { + return this.actionableRemediation; + } + + /** + * Set the actionableRemediation property: Configuration payload for PR Annotations. + * + * @param actionableRemediation the actionableRemediation value to set. + * @return the AzureDevOpsOrgProperties object itself. + */ + public AzureDevOpsOrgProperties withActionableRemediation(ActionableRemediation actionableRemediation) { + this.actionableRemediation = actionableRemediation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (actionableRemediation() != null) { + actionableRemediation().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgs.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgs.java new file mode 100644 index 000000000000..8cf5349465bf --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgs.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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 AzureDevOpsOrgs. */ +public interface AzureDevOpsOrgs { + /** + * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link Response}. + */ + Response listAvailableWithResponse( + String resourceGroupName, String securityConnectorName, Context context); + + /** + * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination. + */ + AzureDevOpsOrgListResponse listAvailable(String resourceGroupName, String securityConnectorName); + + /** + * Returns a list of Azure DevOps organizations onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String securityConnectorName); + + /** + * Returns a list of Azure DevOps organizations onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); + + /** + * Returns a monitored Azure DevOps organization resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String securityConnectorName, String orgName, Context context); + + /** + * Returns a monitored Azure DevOps organization resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Organization resource. + */ + AzureDevOpsOrg get(String resourceGroupName, String securityConnectorName, String orgName); + + /** + * Returns a monitored Azure DevOps organization resource. + * + * @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 azure DevOps Organization resource along with {@link Response}. + */ + AzureDevOpsOrg getById(String id); + + /** + * Returns a monitored Azure DevOps organization resource. + * + * @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 azure DevOps Organization resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AzureDevOpsOrg resource. + * + * @param name resource name. + * @return the first stage of the new AzureDevOpsOrg definition. + */ + AzureDevOpsOrg.DefinitionStages.Blank define(String name); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProject.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProject.java new file mode 100644 index 000000000000..8e44a8876490 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProject.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner; + +/** An immutable client-side representation of AzureDevOpsProject. */ +public interface AzureDevOpsProject { + /** + * 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the properties property: Azure DevOps Project properties. + * + * @return the properties value. + */ + AzureDevOpsProjectProperties properties(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner object. + * + * @return the inner object. + */ + AzureDevOpsProjectInner innerModel(); + + /** The entirety of the AzureDevOpsProject definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The AzureDevOpsProject definition stages. */ + interface DefinitionStages { + /** The first stage of the AzureDevOpsProject definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the AzureDevOpsProject definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, securityConnectorName, orgName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @return the next definition stage. + */ + WithCreate withExistingAzureDevOpsOrg( + String resourceGroupName, String securityConnectorName, String orgName); + } + + /** + * The stage of the AzureDevOpsProject 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. + */ + AzureDevOpsProject create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AzureDevOpsProject create(Context context); + } + + /** The stage of the AzureDevOpsProject definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Azure DevOps Project properties.. + * + * @param properties Azure DevOps Project properties. + * @return the next definition stage. + */ + WithCreate withProperties(AzureDevOpsProjectProperties properties); + } + } + + /** + * Begins update for the AzureDevOpsProject resource. + * + * @return the stage of resource update. + */ + AzureDevOpsProject.Update update(); + + /** The template for AzureDevOpsProject update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AzureDevOpsProject apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AzureDevOpsProject apply(Context context); + } + + /** The AzureDevOpsProject update stages. */ + interface UpdateStages { + /** The stage of the AzureDevOpsProject update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Azure DevOps Project properties.. + * + * @param properties Azure DevOps Project properties. + * @return the next definition stage. + */ + Update withProperties(AzureDevOpsProjectProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AzureDevOpsProject refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AzureDevOpsProject refresh(Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectListResponse.java new file mode 100644 index 000000000000..04ff5e26579d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectListResponse.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of RP resources which supports pagination. */ +@Fluent +public final class AzureDevOpsProjectListResponse { + /* + * Gets or sets list of resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets next link to scroll over the results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of AzureDevOpsProjectListResponse class. */ + public AzureDevOpsProjectListResponse() { + } + + /** + * Get the value property: Gets or sets list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets list of resources. + * + * @param value the value value to set. + * @return the AzureDevOpsProjectListResponse object itself. + */ + public AzureDevOpsProjectListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets next link to scroll over the results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets next link to scroll over the results. + * + * @param nextLink the nextLink value to set. + * @return the AzureDevOpsProjectListResponse object itself. + */ + public AzureDevOpsProjectListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectProperties.java new file mode 100644 index 000000000000..9be663f78317 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectProperties.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Azure DevOps Project properties. */ +@Fluent +public final class AzureDevOpsProjectProperties { + /* + * Gets or sets resource status message. + */ + @JsonProperty(value = "provisioningStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningStatusMessage; + + /* + * Gets or sets time when resource was last checked. + */ + @JsonProperty(value = "provisioningStatusUpdateTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime provisioningStatusUpdateTimeUtc; + + /* + * The provisioning state of the resource. + * + * Pending - Provisioning pending. + * Failed - Provisioning failed. + * Succeeded - Successful provisioning. + * Canceled - Provisioning canceled. + * PendingDeletion - Deletion pending. + * DeletionSuccess - Deletion successful. + * DeletionFailure - Deletion failure. + */ + @JsonProperty(value = "provisioningState") + private DevOpsProvisioningState provisioningState; + + /* + * Gets or sets parent Azure DevOps Organization name. + */ + @JsonProperty(value = "parentOrgName") + private String parentOrgName; + + /* + * Gets or sets Azure DevOps Project id. + */ + @JsonProperty(value = "projectId", access = JsonProperty.Access.WRITE_ONLY) + private String projectId; + + /* + * Details about resource onboarding status across all connectors. + * + * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only + * applicable to top-level resources. + * Onboarded - this resource has already been onboarded by the specified connector. + * NotOnboarded - this resource has not been onboarded to any connector. + * NotApplicable - the onboarding state is not applicable to the current endpoint. + */ + @JsonProperty(value = "onboardingState") + private OnboardingState onboardingState; + + /* + * Configuration payload for PR Annotations. + */ + @JsonProperty(value = "actionableRemediation") + private ActionableRemediation actionableRemediation; + + /** Creates an instance of AzureDevOpsProjectProperties class. */ + public AzureDevOpsProjectProperties() { + } + + /** + * Get the provisioningStatusMessage property: Gets or sets resource status message. + * + * @return the provisioningStatusMessage value. + */ + public String provisioningStatusMessage() { + return this.provisioningStatusMessage; + } + + /** + * Get the provisioningStatusUpdateTimeUtc property: Gets or sets time when resource was last checked. + * + * @return the provisioningStatusUpdateTimeUtc value. + */ + public OffsetDateTime provisioningStatusUpdateTimeUtc() { + return this.provisioningStatusUpdateTimeUtc; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + *

Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - + * Provisioning canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion successful. DeletionFailure + * - Deletion failure. + * + * @return the provisioningState value. + */ + public DevOpsProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioning state of the resource. + * + *

Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - + * Provisioning canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion successful. DeletionFailure + * - Deletion failure. + * + * @param provisioningState the provisioningState value to set. + * @return the AzureDevOpsProjectProperties object itself. + */ + public AzureDevOpsProjectProperties withProvisioningState(DevOpsProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the parentOrgName property: Gets or sets parent Azure DevOps Organization name. + * + * @return the parentOrgName value. + */ + public String parentOrgName() { + return this.parentOrgName; + } + + /** + * Set the parentOrgName property: Gets or sets parent Azure DevOps Organization name. + * + * @param parentOrgName the parentOrgName value to set. + * @return the AzureDevOpsProjectProperties object itself. + */ + public AzureDevOpsProjectProperties withParentOrgName(String parentOrgName) { + this.parentOrgName = parentOrgName; + return this; + } + + /** + * Get the projectId property: Gets or sets Azure DevOps Project id. + * + * @return the projectId value. + */ + public String projectId() { + return this.projectId; + } + + /** + * Get the onboardingState property: Details about resource onboarding status across all connectors. + * + *

OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only + * applicable to top-level resources. Onboarded - this resource has already been onboarded by the specified + * connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + * state is not applicable to the current endpoint. + * + * @return the onboardingState value. + */ + public OnboardingState onboardingState() { + return this.onboardingState; + } + + /** + * Set the onboardingState property: Details about resource onboarding status across all connectors. + * + *

OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only + * applicable to top-level resources. Onboarded - this resource has already been onboarded by the specified + * connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + * state is not applicable to the current endpoint. + * + * @param onboardingState the onboardingState value to set. + * @return the AzureDevOpsProjectProperties object itself. + */ + public AzureDevOpsProjectProperties withOnboardingState(OnboardingState onboardingState) { + this.onboardingState = onboardingState; + return this; + } + + /** + * Get the actionableRemediation property: Configuration payload for PR Annotations. + * + * @return the actionableRemediation value. + */ + public ActionableRemediation actionableRemediation() { + return this.actionableRemediation; + } + + /** + * Set the actionableRemediation property: Configuration payload for PR Annotations. + * + * @param actionableRemediation the actionableRemediation value to set. + * @return the AzureDevOpsProjectProperties object itself. + */ + public AzureDevOpsProjectProperties withActionableRemediation(ActionableRemediation actionableRemediation) { + this.actionableRemediation = actionableRemediation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (actionableRemediation() != null) { + actionableRemediation().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjects.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjects.java new file mode 100644 index 000000000000..7ee660532fee --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjects.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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 AzureDevOpsProjects. */ +public interface AzureDevOpsProjects { + /** + * Returns a list of Azure DevOps projects onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String securityConnectorName, String orgName); + + /** + * Returns a list of Azure DevOps projects onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String securityConnectorName, String orgName, Context context); + + /** + * Returns a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String securityConnectorName, String orgName, String projectName, Context context); + + /** + * Returns a monitored Azure DevOps project resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Project resource. + */ + AzureDevOpsProject get(String resourceGroupName, String securityConnectorName, String orgName, String projectName); + + /** + * Returns a monitored Azure DevOps project resource. + * + * @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 azure DevOps Project resource along with {@link Response}. + */ + AzureDevOpsProject getById(String id); + + /** + * Returns a monitored Azure DevOps project resource. + * + * @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 azure DevOps Project resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AzureDevOpsProject resource. + * + * @param name resource name. + * @return the first stage of the new AzureDevOpsProject definition. + */ + AzureDevOpsProject.DefinitionStages.Blank define(String name); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepos.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepos.java new file mode 100644 index 000000000000..d207e0b84e86 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepos.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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 AzureDevOpsRepos. */ +public interface AzureDevOpsRepos { + /** + * Returns a list of Azure DevOps repositories onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String securityConnectorName, String orgName, String projectName); + + /** + * Returns a list of Azure DevOps repositories onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String securityConnectorName, String orgName, String projectName, Context context); + + /** + * Returns a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String securityConnectorName, + String orgName, + String projectName, + String repoName, + Context context); + + /** + * Returns a monitored Azure DevOps repository resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure DevOps Repository resource. + */ + AzureDevOpsRepository get( + String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName); + + /** + * Returns a monitored Azure DevOps repository resource. + * + * @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 azure DevOps Repository resource along with {@link Response}. + */ + AzureDevOpsRepository getById(String id); + + /** + * Returns a monitored Azure DevOps repository resource. + * + * @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 azure DevOps Repository resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AzureDevOpsRepository resource. + * + * @param name resource name. + * @return the first stage of the new AzureDevOpsRepository definition. + */ + AzureDevOpsRepository.DefinitionStages.Blank define(String name); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepository.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepository.java new file mode 100644 index 000000000000..e51a7d6e5adc --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepository.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner; + +/** An immutable client-side representation of AzureDevOpsRepository. */ +public interface AzureDevOpsRepository { + /** + * 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the properties property: Azure DevOps Repository properties. + * + * @return the properties value. + */ + AzureDevOpsRepositoryProperties properties(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner object. + * + * @return the inner object. + */ + AzureDevOpsRepositoryInner innerModel(); + + /** The entirety of the AzureDevOpsRepository definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The AzureDevOpsRepository definition stages. */ + interface DefinitionStages { + /** The first stage of the AzureDevOpsRepository definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the AzureDevOpsRepository definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, securityConnectorName, orgName, projectName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param orgName The Azure DevOps organization name. + * @param projectName The project name. + * @return the next definition stage. + */ + WithCreate withExistingProject( + String resourceGroupName, String securityConnectorName, String orgName, String projectName); + } + + /** + * The stage of the AzureDevOpsRepository 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. + */ + AzureDevOpsRepository create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AzureDevOpsRepository create(Context context); + } + + /** The stage of the AzureDevOpsRepository definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Azure DevOps Repository properties.. + * + * @param properties Azure DevOps Repository properties. + * @return the next definition stage. + */ + WithCreate withProperties(AzureDevOpsRepositoryProperties properties); + } + } + + /** + * Begins update for the AzureDevOpsRepository resource. + * + * @return the stage of resource update. + */ + AzureDevOpsRepository.Update update(); + + /** The template for AzureDevOpsRepository update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AzureDevOpsRepository apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AzureDevOpsRepository apply(Context context); + } + + /** The AzureDevOpsRepository update stages. */ + interface UpdateStages { + /** The stage of the AzureDevOpsRepository update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Azure DevOps Repository properties.. + * + * @param properties Azure DevOps Repository properties. + * @return the next definition stage. + */ + Update withProperties(AzureDevOpsRepositoryProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AzureDevOpsRepository refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AzureDevOpsRepository refresh(Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryListResponse.java new file mode 100644 index 000000000000..7e14ff131f4e --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryListResponse.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of RP resources which supports pagination. */ +@Fluent +public final class AzureDevOpsRepositoryListResponse { + /* + * Gets or sets list of resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets next link to scroll over the results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of AzureDevOpsRepositoryListResponse class. */ + public AzureDevOpsRepositoryListResponse() { + } + + /** + * Get the value property: Gets or sets list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets list of resources. + * + * @param value the value value to set. + * @return the AzureDevOpsRepositoryListResponse object itself. + */ + public AzureDevOpsRepositoryListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets next link to scroll over the results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets next link to scroll over the results. + * + * @param nextLink the nextLink value to set. + * @return the AzureDevOpsRepositoryListResponse object itself. + */ + public AzureDevOpsRepositoryListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryProperties.java new file mode 100644 index 000000000000..37f561164d7c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryProperties.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Azure DevOps Repository properties. */ +@Fluent +public final class AzureDevOpsRepositoryProperties { + /* + * Gets or sets resource status message. + */ + @JsonProperty(value = "provisioningStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningStatusMessage; + + /* + * Gets or sets time when resource was last checked. + */ + @JsonProperty(value = "provisioningStatusUpdateTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime provisioningStatusUpdateTimeUtc; + + /* + * The provisioning state of the resource. + * + * Pending - Provisioning pending. + * Failed - Provisioning failed. + * Succeeded - Successful provisioning. + * Canceled - Provisioning canceled. + * PendingDeletion - Deletion pending. + * DeletionSuccess - Deletion successful. + * DeletionFailure - Deletion failure. + */ + @JsonProperty(value = "provisioningState") + private DevOpsProvisioningState provisioningState; + + /* + * Gets or sets parent Azure DevOps Organization name. + */ + @JsonProperty(value = "parentOrgName") + private String parentOrgName; + + /* + * Gets or sets parent Azure DevOps Project name. + */ + @JsonProperty(value = "parentProjectName") + private String parentProjectName; + + /* + * Gets or sets Azure DevOps Repository id. + */ + @JsonProperty(value = "repoId", access = JsonProperty.Access.WRITE_ONLY) + private String repoId; + + /* + * Gets or sets Azure DevOps Repository url. + */ + @JsonProperty(value = "repoUrl", access = JsonProperty.Access.WRITE_ONLY) + private String repoUrl; + + /* + * Gets or sets Azure DevOps repository visibility, whether it is public or private etc. + */ + @JsonProperty(value = "visibility", access = JsonProperty.Access.WRITE_ONLY) + private String visibility; + + /* + * Details about resource onboarding status across all connectors. + * + * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only + * applicable to top-level resources. + * Onboarded - this resource has already been onboarded by the specified connector. + * NotOnboarded - this resource has not been onboarded to any connector. + * NotApplicable - the onboarding state is not applicable to the current endpoint. + */ + @JsonProperty(value = "onboardingState") + private OnboardingState onboardingState; + + /* + * Configuration payload for PR Annotations. + */ + @JsonProperty(value = "actionableRemediation") + private ActionableRemediation actionableRemediation; + + /** Creates an instance of AzureDevOpsRepositoryProperties class. */ + public AzureDevOpsRepositoryProperties() { + } + + /** + * Get the provisioningStatusMessage property: Gets or sets resource status message. + * + * @return the provisioningStatusMessage value. + */ + public String provisioningStatusMessage() { + return this.provisioningStatusMessage; + } + + /** + * Get the provisioningStatusUpdateTimeUtc property: Gets or sets time when resource was last checked. + * + * @return the provisioningStatusUpdateTimeUtc value. + */ + public OffsetDateTime provisioningStatusUpdateTimeUtc() { + return this.provisioningStatusUpdateTimeUtc; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + *

Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - + * Provisioning canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion successful. DeletionFailure + * - Deletion failure. + * + * @return the provisioningState value. + */ + public DevOpsProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioning state of the resource. + * + *

Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - + * Provisioning canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion successful. DeletionFailure + * - Deletion failure. + * + * @param provisioningState the provisioningState value to set. + * @return the AzureDevOpsRepositoryProperties object itself. + */ + public AzureDevOpsRepositoryProperties withProvisioningState(DevOpsProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the parentOrgName property: Gets or sets parent Azure DevOps Organization name. + * + * @return the parentOrgName value. + */ + public String parentOrgName() { + return this.parentOrgName; + } + + /** + * Set the parentOrgName property: Gets or sets parent Azure DevOps Organization name. + * + * @param parentOrgName the parentOrgName value to set. + * @return the AzureDevOpsRepositoryProperties object itself. + */ + public AzureDevOpsRepositoryProperties withParentOrgName(String parentOrgName) { + this.parentOrgName = parentOrgName; + return this; + } + + /** + * Get the parentProjectName property: Gets or sets parent Azure DevOps Project name. + * + * @return the parentProjectName value. + */ + public String parentProjectName() { + return this.parentProjectName; + } + + /** + * Set the parentProjectName property: Gets or sets parent Azure DevOps Project name. + * + * @param parentProjectName the parentProjectName value to set. + * @return the AzureDevOpsRepositoryProperties object itself. + */ + public AzureDevOpsRepositoryProperties withParentProjectName(String parentProjectName) { + this.parentProjectName = parentProjectName; + return this; + } + + /** + * Get the repoId property: Gets or sets Azure DevOps Repository id. + * + * @return the repoId value. + */ + public String repoId() { + return this.repoId; + } + + /** + * Get the repoUrl property: Gets or sets Azure DevOps Repository url. + * + * @return the repoUrl value. + */ + public String repoUrl() { + return this.repoUrl; + } + + /** + * Get the visibility property: Gets or sets Azure DevOps repository visibility, whether it is public or private + * etc. + * + * @return the visibility value. + */ + public String visibility() { + return this.visibility; + } + + /** + * Get the onboardingState property: Details about resource onboarding status across all connectors. + * + *

OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only + * applicable to top-level resources. Onboarded - this resource has already been onboarded by the specified + * connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + * state is not applicable to the current endpoint. + * + * @return the onboardingState value. + */ + public OnboardingState onboardingState() { + return this.onboardingState; + } + + /** + * Set the onboardingState property: Details about resource onboarding status across all connectors. + * + *

OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only + * applicable to top-level resources. Onboarded - this resource has already been onboarded by the specified + * connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + * state is not applicable to the current endpoint. + * + * @param onboardingState the onboardingState value to set. + * @return the AzureDevOpsRepositoryProperties object itself. + */ + public AzureDevOpsRepositoryProperties withOnboardingState(OnboardingState onboardingState) { + this.onboardingState = onboardingState; + return this; + } + + /** + * Get the actionableRemediation property: Configuration payload for PR Annotations. + * + * @return the actionableRemediation value. + */ + public ActionableRemediation actionableRemediation() { + return this.actionableRemediation; + } + + /** + * Set the actionableRemediation property: Configuration payload for PR Annotations. + * + * @param actionableRemediation the actionableRemediation value to set. + * @return the AzureDevOpsRepositoryProperties object itself. + */ + public AzureDevOpsRepositoryProperties withActionableRemediation(ActionableRemediation actionableRemediation) { + this.actionableRemediation = actionableRemediation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (actionableRemediation() != null) { + actionableRemediation().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureServersSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureServersSetting.java new file mode 100644 index 000000000000..9ed8800df2cc --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureServersSetting.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsAzureSettingProperties; +import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsSettingInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** A vulnerability assessments setting on Azure servers in the defined scope. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AzureServersSetting") +@Fluent +public final class AzureServersSetting extends ServerVulnerabilityAssessmentsSettingInner { + /* + * The vulnerability assessments setting properties on Azure servers in the defined scope. + */ + @JsonProperty(value = "properties") + private ServerVulnerabilityAssessmentsAzureSettingProperties innerProperties; + + /** Creates an instance of AzureServersSetting class. */ + public AzureServersSetting() { + } + + /** + * Get the innerProperties property: The vulnerability assessments setting properties on Azure servers in the + * defined scope. + * + * @return the innerProperties value. + */ + private ServerVulnerabilityAssessmentsAzureSettingProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the selectedProvider property: The selected vulnerability assessments provider on Azure servers in the + * defined scope. + * + * @return the selectedProvider value. + */ + public ServerVulnerabilityAssessmentsAzureSettingSelectedProvider selectedProvider() { + return this.innerProperties() == null ? null : this.innerProperties().selectedProvider(); + } + + /** + * Set the selectedProvider property: The selected vulnerability assessments provider on Azure servers in the + * defined scope. + * + * @param selectedProvider the selectedProvider value to set. + * @return the AzureServersSetting object itself. + */ + public AzureServersSetting withSelectedProvider( + ServerVulnerabilityAssessmentsAzureSettingSelectedProvider selectedProvider) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerVulnerabilityAssessmentsAzureSettingProperties(); + } + this.innerProperties().withSelectedProvider(selectedProvider); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BuiltInInfoType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BuiltInInfoType.java new file mode 100644 index 000000000000..bf091ee53058 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BuiltInInfoType.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** Pre-configured sensitive information type. */ +@Fluent +public final class BuiltInInfoType { + /* + * Display name of the info type + */ + @JsonProperty(value = "name") + private String name; + + /* + * Id of the info type + */ + @JsonProperty(value = "id") + private UUID id; + + /* + * Category of the built-in info type + */ + @JsonProperty(value = "type") + private String type; + + /** Creates an instance of BuiltInInfoType class. */ + public BuiltInInfoType() { + } + + /** + * Get the name property: Display name of the info type. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Display name of the info type. + * + * @param name the name value to set. + * @return the BuiltInInfoType object itself. + */ + public BuiltInInfoType withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: Id of the info type. + * + * @return the id value. + */ + public UUID id() { + return this.id; + } + + /** + * Set the id property: Id of the info type. + * + * @param id the id value to set. + * @return the BuiltInInfoType object itself. + */ + public BuiltInInfoType withId(UUID id) { + this.id = id; + return this; + } + + /** + * Get the type property: Category of the built-in info type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Category of the built-in info type. + * + * @param type the type value to set. + * @return the BuiltInInfoType object itself. + */ + public BuiltInInfoType withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CategoryConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CategoryConfiguration.java new file mode 100644 index 000000000000..51358aab65c3 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CategoryConfiguration.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Severity level per category configuration for PR Annotations. */ +@Fluent +public final class CategoryConfiguration { + /* + * Gets or sets minimum severity level for a given category. + */ + @JsonProperty(value = "minimumSeverityLevel") + private String minimumSeverityLevel; + + /* + * Rule categories. + * Code - code scanning results. + * Artifact scanning results. + * Dependencies scanning results. + * IaC results. + * Secrets scanning results. + * Container scanning results. + */ + @JsonProperty(value = "category") + private RuleCategory category; + + /** Creates an instance of CategoryConfiguration class. */ + public CategoryConfiguration() { + } + + /** + * Get the minimumSeverityLevel property: Gets or sets minimum severity level for a given category. + * + * @return the minimumSeverityLevel value. + */ + public String minimumSeverityLevel() { + return this.minimumSeverityLevel; + } + + /** + * Set the minimumSeverityLevel property: Gets or sets minimum severity level for a given category. + * + * @param minimumSeverityLevel the minimumSeverityLevel value to set. + * @return the CategoryConfiguration object itself. + */ + public CategoryConfiguration withMinimumSeverityLevel(String minimumSeverityLevel) { + this.minimumSeverityLevel = minimumSeverityLevel; + return this; + } + + /** + * Get the category property: Rule categories. Code - code scanning results. Artifact scanning results. Dependencies + * scanning results. IaC results. Secrets scanning results. Container scanning results. + * + * @return the category value. + */ + public RuleCategory category() { + return this.category; + } + + /** + * Set the category property: Rule categories. Code - code scanning results. Artifact scanning results. Dependencies + * scanning results. IaC results. Secrets scanning results. Container scanning results. + * + * @param category the category value to set. + * @return the CategoryConfiguration object itself. + */ + public CategoryConfiguration withCategory(RuleCategory category) { + this.category = category; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionStrings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionStrings.java deleted file mode 100644 index c5da6b30ddaf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionStrings.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.ConnectionStringsInner; -import java.util.List; - -/** An immutable client-side representation of ConnectionStrings. */ -public interface ConnectionStrings { - /** - * Gets the value property: Connection strings. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ConnectionStringsInner object. - * - * @return the inner object. - */ - ConnectionStringsInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSetting.java index 5a13750d1686..5cfc98b426d3 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSetting.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSetting.java @@ -56,11 +56,13 @@ public interface ConnectorSetting { /** The entirety of the ConnectorSetting definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { } + /** The ConnectorSetting definition stages. */ interface DefinitionStages { /** The first stage of the ConnectorSetting definition. */ interface Blank extends WithCreate { } + /** * The stage of the ConnectorSetting 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. @@ -82,6 +84,7 @@ interface WithCreate */ ConnectorSetting create(Context context); } + /** The stage of the ConnectorSetting definition allowing to specify hybridComputeSettings. */ interface WithHybridComputeSettings { /** @@ -94,6 +97,7 @@ interface WithHybridComputeSettings { */ WithCreate withHybridComputeSettings(HybridComputeSettingsProperties hybridComputeSettings); } + /** The stage of the ConnectorSetting definition allowing to specify authenticationDetails. */ interface WithAuthenticationDetails { /** @@ -107,6 +111,7 @@ interface WithAuthenticationDetails { WithCreate withAuthenticationDetails(AuthenticationDetailsProperties authenticationDetails); } } + /** * Begins update for the ConnectorSetting resource. * @@ -131,6 +136,7 @@ interface Update extends UpdateStages.WithHybridComputeSettings, UpdateStages.Wi */ ConnectorSetting apply(Context context); } + /** The ConnectorSetting update stages. */ interface UpdateStages { /** The stage of the ConnectorSetting update allowing to specify hybridComputeSettings. */ @@ -145,6 +151,7 @@ interface WithHybridComputeSettings { */ Update withHybridComputeSettings(HybridComputeSettingsProperties hybridComputeSettings); } + /** The stage of the ConnectorSetting update allowing to specify authenticationDetails. */ interface WithAuthenticationDetails { /** @@ -158,6 +165,7 @@ interface WithAuthenticationDetails { Update withAuthenticationDetails(AuthenticationDetailsProperties authenticationDetails); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomation.java index 59ff105ba2b4..36ed863e545c 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomation.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomation.java @@ -102,11 +102,13 @@ public interface CustomAssessmentAutomation { interface Definition extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } + /** The CustomAssessmentAutomation definition stages. */ interface DefinitionStages { /** The first stage of the CustomAssessmentAutomation definition. */ interface Blank extends WithResourceGroup { } + /** The stage of the CustomAssessmentAutomation definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -118,6 +120,7 @@ interface WithResourceGroup { */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the CustomAssessmentAutomation 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. @@ -144,6 +147,7 @@ interface WithCreate */ CustomAssessmentAutomation create(Context context); } + /** The stage of the CustomAssessmentAutomation definition allowing to specify compressedQuery. */ interface WithCompressedQuery { /** @@ -155,6 +159,7 @@ interface WithCompressedQuery { */ WithCreate withCompressedQuery(String compressedQuery); } + /** The stage of the CustomAssessmentAutomation definition allowing to specify supportedCloud. */ interface WithSupportedCloud { /** @@ -165,6 +170,7 @@ interface WithSupportedCloud { */ WithCreate withSupportedCloud(SupportedCloudEnum supportedCloud); } + /** The stage of the CustomAssessmentAutomation definition allowing to specify severity. */ interface WithSeverity { /** @@ -176,6 +182,7 @@ interface WithSeverity { */ WithCreate withSeverity(SeverityEnum severity); } + /** The stage of the CustomAssessmentAutomation definition allowing to specify displayName. */ interface WithDisplayName { /** @@ -187,6 +194,7 @@ interface WithDisplayName { */ WithCreate withDisplayName(String displayName); } + /** The stage of the CustomAssessmentAutomation definition allowing to specify description. */ interface WithDescription { /** @@ -198,6 +206,7 @@ interface WithDescription { */ WithCreate withDescription(String description); } + /** The stage of the CustomAssessmentAutomation definition allowing to specify remediationDescription. */ interface WithRemediationDescription { /** @@ -211,6 +220,7 @@ interface WithRemediationDescription { WithCreate withRemediationDescription(String remediationDescription); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignment.java index fcdf9e4547fe..cabc608573b2 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignment.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignment.java @@ -64,11 +64,13 @@ public interface CustomEntityStoreAssignment { interface Definition extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } + /** The CustomEntityStoreAssignment definition stages. */ interface DefinitionStages { /** The first stage of the CustomEntityStoreAssignment definition. */ interface Blank extends WithResourceGroup { } + /** The stage of the CustomEntityStoreAssignment definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -80,6 +82,7 @@ interface WithResourceGroup { */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the CustomEntityStoreAssignment 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. @@ -100,6 +103,7 @@ interface WithCreate extends DefinitionStages.WithPrincipal { */ CustomEntityStoreAssignment create(Context context); } + /** The stage of the CustomEntityStoreAssignment definition allowing to specify principal. */ interface WithPrincipal { /** @@ -113,6 +117,7 @@ interface WithPrincipal { WithCreate withPrincipal(String principal); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOffering.java index 0d4bb91cd0c7..57ca5767cbb5 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOffering.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOffering.java @@ -32,6 +32,24 @@ public final class DefenderCspmAwsOffering extends CloudOffering { @JsonProperty(value = "databasesDspm") private DefenderCspmAwsOfferingDatabasesDspm databasesDspm; + /* + * Defenders CSPM Cloud infrastructure entitlement management (CIEM) offering configurations + */ + @JsonProperty(value = "ciem") + private DefenderCspmAwsOfferingCiem ciem; + + /* + * The Microsoft Defender container image assessment configuration + */ + @JsonProperty(value = "mdcContainersImageAssessment") + private DefenderCspmAwsOfferingMdcContainersImageAssessment mdcContainersImageAssessment; + + /* + * The Microsoft Defender container agentless discovery K8s configuration + */ + @JsonProperty(value = "mdcContainersAgentlessDiscoveryK8s") + private DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S; + /** Creates an instance of DefenderCspmAwsOffering class. */ public DefenderCspmAwsOffering() { } @@ -97,6 +115,70 @@ public DefenderCspmAwsOffering withDatabasesDspm(DefenderCspmAwsOfferingDatabase return this; } + /** + * Get the ciem property: Defenders CSPM Cloud infrastructure entitlement management (CIEM) offering configurations. + * + * @return the ciem value. + */ + public DefenderCspmAwsOfferingCiem ciem() { + return this.ciem; + } + + /** + * Set the ciem property: Defenders CSPM Cloud infrastructure entitlement management (CIEM) offering configurations. + * + * @param ciem the ciem value to set. + * @return the DefenderCspmAwsOffering object itself. + */ + public DefenderCspmAwsOffering withCiem(DefenderCspmAwsOfferingCiem ciem) { + this.ciem = ciem; + return this; + } + + /** + * Get the mdcContainersImageAssessment property: The Microsoft Defender container image assessment configuration. + * + * @return the mdcContainersImageAssessment value. + */ + public DefenderCspmAwsOfferingMdcContainersImageAssessment mdcContainersImageAssessment() { + return this.mdcContainersImageAssessment; + } + + /** + * Set the mdcContainersImageAssessment property: The Microsoft Defender container image assessment configuration. + * + * @param mdcContainersImageAssessment the mdcContainersImageAssessment value to set. + * @return the DefenderCspmAwsOffering object itself. + */ + public DefenderCspmAwsOffering withMdcContainersImageAssessment( + DefenderCspmAwsOfferingMdcContainersImageAssessment mdcContainersImageAssessment) { + this.mdcContainersImageAssessment = mdcContainersImageAssessment; + return this; + } + + /** + * Get the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender container agentless discovery K8s + * configuration. + * + * @return the mdcContainersAgentlessDiscoveryK8S value. + */ + public DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S() { + return this.mdcContainersAgentlessDiscoveryK8S; + } + + /** + * Set the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender container agentless discovery K8s + * configuration. + * + * @param mdcContainersAgentlessDiscoveryK8S the mdcContainersAgentlessDiscoveryK8S value to set. + * @return the DefenderCspmAwsOffering object itself. + */ + public DefenderCspmAwsOffering withMdcContainersAgentlessDiscoveryK8S( + DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S) { + this.mdcContainersAgentlessDiscoveryK8S = mdcContainersAgentlessDiscoveryK8S; + return this; + } + /** * Validates the instance. * @@ -114,5 +196,14 @@ public void validate() { if (databasesDspm() != null) { databasesDspm().validate(); } + if (ciem() != null) { + ciem().validate(); + } + if (mdcContainersImageAssessment() != null) { + mdcContainersImageAssessment().validate(); + } + if (mdcContainersAgentlessDiscoveryK8S() != null) { + mdcContainersAgentlessDiscoveryK8S().validate(); + } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiem.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiem.java new file mode 100644 index 000000000000..eb00a5a8f67f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiem.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defenders CSPM Cloud infrastructure entitlement management (CIEM) offering configurations. */ +@Fluent +public final class DefenderCspmAwsOfferingCiem { + /* + * Defender CSPM CIEM discovery configuration + */ + @JsonProperty(value = "ciemDiscovery") + private DefenderCspmAwsOfferingCiemDiscovery ciemDiscovery; + + /* + * Defender CSPM CIEM AWS OIDC (open id connect) configuration + */ + @JsonProperty(value = "ciemOidc") + private DefenderCspmAwsOfferingCiemOidc ciemOidc; + + /** Creates an instance of DefenderCspmAwsOfferingCiem class. */ + public DefenderCspmAwsOfferingCiem() { + } + + /** + * Get the ciemDiscovery property: Defender CSPM CIEM discovery configuration. + * + * @return the ciemDiscovery value. + */ + public DefenderCspmAwsOfferingCiemDiscovery ciemDiscovery() { + return this.ciemDiscovery; + } + + /** + * Set the ciemDiscovery property: Defender CSPM CIEM discovery configuration. + * + * @param ciemDiscovery the ciemDiscovery value to set. + * @return the DefenderCspmAwsOfferingCiem object itself. + */ + public DefenderCspmAwsOfferingCiem withCiemDiscovery(DefenderCspmAwsOfferingCiemDiscovery ciemDiscovery) { + this.ciemDiscovery = ciemDiscovery; + return this; + } + + /** + * Get the ciemOidc property: Defender CSPM CIEM AWS OIDC (open id connect) configuration. + * + * @return the ciemOidc value. + */ + public DefenderCspmAwsOfferingCiemOidc ciemOidc() { + return this.ciemOidc; + } + + /** + * Set the ciemOidc property: Defender CSPM CIEM AWS OIDC (open id connect) configuration. + * + * @param ciemOidc the ciemOidc value to set. + * @return the DefenderCspmAwsOfferingCiem object itself. + */ + public DefenderCspmAwsOfferingCiem withCiemOidc(DefenderCspmAwsOfferingCiemOidc ciemOidc) { + this.ciemOidc = ciemOidc; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ciemDiscovery() != null) { + ciemDiscovery().validate(); + } + if (ciemOidc() != null) { + ciemOidc().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemDiscovery.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemDiscovery.java new file mode 100644 index 000000000000..5f05cae02e91 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemDiscovery.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defender CSPM CIEM discovery configuration. */ +@Fluent +public final class DefenderCspmAwsOfferingCiemDiscovery { + /* + * The cloud role ARN in AWS for CIEM discovery + */ + @JsonProperty(value = "cloudRoleArn") + private String cloudRoleArn; + + /** Creates an instance of DefenderCspmAwsOfferingCiemDiscovery class. */ + public DefenderCspmAwsOfferingCiemDiscovery() { + } + + /** + * Get the cloudRoleArn property: The cloud role ARN in AWS for CIEM discovery. + * + * @return the cloudRoleArn value. + */ + public String cloudRoleArn() { + return this.cloudRoleArn; + } + + /** + * Set the cloudRoleArn property: The cloud role ARN in AWS for CIEM discovery. + * + * @param cloudRoleArn the cloudRoleArn value to set. + * @return the DefenderCspmAwsOfferingCiemDiscovery object itself. + */ + public DefenderCspmAwsOfferingCiemDiscovery withCloudRoleArn(String cloudRoleArn) { + this.cloudRoleArn = cloudRoleArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemOidc.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemOidc.java new file mode 100644 index 000000000000..a281ec77fb28 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemOidc.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defender CSPM CIEM AWS OIDC (open id connect) configuration. */ +@Fluent +public final class DefenderCspmAwsOfferingCiemOidc { + /* + * The cloud role ARN in AWS for CIEM oidc connection + */ + @JsonProperty(value = "cloudRoleArn") + private String cloudRoleArn; + + /* + * the azure active directory app name used of authenticating against AWS + */ + @JsonProperty(value = "azureActiveDirectoryAppName") + private String azureActiveDirectoryAppName; + + /** Creates an instance of DefenderCspmAwsOfferingCiemOidc class. */ + public DefenderCspmAwsOfferingCiemOidc() { + } + + /** + * Get the cloudRoleArn property: The cloud role ARN in AWS for CIEM oidc connection. + * + * @return the cloudRoleArn value. + */ + public String cloudRoleArn() { + return this.cloudRoleArn; + } + + /** + * Set the cloudRoleArn property: The cloud role ARN in AWS for CIEM oidc connection. + * + * @param cloudRoleArn the cloudRoleArn value to set. + * @return the DefenderCspmAwsOfferingCiemOidc object itself. + */ + public DefenderCspmAwsOfferingCiemOidc withCloudRoleArn(String cloudRoleArn) { + this.cloudRoleArn = cloudRoleArn; + return this; + } + + /** + * Get the azureActiveDirectoryAppName property: the azure active directory app name used of authenticating against + * AWS. + * + * @return the azureActiveDirectoryAppName value. + */ + public String azureActiveDirectoryAppName() { + return this.azureActiveDirectoryAppName; + } + + /** + * Set the azureActiveDirectoryAppName property: the azure active directory app name used of authenticating against + * AWS. + * + * @param azureActiveDirectoryAppName the azureActiveDirectoryAppName value to set. + * @return the DefenderCspmAwsOfferingCiemOidc object itself. + */ + public DefenderCspmAwsOfferingCiemOidc withAzureActiveDirectoryAppName(String azureActiveDirectoryAppName) { + this.azureActiveDirectoryAppName = azureActiveDirectoryAppName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S.java new file mode 100644 index 000000000000..87a85462a412 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Microsoft Defender container agentless discovery K8s configuration. */ +@Fluent +public final class DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S { + /* + * Is Microsoft Defender container agentless discovery K8s enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The cloud role ARN in AWS for this feature + */ + @JsonProperty(value = "cloudRoleArn") + private String cloudRoleArn; + + /** Creates an instance of DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S class. */ + public DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S() { + } + + /** + * Get the enabled property: Is Microsoft Defender container agentless discovery K8s enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Is Microsoft Defender container agentless discovery K8s enabled. + * + * @param enabled the enabled value to set. + * @return the DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S object itself. + */ + public DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. + * + * @return the cloudRoleArn value. + */ + public String cloudRoleArn() { + return this.cloudRoleArn; + } + + /** + * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. + * + * @param cloudRoleArn the cloudRoleArn value to set. + * @return the DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S object itself. + */ + public DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S withCloudRoleArn(String cloudRoleArn) { + this.cloudRoleArn = cloudRoleArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersImageAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersImageAssessment.java new file mode 100644 index 000000000000..48477a5b2117 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersImageAssessment.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Microsoft Defender container image assessment configuration. */ +@Fluent +public final class DefenderCspmAwsOfferingMdcContainersImageAssessment { + /* + * Is Microsoft Defender container image assessment enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The cloud role ARN in AWS for this feature + */ + @JsonProperty(value = "cloudRoleArn") + private String cloudRoleArn; + + /** Creates an instance of DefenderCspmAwsOfferingMdcContainersImageAssessment class. */ + public DefenderCspmAwsOfferingMdcContainersImageAssessment() { + } + + /** + * Get the enabled property: Is Microsoft Defender container image assessment enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Is Microsoft Defender container image assessment enabled. + * + * @param enabled the enabled value to set. + * @return the DefenderCspmAwsOfferingMdcContainersImageAssessment object itself. + */ + public DefenderCspmAwsOfferingMdcContainersImageAssessment withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. + * + * @return the cloudRoleArn value. + */ + public String cloudRoleArn() { + return this.cloudRoleArn; + } + + /** + * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. + * + * @param cloudRoleArn the cloudRoleArn value to set. + * @return the DefenderCspmAwsOfferingMdcContainersImageAssessment object itself. + */ + public DefenderCspmAwsOfferingMdcContainersImageAssessment withCloudRoleArn(String cloudRoleArn) { + this.cloudRoleArn = cloudRoleArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOffering.java index cea6a0f8d95e..d288c4e284a0 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOffering.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOffering.java @@ -4,19 +4,157 @@ package com.azure.resourcemanager.security.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** The CSPM P1 for GCP offering. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") @JsonTypeName("DefenderCspmGcp") -@Immutable +@Fluent public final class DefenderCspmGcpOffering extends CloudOffering { + /* + * GCP Defenders CSPM Cloud infrastructure entitlement management (CIEM) discovery offering configurations + */ + @JsonProperty(value = "ciemDiscovery") + private DefenderCspmGcpOfferingCiemDiscovery ciemDiscovery; + + /* + * The Microsoft Defender for Server VM scanning configuration + */ + @JsonProperty(value = "vmScanners") + private DefenderCspmGcpOfferingVmScanners vmScanners; + + /* + * The Microsoft Defender Data Sensitivity discovery configuration + */ + @JsonProperty(value = "dataSensitivityDiscovery") + private DefenderCspmGcpOfferingDataSensitivityDiscovery dataSensitivityDiscovery; + + /* + * The Microsoft Defender Container image assessment configuration + */ + @JsonProperty(value = "mdcContainersImageAssessment") + private DefenderCspmGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment; + + /* + * The Microsoft Defender Container agentless discovery configuration + */ + @JsonProperty(value = "mdcContainersAgentlessDiscoveryK8s") + private DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S; + /** Creates an instance of DefenderCspmGcpOffering class. */ public DefenderCspmGcpOffering() { } + /** + * Get the ciemDiscovery property: GCP Defenders CSPM Cloud infrastructure entitlement management (CIEM) discovery + * offering configurations. + * + * @return the ciemDiscovery value. + */ + public DefenderCspmGcpOfferingCiemDiscovery ciemDiscovery() { + return this.ciemDiscovery; + } + + /** + * Set the ciemDiscovery property: GCP Defenders CSPM Cloud infrastructure entitlement management (CIEM) discovery + * offering configurations. + * + * @param ciemDiscovery the ciemDiscovery value to set. + * @return the DefenderCspmGcpOffering object itself. + */ + public DefenderCspmGcpOffering withCiemDiscovery(DefenderCspmGcpOfferingCiemDiscovery ciemDiscovery) { + this.ciemDiscovery = ciemDiscovery; + return this; + } + + /** + * Get the vmScanners property: The Microsoft Defender for Server VM scanning configuration. + * + * @return the vmScanners value. + */ + public DefenderCspmGcpOfferingVmScanners vmScanners() { + return this.vmScanners; + } + + /** + * Set the vmScanners property: The Microsoft Defender for Server VM scanning configuration. + * + * @param vmScanners the vmScanners value to set. + * @return the DefenderCspmGcpOffering object itself. + */ + public DefenderCspmGcpOffering withVmScanners(DefenderCspmGcpOfferingVmScanners vmScanners) { + this.vmScanners = vmScanners; + return this; + } + + /** + * Get the dataSensitivityDiscovery property: The Microsoft Defender Data Sensitivity discovery configuration. + * + * @return the dataSensitivityDiscovery value. + */ + public DefenderCspmGcpOfferingDataSensitivityDiscovery dataSensitivityDiscovery() { + return this.dataSensitivityDiscovery; + } + + /** + * Set the dataSensitivityDiscovery property: The Microsoft Defender Data Sensitivity discovery configuration. + * + * @param dataSensitivityDiscovery the dataSensitivityDiscovery value to set. + * @return the DefenderCspmGcpOffering object itself. + */ + public DefenderCspmGcpOffering withDataSensitivityDiscovery( + DefenderCspmGcpOfferingDataSensitivityDiscovery dataSensitivityDiscovery) { + this.dataSensitivityDiscovery = dataSensitivityDiscovery; + return this; + } + + /** + * Get the mdcContainersImageAssessment property: The Microsoft Defender Container image assessment configuration. + * + * @return the mdcContainersImageAssessment value. + */ + public DefenderCspmGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment() { + return this.mdcContainersImageAssessment; + } + + /** + * Set the mdcContainersImageAssessment property: The Microsoft Defender Container image assessment configuration. + * + * @param mdcContainersImageAssessment the mdcContainersImageAssessment value to set. + * @return the DefenderCspmGcpOffering object itself. + */ + public DefenderCspmGcpOffering withMdcContainersImageAssessment( + DefenderCspmGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment) { + this.mdcContainersImageAssessment = mdcContainersImageAssessment; + return this; + } + + /** + * Get the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender Container agentless discovery + * configuration. + * + * @return the mdcContainersAgentlessDiscoveryK8S value. + */ + public DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S() { + return this.mdcContainersAgentlessDiscoveryK8S; + } + + /** + * Set the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender Container agentless discovery + * configuration. + * + * @param mdcContainersAgentlessDiscoveryK8S the mdcContainersAgentlessDiscoveryK8S value to set. + * @return the DefenderCspmGcpOffering object itself. + */ + public DefenderCspmGcpOffering withMdcContainersAgentlessDiscoveryK8S( + DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S) { + this.mdcContainersAgentlessDiscoveryK8S = mdcContainersAgentlessDiscoveryK8S; + return this; + } + /** * Validates the instance. * @@ -25,5 +163,20 @@ public DefenderCspmGcpOffering() { @Override public void validate() { super.validate(); + if (ciemDiscovery() != null) { + ciemDiscovery().validate(); + } + if (vmScanners() != null) { + vmScanners().validate(); + } + if (dataSensitivityDiscovery() != null) { + dataSensitivityDiscovery().validate(); + } + if (mdcContainersImageAssessment() != null) { + mdcContainersImageAssessment().validate(); + } + if (mdcContainersAgentlessDiscoveryK8S() != null) { + mdcContainersAgentlessDiscoveryK8S().validate(); + } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingCiemDiscovery.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingCiemDiscovery.java new file mode 100644 index 000000000000..5f9d43f3314c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingCiemDiscovery.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** GCP Defenders CSPM Cloud infrastructure entitlement management (CIEM) discovery offering configurations. */ +@Fluent +public final class DefenderCspmGcpOfferingCiemDiscovery { + /* + * The GCP workload identity provider id for CIEM discovery offering + */ + @JsonProperty(value = "workloadIdentityProviderId") + private String workloadIdentityProviderId; + + /* + * The service account email address in GCP for CIEM discovery offering + */ + @JsonProperty(value = "serviceAccountEmailAddress") + private String serviceAccountEmailAddress; + + /* + * the azure active directory app name used of authenticating against GCP workload identity federation + */ + @JsonProperty(value = "azureActiveDirectoryAppName") + private String azureActiveDirectoryAppName; + + /** Creates an instance of DefenderCspmGcpOfferingCiemDiscovery class. */ + public DefenderCspmGcpOfferingCiemDiscovery() { + } + + /** + * Get the workloadIdentityProviderId property: The GCP workload identity provider id for CIEM discovery offering. + * + * @return the workloadIdentityProviderId value. + */ + public String workloadIdentityProviderId() { + return this.workloadIdentityProviderId; + } + + /** + * Set the workloadIdentityProviderId property: The GCP workload identity provider id for CIEM discovery offering. + * + * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. + * @return the DefenderCspmGcpOfferingCiemDiscovery object itself. + */ + public DefenderCspmGcpOfferingCiemDiscovery withWorkloadIdentityProviderId(String workloadIdentityProviderId) { + this.workloadIdentityProviderId = workloadIdentityProviderId; + return this; + } + + /** + * Get the serviceAccountEmailAddress property: The service account email address in GCP for CIEM discovery + * offering. + * + * @return the serviceAccountEmailAddress value. + */ + public String serviceAccountEmailAddress() { + return this.serviceAccountEmailAddress; + } + + /** + * Set the serviceAccountEmailAddress property: The service account email address in GCP for CIEM discovery + * offering. + * + * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. + * @return the DefenderCspmGcpOfferingCiemDiscovery object itself. + */ + public DefenderCspmGcpOfferingCiemDiscovery withServiceAccountEmailAddress(String serviceAccountEmailAddress) { + this.serviceAccountEmailAddress = serviceAccountEmailAddress; + return this; + } + + /** + * Get the azureActiveDirectoryAppName property: the azure active directory app name used of authenticating against + * GCP workload identity federation. + * + * @return the azureActiveDirectoryAppName value. + */ + public String azureActiveDirectoryAppName() { + return this.azureActiveDirectoryAppName; + } + + /** + * Set the azureActiveDirectoryAppName property: the azure active directory app name used of authenticating against + * GCP workload identity federation. + * + * @param azureActiveDirectoryAppName the azureActiveDirectoryAppName value to set. + * @return the DefenderCspmGcpOfferingCiemDiscovery object itself. + */ + public DefenderCspmGcpOfferingCiemDiscovery withAzureActiveDirectoryAppName(String azureActiveDirectoryAppName) { + this.azureActiveDirectoryAppName = azureActiveDirectoryAppName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingDataSensitivityDiscovery.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingDataSensitivityDiscovery.java new file mode 100644 index 000000000000..872e37006855 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingDataSensitivityDiscovery.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Microsoft Defender Data Sensitivity discovery configuration. */ +@Fluent +public final class DefenderCspmGcpOfferingDataSensitivityDiscovery { + /* + * Is Microsoft Defender Data Sensitivity discovery enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The workload identity provider id in GCP for this feature + */ + @JsonProperty(value = "workloadIdentityProviderId") + private String workloadIdentityProviderId; + + /* + * The service account email address in GCP for this feature + */ + @JsonProperty(value = "serviceAccountEmailAddress") + private String serviceAccountEmailAddress; + + /** Creates an instance of DefenderCspmGcpOfferingDataSensitivityDiscovery class. */ + public DefenderCspmGcpOfferingDataSensitivityDiscovery() { + } + + /** + * Get the enabled property: Is Microsoft Defender Data Sensitivity discovery enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Is Microsoft Defender Data Sensitivity discovery enabled. + * + * @param enabled the enabled value to set. + * @return the DefenderCspmGcpOfferingDataSensitivityDiscovery object itself. + */ + public DefenderCspmGcpOfferingDataSensitivityDiscovery withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. + * + * @return the workloadIdentityProviderId value. + */ + public String workloadIdentityProviderId() { + return this.workloadIdentityProviderId; + } + + /** + * Set the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. + * + * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. + * @return the DefenderCspmGcpOfferingDataSensitivityDiscovery object itself. + */ + public DefenderCspmGcpOfferingDataSensitivityDiscovery withWorkloadIdentityProviderId( + String workloadIdentityProviderId) { + this.workloadIdentityProviderId = workloadIdentityProviderId; + return this; + } + + /** + * Get the serviceAccountEmailAddress property: The service account email address in GCP for this feature. + * + * @return the serviceAccountEmailAddress value. + */ + public String serviceAccountEmailAddress() { + return this.serviceAccountEmailAddress; + } + + /** + * Set the serviceAccountEmailAddress property: The service account email address in GCP for this feature. + * + * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. + * @return the DefenderCspmGcpOfferingDataSensitivityDiscovery object itself. + */ + public DefenderCspmGcpOfferingDataSensitivityDiscovery withServiceAccountEmailAddress( + String serviceAccountEmailAddress) { + this.serviceAccountEmailAddress = serviceAccountEmailAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.java new file mode 100644 index 000000000000..1483704ff474 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Microsoft Defender Container agentless discovery configuration. */ +@Fluent +public final class DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S { + /* + * Is Microsoft Defender container agentless discovery enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The workload identity provider id in GCP for this feature + */ + @JsonProperty(value = "workloadIdentityProviderId") + private String workloadIdentityProviderId; + + /* + * The service account email address in GCP for this feature + */ + @JsonProperty(value = "serviceAccountEmailAddress") + private String serviceAccountEmailAddress; + + /** Creates an instance of DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S class. */ + public DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S() { + } + + /** + * Get the enabled property: Is Microsoft Defender container agentless discovery enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Is Microsoft Defender container agentless discovery enabled. + * + * @param enabled the enabled value to set. + * @return the DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S object itself. + */ + public DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. + * + * @return the workloadIdentityProviderId value. + */ + public String workloadIdentityProviderId() { + return this.workloadIdentityProviderId; + } + + /** + * Set the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. + * + * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. + * @return the DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S object itself. + */ + public DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S withWorkloadIdentityProviderId( + String workloadIdentityProviderId) { + this.workloadIdentityProviderId = workloadIdentityProviderId; + return this; + } + + /** + * Get the serviceAccountEmailAddress property: The service account email address in GCP for this feature. + * + * @return the serviceAccountEmailAddress value. + */ + public String serviceAccountEmailAddress() { + return this.serviceAccountEmailAddress; + } + + /** + * Set the serviceAccountEmailAddress property: The service account email address in GCP for this feature. + * + * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. + * @return the DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S object itself. + */ + public DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S withServiceAccountEmailAddress( + String serviceAccountEmailAddress) { + this.serviceAccountEmailAddress = serviceAccountEmailAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersImageAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersImageAssessment.java new file mode 100644 index 000000000000..22a4ea98b454 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersImageAssessment.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Microsoft Defender Container image assessment configuration. */ +@Fluent +public final class DefenderCspmGcpOfferingMdcContainersImageAssessment { + /* + * Is Microsoft Defender container image assessment enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The workload identity provider id in GCP for this feature + */ + @JsonProperty(value = "workloadIdentityProviderId") + private String workloadIdentityProviderId; + + /* + * The service account email address in GCP for this feature + */ + @JsonProperty(value = "serviceAccountEmailAddress") + private String serviceAccountEmailAddress; + + /** Creates an instance of DefenderCspmGcpOfferingMdcContainersImageAssessment class. */ + public DefenderCspmGcpOfferingMdcContainersImageAssessment() { + } + + /** + * Get the enabled property: Is Microsoft Defender container image assessment enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Is Microsoft Defender container image assessment enabled. + * + * @param enabled the enabled value to set. + * @return the DefenderCspmGcpOfferingMdcContainersImageAssessment object itself. + */ + public DefenderCspmGcpOfferingMdcContainersImageAssessment withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. + * + * @return the workloadIdentityProviderId value. + */ + public String workloadIdentityProviderId() { + return this.workloadIdentityProviderId; + } + + /** + * Set the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. + * + * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. + * @return the DefenderCspmGcpOfferingMdcContainersImageAssessment object itself. + */ + public DefenderCspmGcpOfferingMdcContainersImageAssessment withWorkloadIdentityProviderId( + String workloadIdentityProviderId) { + this.workloadIdentityProviderId = workloadIdentityProviderId; + return this; + } + + /** + * Get the serviceAccountEmailAddress property: The service account email address in GCP for this feature. + * + * @return the serviceAccountEmailAddress value. + */ + public String serviceAccountEmailAddress() { + return this.serviceAccountEmailAddress; + } + + /** + * Set the serviceAccountEmailAddress property: The service account email address in GCP for this feature. + * + * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. + * @return the DefenderCspmGcpOfferingMdcContainersImageAssessment object itself. + */ + public DefenderCspmGcpOfferingMdcContainersImageAssessment withServiceAccountEmailAddress( + String serviceAccountEmailAddress) { + this.serviceAccountEmailAddress = serviceAccountEmailAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingVmScanners.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingVmScanners.java new file mode 100644 index 000000000000..f1ca4039daaf --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingVmScanners.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Microsoft Defender for Server VM scanning configuration. */ +@Fluent +public final class DefenderCspmGcpOfferingVmScanners { + /* + * Is Microsoft Defender for Server VM scanning enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * configuration for Microsoft Defender for Server VM scanning + */ + @JsonProperty(value = "configuration") + private DefenderCspmGcpOfferingVmScannersConfiguration configuration; + + /** Creates an instance of DefenderCspmGcpOfferingVmScanners class. */ + public DefenderCspmGcpOfferingVmScanners() { + } + + /** + * Get the enabled property: Is Microsoft Defender for Server VM scanning enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Is Microsoft Defender for Server VM scanning enabled. + * + * @param enabled the enabled value to set. + * @return the DefenderCspmGcpOfferingVmScanners object itself. + */ + public DefenderCspmGcpOfferingVmScanners withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the configuration property: configuration for Microsoft Defender for Server VM scanning. + * + * @return the configuration value. + */ + public DefenderCspmGcpOfferingVmScannersConfiguration configuration() { + return this.configuration; + } + + /** + * Set the configuration property: configuration for Microsoft Defender for Server VM scanning. + * + * @param configuration the configuration value to set. + * @return the DefenderCspmGcpOfferingVmScanners object itself. + */ + public DefenderCspmGcpOfferingVmScanners withConfiguration( + DefenderCspmGcpOfferingVmScannersConfiguration configuration) { + this.configuration = configuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configuration() != null) { + configuration().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingVmScannersConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingVmScannersConfiguration.java new file mode 100644 index 000000000000..1f60c6a2aa42 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingVmScannersConfiguration.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** configuration for Microsoft Defender for Server VM scanning. */ +@Fluent +public final class DefenderCspmGcpOfferingVmScannersConfiguration { + /* + * The scanning mode for the VM scan. + */ + @JsonProperty(value = "scanningMode") + private ScanningMode scanningMode; + + /* + * VM tags that indicates that VM should not be scanned + */ + @JsonProperty(value = "exclusionTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map exclusionTags; + + /** Creates an instance of DefenderCspmGcpOfferingVmScannersConfiguration class. */ + public DefenderCspmGcpOfferingVmScannersConfiguration() { + } + + /** + * Get the scanningMode property: The scanning mode for the VM scan. + * + * @return the scanningMode value. + */ + public ScanningMode scanningMode() { + return this.scanningMode; + } + + /** + * Set the scanningMode property: The scanning mode for the VM scan. + * + * @param scanningMode the scanningMode value to set. + * @return the DefenderCspmGcpOfferingVmScannersConfiguration object itself. + */ + public DefenderCspmGcpOfferingVmScannersConfiguration withScanningMode(ScanningMode scanningMode) { + this.scanningMode = scanningMode; + return this; + } + + /** + * Get the exclusionTags property: VM tags that indicates that VM should not be scanned. + * + * @return the exclusionTags value. + */ + public Map exclusionTags() { + return this.exclusionTags; + } + + /** + * Set the exclusionTags property: VM tags that indicates that VM should not be scanned. + * + * @param exclusionTags the exclusionTags value to set. + * @return the DefenderCspmGcpOfferingVmScannersConfiguration object itself. + */ + public DefenderCspmGcpOfferingVmScannersConfiguration withExclusionTags(Map exclusionTags) { + this.exclusionTags = exclusionTags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOffering.java index 9877dfd1b938..b8cfc5bf8f65 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOffering.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOffering.java @@ -74,6 +74,18 @@ public final class DefenderForContainersAwsOffering extends CloudOffering { @JsonProperty(value = "scubaExternalId") private String scubaExternalId; + /* + * The Microsoft Defender container image assessment configuration + */ + @JsonProperty(value = "mdcContainersImageAssessment") + private DefenderForContainersAwsOfferingMdcContainersImageAssessment mdcContainersImageAssessment; + + /* + * The Microsoft Defender container agentless discovery K8s configuration + */ + @JsonProperty(value = "mdcContainersAgentlessDiscoveryK8s") + private DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S; + /** Creates an instance of DefenderForContainersAwsOffering class. */ public DefenderForContainersAwsOffering() { } @@ -286,6 +298,50 @@ public DefenderForContainersAwsOffering withScubaExternalId(String scubaExternal return this; } + /** + * Get the mdcContainersImageAssessment property: The Microsoft Defender container image assessment configuration. + * + * @return the mdcContainersImageAssessment value. + */ + public DefenderForContainersAwsOfferingMdcContainersImageAssessment mdcContainersImageAssessment() { + return this.mdcContainersImageAssessment; + } + + /** + * Set the mdcContainersImageAssessment property: The Microsoft Defender container image assessment configuration. + * + * @param mdcContainersImageAssessment the mdcContainersImageAssessment value to set. + * @return the DefenderForContainersAwsOffering object itself. + */ + public DefenderForContainersAwsOffering withMdcContainersImageAssessment( + DefenderForContainersAwsOfferingMdcContainersImageAssessment mdcContainersImageAssessment) { + this.mdcContainersImageAssessment = mdcContainersImageAssessment; + return this; + } + + /** + * Get the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender container agentless discovery K8s + * configuration. + * + * @return the mdcContainersAgentlessDiscoveryK8S value. + */ + public DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S() { + return this.mdcContainersAgentlessDiscoveryK8S; + } + + /** + * Set the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender container agentless discovery K8s + * configuration. + * + * @param mdcContainersAgentlessDiscoveryK8S the mdcContainersAgentlessDiscoveryK8S value to set. + * @return the DefenderForContainersAwsOffering object itself. + */ + public DefenderForContainersAwsOffering withMdcContainersAgentlessDiscoveryK8S( + DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S) { + this.mdcContainersAgentlessDiscoveryK8S = mdcContainersAgentlessDiscoveryK8S; + return this; + } + /** * Validates the instance. * @@ -312,5 +368,11 @@ public void validate() { if (containerVulnerabilityAssessmentTask() != null) { containerVulnerabilityAssessmentTask().validate(); } + if (mdcContainersImageAssessment() != null) { + mdcContainersImageAssessment().validate(); + } + if (mdcContainersAgentlessDiscoveryK8S() != null) { + mdcContainersAgentlessDiscoveryK8S().validate(); + } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S.java new file mode 100644 index 000000000000..cbe4766b93f7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Microsoft Defender container agentless discovery K8s configuration. */ +@Fluent +public final class DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S { + /* + * Is Microsoft Defender container agentless discovery K8s enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The cloud role ARN in AWS for this feature + */ + @JsonProperty(value = "cloudRoleArn") + private String cloudRoleArn; + + /** Creates an instance of DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S class. */ + public DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S() { + } + + /** + * Get the enabled property: Is Microsoft Defender container agentless discovery K8s enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Is Microsoft Defender container agentless discovery K8s enabled. + * + * @param enabled the enabled value to set. + * @return the DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S object itself. + */ + public DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. + * + * @return the cloudRoleArn value. + */ + public String cloudRoleArn() { + return this.cloudRoleArn; + } + + /** + * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. + * + * @param cloudRoleArn the cloudRoleArn value to set. + * @return the DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S object itself. + */ + public DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S withCloudRoleArn(String cloudRoleArn) { + this.cloudRoleArn = cloudRoleArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersImageAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersImageAssessment.java new file mode 100644 index 000000000000..55b9265d11ad --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersImageAssessment.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Microsoft Defender container image assessment configuration. */ +@Fluent +public final class DefenderForContainersAwsOfferingMdcContainersImageAssessment { + /* + * Is Microsoft Defender container image assessment enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The cloud role ARN in AWS for this feature + */ + @JsonProperty(value = "cloudRoleArn") + private String cloudRoleArn; + + /** Creates an instance of DefenderForContainersAwsOfferingMdcContainersImageAssessment class. */ + public DefenderForContainersAwsOfferingMdcContainersImageAssessment() { + } + + /** + * Get the enabled property: Is Microsoft Defender container image assessment enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Is Microsoft Defender container image assessment enabled. + * + * @param enabled the enabled value to set. + * @return the DefenderForContainersAwsOfferingMdcContainersImageAssessment object itself. + */ + public DefenderForContainersAwsOfferingMdcContainersImageAssessment withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. + * + * @return the cloudRoleArn value. + */ + public String cloudRoleArn() { + return this.cloudRoleArn; + } + + /** + * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. + * + * @param cloudRoleArn the cloudRoleArn value to set. + * @return the DefenderForContainersAwsOfferingMdcContainersImageAssessment object itself. + */ + public DefenderForContainersAwsOfferingMdcContainersImageAssessment withCloudRoleArn(String cloudRoleArn) { + this.cloudRoleArn = cloudRoleArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOffering.java index 4f6379839b46..8bcc9a135339 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOffering.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOffering.java @@ -44,6 +44,18 @@ public final class DefenderForContainersGcpOffering extends CloudOffering { @JsonProperty(value = "policyAgentAutoProvisioningFlag") private Boolean policyAgentAutoProvisioningFlag; + /* + * The Microsoft Defender Container image assessment configuration + */ + @JsonProperty(value = "mdcContainersImageAssessment") + private DefenderForContainersGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment; + + /* + * The Microsoft Defender Container agentless discovery configuration + */ + @JsonProperty(value = "mdcContainersAgentlessDiscoveryK8s") + private DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S; + /** Creates an instance of DefenderForContainersGcpOffering class. */ public DefenderForContainersGcpOffering() { } @@ -154,6 +166,50 @@ public DefenderForContainersGcpOffering withPolicyAgentAutoProvisioningFlag( return this; } + /** + * Get the mdcContainersImageAssessment property: The Microsoft Defender Container image assessment configuration. + * + * @return the mdcContainersImageAssessment value. + */ + public DefenderForContainersGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment() { + return this.mdcContainersImageAssessment; + } + + /** + * Set the mdcContainersImageAssessment property: The Microsoft Defender Container image assessment configuration. + * + * @param mdcContainersImageAssessment the mdcContainersImageAssessment value to set. + * @return the DefenderForContainersGcpOffering object itself. + */ + public DefenderForContainersGcpOffering withMdcContainersImageAssessment( + DefenderForContainersGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment) { + this.mdcContainersImageAssessment = mdcContainersImageAssessment; + return this; + } + + /** + * Get the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender Container agentless discovery + * configuration. + * + * @return the mdcContainersAgentlessDiscoveryK8S value. + */ + public DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S() { + return this.mdcContainersAgentlessDiscoveryK8S; + } + + /** + * Set the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender Container agentless discovery + * configuration. + * + * @param mdcContainersAgentlessDiscoveryK8S the mdcContainersAgentlessDiscoveryK8S value to set. + * @return the DefenderForContainersGcpOffering object itself. + */ + public DefenderForContainersGcpOffering withMdcContainersAgentlessDiscoveryK8S( + DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S) { + this.mdcContainersAgentlessDiscoveryK8S = mdcContainersAgentlessDiscoveryK8S; + return this; + } + /** * Validates the instance. * @@ -168,5 +224,11 @@ public void validate() { if (dataPipelineNativeCloudConnection() != null) { dataPipelineNativeCloudConnection().validate(); } + if (mdcContainersImageAssessment() != null) { + mdcContainersImageAssessment().validate(); + } + if (mdcContainersAgentlessDiscoveryK8S() != null) { + mdcContainersAgentlessDiscoveryK8S().validate(); + } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.java new file mode 100644 index 000000000000..8d51b587ecc0 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Microsoft Defender Container agentless discovery configuration. */ +@Fluent +public final class DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S { + /* + * Is Microsoft Defender container agentless discovery enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The workload identity provider id in GCP for this feature + */ + @JsonProperty(value = "workloadIdentityProviderId") + private String workloadIdentityProviderId; + + /* + * The service account email address in GCP for this feature + */ + @JsonProperty(value = "serviceAccountEmailAddress") + private String serviceAccountEmailAddress; + + /** Creates an instance of DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S class. */ + public DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S() { + } + + /** + * Get the enabled property: Is Microsoft Defender container agentless discovery enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Is Microsoft Defender container agentless discovery enabled. + * + * @param enabled the enabled value to set. + * @return the DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S object itself. + */ + public DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. + * + * @return the workloadIdentityProviderId value. + */ + public String workloadIdentityProviderId() { + return this.workloadIdentityProviderId; + } + + /** + * Set the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. + * + * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. + * @return the DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S object itself. + */ + public DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S withWorkloadIdentityProviderId( + String workloadIdentityProviderId) { + this.workloadIdentityProviderId = workloadIdentityProviderId; + return this; + } + + /** + * Get the serviceAccountEmailAddress property: The service account email address in GCP for this feature. + * + * @return the serviceAccountEmailAddress value. + */ + public String serviceAccountEmailAddress() { + return this.serviceAccountEmailAddress; + } + + /** + * Set the serviceAccountEmailAddress property: The service account email address in GCP for this feature. + * + * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. + * @return the DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S object itself. + */ + public DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S withServiceAccountEmailAddress( + String serviceAccountEmailAddress) { + this.serviceAccountEmailAddress = serviceAccountEmailAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersImageAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersImageAssessment.java new file mode 100644 index 000000000000..31a7a8082874 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersImageAssessment.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Microsoft Defender Container image assessment configuration. */ +@Fluent +public final class DefenderForContainersGcpOfferingMdcContainersImageAssessment { + /* + * Is Microsoft Defender container image assessment enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The workload identity provider id in GCP for this feature + */ + @JsonProperty(value = "workloadIdentityProviderId") + private String workloadIdentityProviderId; + + /* + * The service account email address in GCP for this feature + */ + @JsonProperty(value = "serviceAccountEmailAddress") + private String serviceAccountEmailAddress; + + /** Creates an instance of DefenderForContainersGcpOfferingMdcContainersImageAssessment class. */ + public DefenderForContainersGcpOfferingMdcContainersImageAssessment() { + } + + /** + * Get the enabled property: Is Microsoft Defender container image assessment enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Is Microsoft Defender container image assessment enabled. + * + * @param enabled the enabled value to set. + * @return the DefenderForContainersGcpOfferingMdcContainersImageAssessment object itself. + */ + public DefenderForContainersGcpOfferingMdcContainersImageAssessment withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. + * + * @return the workloadIdentityProviderId value. + */ + public String workloadIdentityProviderId() { + return this.workloadIdentityProviderId; + } + + /** + * Set the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. + * + * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. + * @return the DefenderForContainersGcpOfferingMdcContainersImageAssessment object itself. + */ + public DefenderForContainersGcpOfferingMdcContainersImageAssessment withWorkloadIdentityProviderId( + String workloadIdentityProviderId) { + this.workloadIdentityProviderId = workloadIdentityProviderId; + return this; + } + + /** + * Get the serviceAccountEmailAddress property: The service account email address in GCP for this feature. + * + * @return the serviceAccountEmailAddress value. + */ + public String serviceAccountEmailAddress() { + return this.serviceAccountEmailAddress; + } + + /** + * Set the serviceAccountEmailAddress property: The service account email address in GCP for this feature. + * + * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. + * @return the DefenderForContainersGcpOfferingMdcContainersImageAssessment object itself. + */ + public DefenderForContainersGcpOfferingMdcContainersImageAssessment withServiceAccountEmailAddress( + String serviceAccountEmailAddress) { + this.serviceAccountEmailAddress = serviceAccountEmailAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorageSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorageSetting.java new file mode 100644 index 000000000000..20df7acac037 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorageSetting.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.DefenderForStorageSettingInner; + +/** An immutable client-side representation of DefenderForStorageSetting. */ +public interface DefenderForStorageSetting { + /** + * 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 isEnabled property: Indicates whether Defender for Storage is enabled on this storage account. + * + * @return the isEnabled value. + */ + Boolean isEnabled(); + + /** + * Gets the overrideSubscriptionLevelSettings property: Indicates whether the settings defined for this storage + * account should override the settings defined for the subscription. + * + * @return the overrideSubscriptionLevelSettings value. + */ + Boolean overrideSubscriptionLevelSettings(); + + /** + * Gets the scanResultsEventGridTopicResourceId property: Optional. Resource id of an Event Grid Topic to send scan + * results to. + * + * @return the scanResultsEventGridTopicResourceId value. + */ + String scanResultsEventGridTopicResourceId(); + + /** + * Gets the operationStatus property: Upon failure or partial success. Additional data describing Malware Scanning + * enable/disable operation. + * + * @return the operationStatus value. + */ + OperationStatusAutoGenerated operationStatus(); + + /** + * Gets the isEnabledMalwareScanningIsEnabled property: Indicates whether On Upload malware scanning should be + * enabled. + * + * @return the isEnabledMalwareScanningIsEnabled value. + */ + Boolean isEnabledMalwareScanningIsEnabled(); + + /** + * Gets the capGBPerMonth property: Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + * + * @return the capGBPerMonth value. + */ + Integer capGBPerMonth(); + + /** + * Gets the isEnabledSensitiveDataDiscoveryIsEnabled property: Indicates whether Sensitive Data Discovery should be + * enabled. + * + * @return the isEnabledSensitiveDataDiscoveryIsEnabled value. + */ + Boolean isEnabledSensitiveDataDiscoveryIsEnabled(); + + /** + * Gets the operationStatusSensitiveDataDiscoveryOperationStatus property: Upon failure or partial success. + * Additional data describing Sensitive Data Discovery enable/disable operation. + * + * @return the operationStatusSensitiveDataDiscoveryOperationStatus value. + */ + OperationStatusAutoGenerated operationStatusSensitiveDataDiscoveryOperationStatus(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.DefenderForStorageSettingInner object. + * + * @return the inner object. + */ + DefenderForStorageSettingInner innerModel(); + + /** The entirety of the DefenderForStorageSetting definition. */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { + } + + /** The DefenderForStorageSetting definition stages. */ + interface DefinitionStages { + /** The first stage of the DefenderForStorageSetting definition. */ + interface Blank extends WithScope { + } + + /** The stage of the DefenderForStorageSetting definition allowing to specify parent resource. */ + interface WithScope { + /** + * Specifies resourceId. + * + * @param resourceId The identifier of the resource. + * @return the next definition stage. + */ + WithCreate withExistingResourceId(String resourceId); + } + + /** + * The stage of the DefenderForStorageSetting 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.WithIsEnabled, + DefinitionStages.WithOverrideSubscriptionLevelSettings, + DefinitionStages.WithScanResultsEventGridTopicResourceId, + DefinitionStages.WithIsEnabledMalwareScanningIsEnabled, + DefinitionStages.WithCapGBPerMonth, + DefinitionStages.WithIsEnabledSensitiveDataDiscoveryIsEnabled { + /** + * Executes the create request. + * + * @return the created resource. + */ + DefenderForStorageSetting create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DefenderForStorageSetting create(Context context); + } + + /** The stage of the DefenderForStorageSetting definition allowing to specify isEnabled. */ + interface WithIsEnabled { + /** + * Specifies the isEnabled property: Indicates whether Defender for Storage is enabled on this storage + * account.. + * + * @param isEnabled Indicates whether Defender for Storage is enabled on this storage account. + * @return the next definition stage. + */ + WithCreate withIsEnabled(Boolean isEnabled); + } + + /** + * The stage of the DefenderForStorageSetting definition allowing to specify overrideSubscriptionLevelSettings. + */ + interface WithOverrideSubscriptionLevelSettings { + /** + * Specifies the overrideSubscriptionLevelSettings property: Indicates whether the settings defined for this + * storage account should override the settings defined for the subscription.. + * + * @param overrideSubscriptionLevelSettings Indicates whether the settings defined for this storage account + * should override the settings defined for the subscription. + * @return the next definition stage. + */ + WithCreate withOverrideSubscriptionLevelSettings(Boolean overrideSubscriptionLevelSettings); + } + + /** + * The stage of the DefenderForStorageSetting definition allowing to specify + * scanResultsEventGridTopicResourceId. + */ + interface WithScanResultsEventGridTopicResourceId { + /** + * Specifies the scanResultsEventGridTopicResourceId property: Optional. Resource id of an Event Grid Topic + * to send scan results to.. + * + * @param scanResultsEventGridTopicResourceId Optional. Resource id of an Event Grid Topic to send scan + * results to. + * @return the next definition stage. + */ + WithCreate withScanResultsEventGridTopicResourceId(String scanResultsEventGridTopicResourceId); + } + + /** + * The stage of the DefenderForStorageSetting definition allowing to specify isEnabledMalwareScanningIsEnabled. + */ + interface WithIsEnabledMalwareScanningIsEnabled { + /** + * Specifies the isEnabledMalwareScanningIsEnabled property: Indicates whether On Upload malware scanning + * should be enabled.. + * + * @param isEnabledMalwareScanningIsEnabled Indicates whether On Upload malware scanning should be enabled. + * @return the next definition stage. + */ + WithCreate withIsEnabledMalwareScanningIsEnabled(Boolean isEnabledMalwareScanningIsEnabled); + } + + /** The stage of the DefenderForStorageSetting definition allowing to specify capGBPerMonth. */ + interface WithCapGBPerMonth { + /** + * Specifies the capGBPerMonth property: Defines the max GB to be scanned per Month. Set to -1 if no capping + * is needed.. + * + * @param capGBPerMonth Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + * @return the next definition stage. + */ + WithCreate withCapGBPerMonth(Integer capGBPerMonth); + } + + /** + * The stage of the DefenderForStorageSetting definition allowing to specify + * isEnabledSensitiveDataDiscoveryIsEnabled. + */ + interface WithIsEnabledSensitiveDataDiscoveryIsEnabled { + /** + * Specifies the isEnabledSensitiveDataDiscoveryIsEnabled property: Indicates whether Sensitive Data + * Discovery should be enabled.. + * + * @param isEnabledSensitiveDataDiscoveryIsEnabled Indicates whether Sensitive Data Discovery should be + * enabled. + * @return the next definition stage. + */ + WithCreate withIsEnabledSensitiveDataDiscoveryIsEnabled(Boolean isEnabledSensitiveDataDiscoveryIsEnabled); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DefenderForStorageSetting refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DefenderForStorageSetting refresh(Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorages.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorages.java new file mode 100644 index 000000000000..1a6ffe4ed34a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorages.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DefenderForStorages. */ +public interface DefenderForStorages { + /** + * Gets the Defender for Storage settings for the specified storage account. + * + * @param resourceId The identifier of the resource. + * @param settingName Defender for Storage setting name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Defender for Storage settings for the specified storage account along with {@link Response}. + */ + Response getWithResponse( + String resourceId, SettingNameAutoGenerated settingName, Context context); + + /** + * Gets the Defender for Storage settings for the specified storage account. + * + * @param resourceId The identifier of the resource. + * @param settingName Defender for Storage setting name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Defender for Storage settings for the specified storage account. + */ + DefenderForStorageSetting get(String resourceId, SettingNameAutoGenerated settingName); + + /** + * Gets the Defender for Storage settings for the specified storage account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Defender for Storage settings for the specified storage account along with {@link Response}. + */ + DefenderForStorageSetting getById(String id); + + /** + * Gets the Defender for Storage settings for the specified storage account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Defender for Storage settings for the specified storage account along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DefenderForStorageSetting resource. + * + * @param name resource name. + * @return the first stage of the new DefenderForStorageSetting definition. + */ + DefenderForStorageSetting.DefinitionStages.Blank define(SettingNameAutoGenerated name); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfiguration.java new file mode 100644 index 000000000000..7f6e1b43ed38 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfiguration.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; + +/** An immutable client-side representation of DevOpsConfiguration. */ +public interface DevOpsConfiguration { + /** + * 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the properties property: DevOps Configuration properties. + * + * @return the properties value. + */ + DevOpsConfigurationProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner object. + * + * @return the inner object. + */ + DevOpsConfigurationInner innerModel(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationListResponse.java new file mode 100644 index 000000000000..3039e7c2b622 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationListResponse.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of RP resources which supports pagination. */ +@Fluent +public final class DevOpsConfigurationListResponse { + /* + * Gets or sets list of resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets next link to scroll over the results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of DevOpsConfigurationListResponse class. */ + public DevOpsConfigurationListResponse() { + } + + /** + * Get the value property: Gets or sets list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets list of resources. + * + * @param value the value value to set. + * @return the DevOpsConfigurationListResponse object itself. + */ + public DevOpsConfigurationListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets next link to scroll over the results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets next link to scroll over the results. + * + * @param nextLink the nextLink value to set. + * @return the DevOpsConfigurationListResponse object itself. + */ + public DevOpsConfigurationListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationProperties.java new file mode 100644 index 000000000000..a40cad5c4a9c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationProperties.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** DevOps Configuration properties. */ +@Fluent +public final class DevOpsConfigurationProperties { + /* + * Gets or sets resource status message. + */ + @JsonProperty(value = "provisioningStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningStatusMessage; + + /* + * Gets or sets time when resource was last checked. + */ + @JsonProperty(value = "provisioningStatusUpdateTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime provisioningStatusUpdateTimeUtc; + + /* + * The provisioning state of the resource. + * + * Pending - Provisioning pending. + * Failed - Provisioning failed. + * Succeeded - Successful provisioning. + * Canceled - Provisioning canceled. + * PendingDeletion - Deletion pending. + * DeletionSuccess - Deletion successful. + * DeletionFailure - Deletion failure. + */ + @JsonProperty(value = "provisioningState") + private DevOpsProvisioningState provisioningState; + + /* + * Authorization payload. + */ + @JsonProperty(value = "authorization") + private Authorization authorization; + + /* + * AutoDiscovery states. + */ + @JsonProperty(value = "autoDiscovery") + private AutoDiscovery autoDiscovery; + + /* + * List of top-level inventory to select when AutoDiscovery is disabled. + * This field is ignored when AutoDiscovery is enabled. + */ + @JsonProperty(value = "topLevelInventoryList") + private List topLevelInventoryList; + + /** Creates an instance of DevOpsConfigurationProperties class. */ + public DevOpsConfigurationProperties() { + } + + /** + * Get the provisioningStatusMessage property: Gets or sets resource status message. + * + * @return the provisioningStatusMessage value. + */ + public String provisioningStatusMessage() { + return this.provisioningStatusMessage; + } + + /** + * Get the provisioningStatusUpdateTimeUtc property: Gets or sets time when resource was last checked. + * + * @return the provisioningStatusUpdateTimeUtc value. + */ + public OffsetDateTime provisioningStatusUpdateTimeUtc() { + return this.provisioningStatusUpdateTimeUtc; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + *

Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - + * Provisioning canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion successful. DeletionFailure + * - Deletion failure. + * + * @return the provisioningState value. + */ + public DevOpsProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioning state of the resource. + * + *

Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - + * Provisioning canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion successful. DeletionFailure + * - Deletion failure. + * + * @param provisioningState the provisioningState value to set. + * @return the DevOpsConfigurationProperties object itself. + */ + public DevOpsConfigurationProperties withProvisioningState(DevOpsProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the authorization property: Authorization payload. + * + * @return the authorization value. + */ + public Authorization authorization() { + return this.authorization; + } + + /** + * Set the authorization property: Authorization payload. + * + * @param authorization the authorization value to set. + * @return the DevOpsConfigurationProperties object itself. + */ + public DevOpsConfigurationProperties withAuthorization(Authorization authorization) { + this.authorization = authorization; + return this; + } + + /** + * Get the autoDiscovery property: AutoDiscovery states. + * + * @return the autoDiscovery value. + */ + public AutoDiscovery autoDiscovery() { + return this.autoDiscovery; + } + + /** + * Set the autoDiscovery property: AutoDiscovery states. + * + * @param autoDiscovery the autoDiscovery value to set. + * @return the DevOpsConfigurationProperties object itself. + */ + public DevOpsConfigurationProperties withAutoDiscovery(AutoDiscovery autoDiscovery) { + this.autoDiscovery = autoDiscovery; + return this; + } + + /** + * Get the topLevelInventoryList property: List of top-level inventory to select when AutoDiscovery is disabled. + * This field is ignored when AutoDiscovery is enabled. + * + * @return the topLevelInventoryList value. + */ + public List topLevelInventoryList() { + return this.topLevelInventoryList; + } + + /** + * Set the topLevelInventoryList property: List of top-level inventory to select when AutoDiscovery is disabled. + * This field is ignored when AutoDiscovery is enabled. + * + * @param topLevelInventoryList the topLevelInventoryList value to set. + * @return the DevOpsConfigurationProperties object itself. + */ + public DevOpsConfigurationProperties withTopLevelInventoryList(List topLevelInventoryList) { + this.topLevelInventoryList = topLevelInventoryList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authorization() != null) { + authorization().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurations.java new file mode 100644 index 000000000000..dc91346e6672 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurations.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.models.DevOpsConfigurationInner; + +/** Resource collection API of DevOpsConfigurations. */ +public interface DevOpsConfigurations { + /** + * List DevOps Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String securityConnectorName); + + /** + * List DevOps Configurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); + + /** + * Gets a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 DevOps Configuration along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String securityConnectorName, Context context); + + /** + * Gets a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DevOps Configuration. + */ + DevOpsConfiguration get(String resourceGroupName, String securityConnectorName); + + /** + * Creates or updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return devOps Configuration resource. + */ + DevOpsConfiguration createOrUpdate( + String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration); + + /** + * Creates or updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return devOps Configuration resource. + */ + DevOpsConfiguration createOrUpdate( + String resourceGroupName, + String securityConnectorName, + DevOpsConfigurationInner devOpsConfiguration, + Context context); + + /** + * Updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return devOps Configuration resource. + */ + DevOpsConfiguration update( + String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration); + + /** + * Updates a DevOps Configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param devOpsConfiguration The DevOps configuration resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return devOps Configuration resource. + */ + DevOpsConfiguration update( + String resourceGroupName, + String securityConnectorName, + DevOpsConfigurationInner devOpsConfiguration, + Context context); + + /** + * Deletes a DevOps Connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String securityConnectorName); + + /** + * Deletes a DevOps Connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 securityConnectorName, Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsOperationResults.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsOperationResults.java new file mode 100644 index 000000000000..6f736b04dc0a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsOperationResults.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DevOpsOperationResults. */ +public interface DevOpsOperationResults { + /** + * Get devops long running operation result. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param operationResultId The operation result 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 devops long running operation result along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String securityConnectorName, String operationResultId, Context context); + + /** + * Get devops long running operation result. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param operationResultId The operation result 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 devops long running operation result. + */ + OperationStatusResult get(String resourceGroupName, String securityConnectorName, String operationResultId); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsProvisioningState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsProvisioningState.java new file mode 100644 index 000000000000..7e8bebd7bbb1 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsProvisioningState.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The provisioning state of the resource. + * + *

Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - + * Provisioning canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion successful. DeletionFailure - + * Deletion failure. + */ +public final class DevOpsProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for DevOpsProvisioningState. */ + public static final DevOpsProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for DevOpsProvisioningState. */ + public static final DevOpsProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for DevOpsProvisioningState. */ + public static final DevOpsProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Pending for DevOpsProvisioningState. */ + public static final DevOpsProvisioningState PENDING = fromString("Pending"); + + /** Static value PendingDeletion for DevOpsProvisioningState. */ + public static final DevOpsProvisioningState PENDING_DELETION = fromString("PendingDeletion"); + + /** Static value DeletionSuccess for DevOpsProvisioningState. */ + public static final DevOpsProvisioningState DELETION_SUCCESS = fromString("DeletionSuccess"); + + /** Static value DeletionFailure for DevOpsProvisioningState. */ + public static final DevOpsProvisioningState DELETION_FAILURE = fromString("DeletionFailure"); + + /** + * Creates a new instance of DevOpsProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DevOpsProvisioningState() { + } + + /** + * Creates or finds a DevOpsProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DevOpsProvisioningState. + */ + @JsonCreator + public static DevOpsProvisioningState fromString(String name) { + return fromString(name, DevOpsProvisioningState.class); + } + + /** + * Gets known DevOpsProvisioningState values. + * + * @return known DevOpsProvisioningState values. + */ + public static Collection values() { + return values(DevOpsProvisioningState.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroup.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroup.java index 8cf36f7d77a0..705a665f1e03 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroup.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroup.java @@ -69,11 +69,13 @@ public interface DeviceSecurityGroup { /** The entirety of the DeviceSecurityGroup definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { } + /** The DeviceSecurityGroup definition stages. */ interface DefinitionStages { /** The first stage of the DeviceSecurityGroup definition. */ interface Blank extends WithScope { } + /** The stage of the DeviceSecurityGroup definition allowing to specify parent resource. */ interface WithScope { /** @@ -84,6 +86,7 @@ interface WithScope { */ WithCreate withExistingResourceId(String resourceId); } + /** * The stage of the DeviceSecurityGroup 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. @@ -108,6 +111,7 @@ interface WithCreate */ DeviceSecurityGroup create(Context context); } + /** The stage of the DeviceSecurityGroup definition allowing to specify thresholdRules. */ interface WithThresholdRules { /** @@ -118,6 +122,7 @@ interface WithThresholdRules { */ WithCreate withThresholdRules(List thresholdRules); } + /** The stage of the DeviceSecurityGroup definition allowing to specify timeWindowRules. */ interface WithTimeWindowRules { /** @@ -128,6 +133,7 @@ interface WithTimeWindowRules { */ WithCreate withTimeWindowRules(List timeWindowRules); } + /** The stage of the DeviceSecurityGroup definition allowing to specify allowlistRules. */ interface WithAllowlistRules { /** @@ -138,6 +144,7 @@ interface WithAllowlistRules { */ WithCreate withAllowlistRules(List allowlistRules); } + /** The stage of the DeviceSecurityGroup definition allowing to specify denylistRules. */ interface WithDenylistRules { /** @@ -149,6 +156,7 @@ interface WithDenylistRules { WithCreate withDenylistRules(List denylistRules); } } + /** * Begins update for the DeviceSecurityGroup resource. * @@ -177,6 +185,7 @@ interface Update */ DeviceSecurityGroup apply(Context context); } + /** The DeviceSecurityGroup update stages. */ interface UpdateStages { /** The stage of the DeviceSecurityGroup update allowing to specify thresholdRules. */ @@ -189,6 +198,7 @@ interface WithThresholdRules { */ Update withThresholdRules(List thresholdRules); } + /** The stage of the DeviceSecurityGroup update allowing to specify timeWindowRules. */ interface WithTimeWindowRules { /** @@ -199,6 +209,7 @@ interface WithTimeWindowRules { */ Update withTimeWindowRules(List timeWindowRules); } + /** The stage of the DeviceSecurityGroup update allowing to specify allowlistRules. */ interface WithAllowlistRules { /** @@ -209,6 +220,7 @@ interface WithAllowlistRules { */ Update withAllowlistRules(List allowlistRules); } + /** The stage of the DeviceSecurityGroup update allowing to specify denylistRules. */ interface WithDenylistRules { /** @@ -220,6 +232,7 @@ interface WithDenylistRules { Update withDenylistRules(List denylistRules); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectEnvironmentData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectEnvironmentData.java index 68697c94c1f4..88a879d3b0a1 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectEnvironmentData.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectEnvironmentData.java @@ -26,6 +26,12 @@ public final class GcpProjectEnvironmentData extends EnvironmentData { @JsonProperty(value = "projectDetails") private GcpProjectDetails projectDetails; + /* + * Scan interval in hours (value should be between 1-hour to 24-hours) + */ + @JsonProperty(value = "scanInterval") + private Long scanInterval; + /** Creates an instance of GcpProjectEnvironmentData class. */ public GcpProjectEnvironmentData() { } @@ -70,6 +76,26 @@ public GcpProjectEnvironmentData withProjectDetails(GcpProjectDetails projectDet return this; } + /** + * Get the scanInterval property: Scan interval in hours (value should be between 1-hour to 24-hours). + * + * @return the scanInterval value. + */ + public Long scanInterval() { + return this.scanInterval; + } + + /** + * Set the scanInterval property: Scan interval in hours (value should be between 1-hour to 24-hours). + * + * @param scanInterval the scanInterval value to set. + * @return the GcpProjectEnvironmentData object itself. + */ + public GcpProjectEnvironmentData withScanInterval(Long scanInterval) { + this.scanInterval = scanInterval; + return this; + } + /** * Validates the instance. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsListResponse.java new file mode 100644 index 000000000000..31d08ba42210 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsListResponse.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; +import java.util.List; + +/** An immutable client-side representation of GetSensitivitySettingsListResponse. */ +public interface GetSensitivitySettingsListResponse { + /** + * Gets the value property: The value property. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner object. + * + * @return the inner object. + */ + GetSensitivitySettingsListResponseInner innerModel(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponse.java new file mode 100644 index 000000000000..32e2c0f60f39 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponse.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; + +/** An immutable client-side representation of GetSensitivitySettingsResponse. */ +public interface GetSensitivitySettingsResponse { + /** + * 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 sensitivity settings properties. + * + * @return the properties value. + */ + GetSensitivitySettingsResponseProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner object. + * + * @return the inner object. + */ + GetSensitivitySettingsResponseInner innerModel(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponseProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponseProperties.java new file mode 100644 index 000000000000..3e261692951f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponseProperties.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.UUID; + +/** The sensitivity settings properties. */ +@Fluent +public final class GetSensitivitySettingsResponseProperties { + /* + * List of selected sensitive info types' IDs. + */ + @JsonProperty(value = "sensitiveInfoTypesIds") + private List sensitiveInfoTypesIds; + + /* + * The order of the sensitivity threshold label. Any label at or above this order will be considered sensitive. If + * set to -1, sensitivity by labels is turned off + */ + @JsonProperty(value = "sensitivityThresholdLabelOrder") + private Float sensitivityThresholdLabelOrder; + + /* + * The id of the sensitivity threshold label. Any label at or above this rank will be considered sensitive. + */ + @JsonProperty(value = "sensitivityThresholdLabelId") + private UUID sensitivityThresholdLabelId; + + /* + * Microsoft information protection built-in and custom information types, labels, and integration status. + */ + @JsonProperty(value = "mipInformation") + private GetSensitivitySettingsResponsePropertiesMipInformation mipInformation; + + /** Creates an instance of GetSensitivitySettingsResponseProperties class. */ + public GetSensitivitySettingsResponseProperties() { + } + + /** + * Get the sensitiveInfoTypesIds property: List of selected sensitive info types' IDs. + * + * @return the sensitiveInfoTypesIds value. + */ + public List sensitiveInfoTypesIds() { + return this.sensitiveInfoTypesIds; + } + + /** + * Set the sensitiveInfoTypesIds property: List of selected sensitive info types' IDs. + * + * @param sensitiveInfoTypesIds the sensitiveInfoTypesIds value to set. + * @return the GetSensitivitySettingsResponseProperties object itself. + */ + public GetSensitivitySettingsResponseProperties withSensitiveInfoTypesIds(List sensitiveInfoTypesIds) { + this.sensitiveInfoTypesIds = sensitiveInfoTypesIds; + return this; + } + + /** + * Get the sensitivityThresholdLabelOrder property: The order of the sensitivity threshold label. Any label at or + * above this order will be considered sensitive. If set to -1, sensitivity by labels is turned off. + * + * @return the sensitivityThresholdLabelOrder value. + */ + public Float sensitivityThresholdLabelOrder() { + return this.sensitivityThresholdLabelOrder; + } + + /** + * Set the sensitivityThresholdLabelOrder property: The order of the sensitivity threshold label. Any label at or + * above this order will be considered sensitive. If set to -1, sensitivity by labels is turned off. + * + * @param sensitivityThresholdLabelOrder the sensitivityThresholdLabelOrder value to set. + * @return the GetSensitivitySettingsResponseProperties object itself. + */ + public GetSensitivitySettingsResponseProperties withSensitivityThresholdLabelOrder( + Float sensitivityThresholdLabelOrder) { + this.sensitivityThresholdLabelOrder = sensitivityThresholdLabelOrder; + return this; + } + + /** + * Get the sensitivityThresholdLabelId property: The id of the sensitivity threshold label. Any label at or above + * this rank will be considered sensitive. + * + * @return the sensitivityThresholdLabelId value. + */ + public UUID sensitivityThresholdLabelId() { + return this.sensitivityThresholdLabelId; + } + + /** + * Set the sensitivityThresholdLabelId property: The id of the sensitivity threshold label. Any label at or above + * this rank will be considered sensitive. + * + * @param sensitivityThresholdLabelId the sensitivityThresholdLabelId value to set. + * @return the GetSensitivitySettingsResponseProperties object itself. + */ + public GetSensitivitySettingsResponseProperties withSensitivityThresholdLabelId(UUID sensitivityThresholdLabelId) { + this.sensitivityThresholdLabelId = sensitivityThresholdLabelId; + return this; + } + + /** + * Get the mipInformation property: Microsoft information protection built-in and custom information types, labels, + * and integration status. + * + * @return the mipInformation value. + */ + public GetSensitivitySettingsResponsePropertiesMipInformation mipInformation() { + return this.mipInformation; + } + + /** + * Set the mipInformation property: Microsoft information protection built-in and custom information types, labels, + * and integration status. + * + * @param mipInformation the mipInformation value to set. + * @return the GetSensitivitySettingsResponseProperties object itself. + */ + public GetSensitivitySettingsResponseProperties withMipInformation( + GetSensitivitySettingsResponsePropertiesMipInformation mipInformation) { + this.mipInformation = mipInformation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (mipInformation() != null) { + mipInformation().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponsePropertiesMipInformation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponsePropertiesMipInformation.java new file mode 100644 index 000000000000..3f853cadea93 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponsePropertiesMipInformation.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Microsoft information protection built-in and custom information types, labels, and integration status. */ +@Fluent +public final class GetSensitivitySettingsResponsePropertiesMipInformation { + /* + * Microsoft information protection integration status + */ + @JsonProperty(value = "mipIntegrationStatus") + private MipIntegrationStatus mipIntegrationStatus; + + /* + * List of Microsoft information protection sensitivity labels + */ + @JsonProperty(value = "labels") + private List

Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - + * Provisioning canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion successful. DeletionFailure + * - Deletion failure. + * + * @return the provisioningState value. + */ + public DevOpsProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioning state of the resource. + * + *

Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - + * Provisioning canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion successful. DeletionFailure + * - Deletion failure. + * + * @param provisioningState the provisioningState value to set. + * @return the GitHubOwnerProperties object itself. + */ + public GitHubOwnerProperties withProvisioningState(DevOpsProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the ownerUrl property: Gets or sets GitHub Owner url. + * + * @return the ownerUrl value. + */ + public String ownerUrl() { + return this.ownerUrl; + } + + /** + * Get the gitHubInternalId property: Gets or sets internal GitHub id. + * + * @return the gitHubInternalId value. + */ + public String gitHubInternalId() { + return this.gitHubInternalId; + } + + /** + * Get the onboardingState property: Details about resource onboarding status across all connectors. + * + *

OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only + * applicable to top-level resources. Onboarded - this resource has already been onboarded by the specified + * connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + * state is not applicable to the current endpoint. + * + * @return the onboardingState value. + */ + public OnboardingState onboardingState() { + return this.onboardingState; + } + + /** + * Set the onboardingState property: Details about resource onboarding status across all connectors. + * + *

OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only + * applicable to top-level resources. Onboarded - this resource has already been onboarded by the specified + * connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + * state is not applicable to the current endpoint. + * + * @param onboardingState the onboardingState value to set. + * @return the GitHubOwnerProperties object itself. + */ + public GitHubOwnerProperties withOnboardingState(OnboardingState onboardingState) { + this.onboardingState = onboardingState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubOwners.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubOwners.java new file mode 100644 index 000000000000..b62028f7a2f5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubOwners.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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 GitHubOwners. */ +public interface GitHubOwners { + /** + * Returns a list of all GitHub owners accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link Response}. + */ + Response listAvailableWithResponse( + String resourceGroupName, String securityConnectorName, Context context); + + /** + * Returns a list of all GitHub owners accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination. + */ + GitHubOwnerListResponse listAvailable(String resourceGroupName, String securityConnectorName); + + /** + * Returns a list of GitHub owners onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String securityConnectorName); + + /** + * Returns a list of GitHub owners onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); + + /** + * Returns a monitored GitHub owner. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitHub Owner resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String securityConnectorName, String ownerName, Context context); + + /** + * Returns a monitored GitHub owner. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitHub Owner resource. + */ + GitHubOwner get(String resourceGroupName, String securityConnectorName, String ownerName); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepos.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepos.java new file mode 100644 index 000000000000..e73f9d7e2454 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepos.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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 GitHubRepos. */ +public interface GitHubRepos { + /** + * Returns a list of GitHub repositories onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String securityConnectorName, String ownerName); + + /** + * Returns a list of GitHub repositories onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String securityConnectorName, String ownerName, Context context); + + /** + * Returns a monitored GitHub repository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @param repoName The repository name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitHub Repository resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String securityConnectorName, String ownerName, String repoName, Context context); + + /** + * Returns a monitored GitHub repository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param ownerName The GitHub owner name. + * @param repoName The repository name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitHub Repository resource. + */ + GitHubRepository get(String resourceGroupName, String securityConnectorName, String ownerName, String repoName); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepository.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepository.java new file mode 100644 index 000000000000..f54f22cc2628 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepository.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.security.fluent.models.GitHubRepositoryInner; + +/** An immutable client-side representation of GitHubRepository. */ +public interface GitHubRepository { + /** + * 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the properties property: GitHub Repository properties. + * + * @return the properties value. + */ + GitHubRepositoryProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.GitHubRepositoryInner object. + * + * @return the inner object. + */ + GitHubRepositoryInner innerModel(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepositoryListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepositoryListResponse.java new file mode 100644 index 000000000000..2aa6af0e1b99 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepositoryListResponse.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.security.fluent.models.GitHubRepositoryInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of RP resources which supports pagination. */ +@Fluent +public final class GitHubRepositoryListResponse { + /* + * Gets or sets list of resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets next link to scroll over the results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of GitHubRepositoryListResponse class. */ + public GitHubRepositoryListResponse() { + } + + /** + * Get the value property: Gets or sets list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets list of resources. + * + * @param value the value value to set. + * @return the GitHubRepositoryListResponse object itself. + */ + public GitHubRepositoryListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets next link to scroll over the results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets next link to scroll over the results. + * + * @param nextLink the nextLink value to set. + * @return the GitHubRepositoryListResponse object itself. + */ + public GitHubRepositoryListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepositoryProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepositoryProperties.java new file mode 100644 index 000000000000..db01f5c22c87 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepositoryProperties.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** GitHub Repository properties. */ +@Fluent +public final class GitHubRepositoryProperties { + /* + * Gets or sets resource status message. + */ + @JsonProperty(value = "provisioningStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningStatusMessage; + + /* + * Gets or sets time when resource was last checked. + */ + @JsonProperty(value = "provisioningStatusUpdateTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime provisioningStatusUpdateTimeUtc; + + /* + * The provisioning state of the resource. + * + * Pending - Provisioning pending. + * Failed - Provisioning failed. + * Succeeded - Successful provisioning. + * Canceled - Provisioning canceled. + * PendingDeletion - Deletion pending. + * DeletionSuccess - Deletion successful. + * DeletionFailure - Deletion failure. + */ + @JsonProperty(value = "provisioningState") + private DevOpsProvisioningState provisioningState; + + /* + * Gets or sets GitHub Repository id. + * + * This is a numeric id defined by Github. + * Eg: "123456". + */ + @JsonProperty(value = "repoId", access = JsonProperty.Access.WRITE_ONLY) + private String repoId; + + /* + * Gets or sets GitHub Repository name. + * Eg: "new-repo-1". + */ + @JsonProperty(value = "repoName", access = JsonProperty.Access.WRITE_ONLY) + private String repoName; + + /* + * Gets or sets GitHub Full Name. + * Repository name, prefixed with Owner name. + * Eg: "my-org/new-repo-1". + */ + @JsonProperty(value = "repoFullName", access = JsonProperty.Access.WRITE_ONLY) + private String repoFullName; + + /* + * Details about resource onboarding status across all connectors. + * + * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only + * applicable to top-level resources. + * Onboarded - this resource has already been onboarded by the specified connector. + * NotOnboarded - this resource has not been onboarded to any connector. + * NotApplicable - the onboarding state is not applicable to the current endpoint. + */ + @JsonProperty(value = "onboardingState") + private OnboardingState onboardingState; + + /* + * Gets or sets GitHub Repository url. + */ + @JsonProperty(value = "repoUrl", access = JsonProperty.Access.WRITE_ONLY) + private String repoUrl; + + /* + * Gets or sets parent GitHub Owner name. + */ + @JsonProperty(value = "parentOwnerName") + private String parentOwnerName; + + /** Creates an instance of GitHubRepositoryProperties class. */ + public GitHubRepositoryProperties() { + } + + /** + * Get the provisioningStatusMessage property: Gets or sets resource status message. + * + * @return the provisioningStatusMessage value. + */ + public String provisioningStatusMessage() { + return this.provisioningStatusMessage; + } + + /** + * Get the provisioningStatusUpdateTimeUtc property: Gets or sets time when resource was last checked. + * + * @return the provisioningStatusUpdateTimeUtc value. + */ + public OffsetDateTime provisioningStatusUpdateTimeUtc() { + return this.provisioningStatusUpdateTimeUtc; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + *

Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - + * Provisioning canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion successful. DeletionFailure + * - Deletion failure. + * + * @return the provisioningState value. + */ + public DevOpsProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioning state of the resource. + * + *

Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - + * Provisioning canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion successful. DeletionFailure + * - Deletion failure. + * + * @param provisioningState the provisioningState value to set. + * @return the GitHubRepositoryProperties object itself. + */ + public GitHubRepositoryProperties withProvisioningState(DevOpsProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the repoId property: Gets or sets GitHub Repository id. + * + *

This is a numeric id defined by Github. Eg: "123456". + * + * @return the repoId value. + */ + public String repoId() { + return this.repoId; + } + + /** + * Get the repoName property: Gets or sets GitHub Repository name. Eg: "new-repo-1". + * + * @return the repoName value. + */ + public String repoName() { + return this.repoName; + } + + /** + * Get the repoFullName property: Gets or sets GitHub Full Name. Repository name, prefixed with Owner name. Eg: + * "my-org/new-repo-1". + * + * @return the repoFullName value. + */ + public String repoFullName() { + return this.repoFullName; + } + + /** + * Get the onboardingState property: Details about resource onboarding status across all connectors. + * + *

OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only + * applicable to top-level resources. Onboarded - this resource has already been onboarded by the specified + * connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + * state is not applicable to the current endpoint. + * + * @return the onboardingState value. + */ + public OnboardingState onboardingState() { + return this.onboardingState; + } + + /** + * Set the onboardingState property: Details about resource onboarding status across all connectors. + * + *

OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only + * applicable to top-level resources. Onboarded - this resource has already been onboarded by the specified + * connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + * state is not applicable to the current endpoint. + * + * @param onboardingState the onboardingState value to set. + * @return the GitHubRepositoryProperties object itself. + */ + public GitHubRepositoryProperties withOnboardingState(OnboardingState onboardingState) { + this.onboardingState = onboardingState; + return this; + } + + /** + * Get the repoUrl property: Gets or sets GitHub Repository url. + * + * @return the repoUrl value. + */ + public String repoUrl() { + return this.repoUrl; + } + + /** + * Get the parentOwnerName property: Gets or sets parent GitHub Owner name. + * + * @return the parentOwnerName value. + */ + public String parentOwnerName() { + return this.parentOwnerName; + } + + /** + * Set the parentOwnerName property: Gets or sets parent GitHub Owner name. + * + * @param parentOwnerName the parentOwnerName value to set. + * @return the GitHubRepositoryProperties object itself. + */ + public GitHubRepositoryProperties withParentOwnerName(String parentOwnerName) { + this.parentOwnerName = parentOwnerName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroup.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroup.java new file mode 100644 index 000000000000..6373b57bd660 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroup.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.security.fluent.models.GitLabGroupInner; + +/** An immutable client-side representation of GitLabGroup. */ +public interface GitLabGroup { + /** + * 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the properties property: GitLab Group properties. + * + * @return the properties value. + */ + GitLabGroupProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.GitLabGroupInner object. + * + * @return the inner object. + */ + GitLabGroupInner innerModel(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroupListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroupListResponse.java new file mode 100644 index 000000000000..d1a9575fff82 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroupListResponse.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; +import java.util.List; + +/** An immutable client-side representation of GitLabGroupListResponse. */ +public interface GitLabGroupListResponse { + /** + * Gets the value property: Gets or sets list of resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: Gets or sets next link to scroll over the results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner object. + * + * @return the inner object. + */ + GitLabGroupListResponseInner innerModel(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroupProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroupProperties.java new file mode 100644 index 000000000000..8b9b83a8f6ad --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroupProperties.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** GitLab Group properties. */ +@Fluent +public final class GitLabGroupProperties { + /* + * Gets or sets resource status message. + */ + @JsonProperty(value = "provisioningStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningStatusMessage; + + /* + * Gets or sets time when resource was last checked. + */ + @JsonProperty(value = "provisioningStatusUpdateTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime provisioningStatusUpdateTimeUtc; + + /* + * The provisioning state of the resource. + * + * Pending - Provisioning pending. + * Failed - Provisioning failed. + * Succeeded - Successful provisioning. + * Canceled - Provisioning canceled. + * PendingDeletion - Deletion pending. + * DeletionSuccess - Deletion successful. + * DeletionFailure - Deletion failure. + */ + @JsonProperty(value = "provisioningState") + private DevOpsProvisioningState provisioningState; + + /* + * Gets or sets the fully-qualified name of the Group object. + * + * This contains the entire namespace hierarchy where namespaces are separated by the '$' character. + */ + @JsonProperty(value = "fullyQualifiedName", access = JsonProperty.Access.WRITE_ONLY) + private String fullyQualifiedName; + + /* + * Gets or sets the human readable fully-qualified name of the Group object. + * + * This contains the entire namespace hierarchy as seen on GitLab UI where namespaces are separated by the '/' + * character. + */ + @JsonProperty(value = "fullyQualifiedFriendlyName", access = JsonProperty.Access.WRITE_ONLY) + private String fullyQualifiedFriendlyName; + + /* + * Gets or sets the url of the GitLab Group. + */ + @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) + private String url; + + /* + * Details about resource onboarding status across all connectors. + * + * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only + * applicable to top-level resources. + * Onboarded - this resource has already been onboarded by the specified connector. + * NotOnboarded - this resource has not been onboarded to any connector. + * NotApplicable - the onboarding state is not applicable to the current endpoint. + */ + @JsonProperty(value = "onboardingState") + private OnboardingState onboardingState; + + /** Creates an instance of GitLabGroupProperties class. */ + public GitLabGroupProperties() { + } + + /** + * Get the provisioningStatusMessage property: Gets or sets resource status message. + * + * @return the provisioningStatusMessage value. + */ + public String provisioningStatusMessage() { + return this.provisioningStatusMessage; + } + + /** + * Get the provisioningStatusUpdateTimeUtc property: Gets or sets time when resource was last checked. + * + * @return the provisioningStatusUpdateTimeUtc value. + */ + public OffsetDateTime provisioningStatusUpdateTimeUtc() { + return this.provisioningStatusUpdateTimeUtc; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + *

Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - + * Provisioning canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion successful. DeletionFailure + * - Deletion failure. + * + * @return the provisioningState value. + */ + public DevOpsProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioning state of the resource. + * + *

Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - + * Provisioning canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion successful. DeletionFailure + * - Deletion failure. + * + * @param provisioningState the provisioningState value to set. + * @return the GitLabGroupProperties object itself. + */ + public GitLabGroupProperties withProvisioningState(DevOpsProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the fullyQualifiedName property: Gets or sets the fully-qualified name of the Group object. + * + *

This contains the entire namespace hierarchy where namespaces are separated by the '$' character. + * + * @return the fullyQualifiedName value. + */ + public String fullyQualifiedName() { + return this.fullyQualifiedName; + } + + /** + * Get the fullyQualifiedFriendlyName property: Gets or sets the human readable fully-qualified name of the Group + * object. + * + *

This contains the entire namespace hierarchy as seen on GitLab UI where namespaces are separated by the '/' + * character. + * + * @return the fullyQualifiedFriendlyName value. + */ + public String fullyQualifiedFriendlyName() { + return this.fullyQualifiedFriendlyName; + } + + /** + * Get the url property: Gets or sets the url of the GitLab Group. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Get the onboardingState property: Details about resource onboarding status across all connectors. + * + *

OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only + * applicable to top-level resources. Onboarded - this resource has already been onboarded by the specified + * connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + * state is not applicable to the current endpoint. + * + * @return the onboardingState value. + */ + public OnboardingState onboardingState() { + return this.onboardingState; + } + + /** + * Set the onboardingState property: Details about resource onboarding status across all connectors. + * + *

OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only + * applicable to top-level resources. Onboarded - this resource has already been onboarded by the specified + * connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + * state is not applicable to the current endpoint. + * + * @param onboardingState the onboardingState value to set. + * @return the GitLabGroupProperties object itself. + */ + public GitLabGroupProperties withOnboardingState(OnboardingState onboardingState) { + this.onboardingState = onboardingState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroups.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroups.java new file mode 100644 index 000000000000..bb3c1f817c37 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroups.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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 GitLabGroups. */ +public interface GitLabGroups { + /** + * Returns a list of all GitLab groups accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination along with {@link Response}. + */ + Response listAvailableWithResponse( + String resourceGroupName, String securityConnectorName, Context context); + + /** + * Returns a list of all GitLab groups accessible by the user token consumed by the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination. + */ + GitLabGroupListResponse listAvailable(String resourceGroupName, String securityConnectorName); + + /** + * Returns a list of GitLab groups onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String securityConnectorName); + + /** + * Returns a list of GitLab groups onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); + + /** + * Returns a monitored GitLab Group resource for a given fully-qualified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitLab Group resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String securityConnectorName, String groupFQName, Context context); + + /** + * Returns a monitored GitLab Group resource for a given fully-qualified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitLab Group resource. + */ + GitLabGroup get(String resourceGroupName, String securityConnectorName, String groupFQName); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProject.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProject.java new file mode 100644 index 000000000000..01a855634306 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProject.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.security.fluent.models.GitLabProjectInner; + +/** An immutable client-side representation of GitLabProject. */ +public interface GitLabProject { + /** + * 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the properties property: GitLab Project properties. + * + * @return the properties value. + */ + GitLabProjectProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.GitLabProjectInner object. + * + * @return the inner object. + */ + GitLabProjectInner innerModel(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProjectListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProjectListResponse.java new file mode 100644 index 000000000000..8675ad812ab7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProjectListResponse.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.security.fluent.models.GitLabProjectInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of RP resources which supports pagination. */ +@Fluent +public final class GitLabProjectListResponse { + /* + * Gets or sets list of resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets next link to scroll over the results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of GitLabProjectListResponse class. */ + public GitLabProjectListResponse() { + } + + /** + * Get the value property: Gets or sets list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets list of resources. + * + * @param value the value value to set. + * @return the GitLabProjectListResponse object itself. + */ + public GitLabProjectListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets next link to scroll over the results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets next link to scroll over the results. + * + * @param nextLink the nextLink value to set. + * @return the GitLabProjectListResponse object itself. + */ + public GitLabProjectListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProjectProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProjectProperties.java new file mode 100644 index 000000000000..6bf15ccc26c3 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProjectProperties.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** GitLab Project properties. */ +@Fluent +public final class GitLabProjectProperties { + /* + * Gets or sets resource status message. + */ + @JsonProperty(value = "provisioningStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningStatusMessage; + + /* + * Gets or sets time when resource was last checked. + */ + @JsonProperty(value = "provisioningStatusUpdateTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime provisioningStatusUpdateTimeUtc; + + /* + * The provisioning state of the resource. + * + * Pending - Provisioning pending. + * Failed - Provisioning failed. + * Succeeded - Successful provisioning. + * Canceled - Provisioning canceled. + * PendingDeletion - Deletion pending. + * DeletionSuccess - Deletion successful. + * DeletionFailure - Deletion failure. + */ + @JsonProperty(value = "provisioningState") + private DevOpsProvisioningState provisioningState; + + /* + * Gets or sets the fully-qualified name of the project object. + * + * This contains the entire hierarchy where entities are separated by the '$' character. + */ + @JsonProperty(value = "fullyQualifiedName", access = JsonProperty.Access.WRITE_ONLY) + private String fullyQualifiedName; + + /* + * Gets or sets the human readable fully-qualified name of the Project object. + * + * This contains the entire namespace hierarchy as seen on GitLab UI where entities are separated by the '/' + * character. + */ + @JsonProperty(value = "fullyQualifiedFriendlyName", access = JsonProperty.Access.WRITE_ONLY) + private String fullyQualifiedFriendlyName; + + /* + * Gets or sets the fully-qualified name of the project's parent group object. + * + * This contains the entire hierarchy where namespaces are separated by the '$' character. + */ + @JsonProperty(value = "fullyQualifiedParentGroupName", access = JsonProperty.Access.WRITE_ONLY) + private String fullyQualifiedParentGroupName; + + /* + * Gets or sets the url of the GitLab Project. + */ + @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) + private String url; + + /* + * Details about resource onboarding status across all connectors. + * + * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only + * applicable to top-level resources. + * Onboarded - this resource has already been onboarded by the specified connector. + * NotOnboarded - this resource has not been onboarded to any connector. + * NotApplicable - the onboarding state is not applicable to the current endpoint. + */ + @JsonProperty(value = "onboardingState") + private OnboardingState onboardingState; + + /** Creates an instance of GitLabProjectProperties class. */ + public GitLabProjectProperties() { + } + + /** + * Get the provisioningStatusMessage property: Gets or sets resource status message. + * + * @return the provisioningStatusMessage value. + */ + public String provisioningStatusMessage() { + return this.provisioningStatusMessage; + } + + /** + * Get the provisioningStatusUpdateTimeUtc property: Gets or sets time when resource was last checked. + * + * @return the provisioningStatusUpdateTimeUtc value. + */ + public OffsetDateTime provisioningStatusUpdateTimeUtc() { + return this.provisioningStatusUpdateTimeUtc; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + *

Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - + * Provisioning canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion successful. DeletionFailure + * - Deletion failure. + * + * @return the provisioningState value. + */ + public DevOpsProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioning state of the resource. + * + *

Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - + * Provisioning canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion successful. DeletionFailure + * - Deletion failure. + * + * @param provisioningState the provisioningState value to set. + * @return the GitLabProjectProperties object itself. + */ + public GitLabProjectProperties withProvisioningState(DevOpsProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the fullyQualifiedName property: Gets or sets the fully-qualified name of the project object. + * + *

This contains the entire hierarchy where entities are separated by the '$' character. + * + * @return the fullyQualifiedName value. + */ + public String fullyQualifiedName() { + return this.fullyQualifiedName; + } + + /** + * Get the fullyQualifiedFriendlyName property: Gets or sets the human readable fully-qualified name of the Project + * object. + * + *

This contains the entire namespace hierarchy as seen on GitLab UI where entities are separated by the '/' + * character. + * + * @return the fullyQualifiedFriendlyName value. + */ + public String fullyQualifiedFriendlyName() { + return this.fullyQualifiedFriendlyName; + } + + /** + * Get the fullyQualifiedParentGroupName property: Gets or sets the fully-qualified name of the project's parent + * group object. + * + *

This contains the entire hierarchy where namespaces are separated by the '$' character. + * + * @return the fullyQualifiedParentGroupName value. + */ + public String fullyQualifiedParentGroupName() { + return this.fullyQualifiedParentGroupName; + } + + /** + * Get the url property: Gets or sets the url of the GitLab Project. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Get the onboardingState property: Details about resource onboarding status across all connectors. + * + *

OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only + * applicable to top-level resources. Onboarded - this resource has already been onboarded by the specified + * connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + * state is not applicable to the current endpoint. + * + * @return the onboardingState value. + */ + public OnboardingState onboardingState() { + return this.onboardingState; + } + + /** + * Set the onboardingState property: Details about resource onboarding status across all connectors. + * + *

OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only + * applicable to top-level resources. Onboarded - this resource has already been onboarded by the specified + * connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + * state is not applicable to the current endpoint. + * + * @param onboardingState the onboardingState value to set. + * @return the GitLabProjectProperties object itself. + */ + public GitLabProjectProperties withOnboardingState(OnboardingState onboardingState) { + this.onboardingState = onboardingState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProjects.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProjects.java new file mode 100644 index 000000000000..d4a8bee1a2ae --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProjects.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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 GitLabProjects. */ +public interface GitLabProjects { + /** + * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of GitLab projects that are directly owned by given group and onboarded to the connector as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String securityConnectorName, String groupFQName); + + /** + * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 GitLab projects that are directly owned by given group and onboarded to the connector as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String securityConnectorName, String groupFQName, Context context); + + /** + * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @param projectName The project name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitLab Project resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String securityConnectorName, + String groupFQName, + String projectName, + Context context); + + /** + * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @param projectName The project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gitLab Project resource. + */ + GitLabProject get(String resourceGroupName, String securityConnectorName, String groupFQName, String projectName); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabSubgroups.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabSubgroups.java new file mode 100644 index 000000000000..bb6c9a4cf3b3 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabSubgroups.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of GitLabSubgroups. */ +public interface GitLabSubgroups { + /** + * Gets nested subgroups of given GitLab Group which are onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nested subgroups of given GitLab Group which are onboarded to the connector along with {@link Response}. + */ + Response listWithResponse( + String resourceGroupName, String securityConnectorName, String groupFQName, Context context); + + /** + * Gets nested subgroups of given GitLab Group which are onboarded to the connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param securityConnectorName The security connector name. + * @param groupFQName The GitLab group fully-qualified name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nested subgroups of given GitLab Group which are onboarded to the connector. + */ + GitLabGroupListResponse list(String resourceGroupName, String securityConnectorName, String groupFQName); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignment.java index 8d0fb0553d18..5c781dadfe5f 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignment.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignment.java @@ -87,11 +87,13 @@ public interface GovernanceAssignment { interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } + /** The GovernanceAssignment definition stages. */ interface DefinitionStages { /** The first stage of the GovernanceAssignment definition. */ interface Blank extends WithParentResource { } + /** The stage of the GovernanceAssignment definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -105,6 +107,7 @@ interface WithParentResource { */ WithCreate withExistingAssessment(String scope, String assessmentName); } + /** * The stage of the GovernanceAssignment 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. @@ -131,6 +134,7 @@ interface WithCreate */ GovernanceAssignment create(Context context); } + /** The stage of the GovernanceAssignment definition allowing to specify owner. */ interface WithOwner { /** @@ -142,6 +146,7 @@ interface WithOwner { */ WithCreate withOwner(String owner); } + /** The stage of the GovernanceAssignment definition allowing to specify remediationDueDate. */ interface WithRemediationDueDate { /** @@ -154,6 +159,7 @@ interface WithRemediationDueDate { */ WithCreate withRemediationDueDate(OffsetDateTime remediationDueDate); } + /** The stage of the GovernanceAssignment definition allowing to specify remediationEta. */ interface WithRemediationEta { /** @@ -165,6 +171,7 @@ interface WithRemediationEta { */ WithCreate withRemediationEta(RemediationEta remediationEta); } + /** The stage of the GovernanceAssignment definition allowing to specify isGracePeriod. */ interface WithIsGracePeriod { /** @@ -176,6 +183,7 @@ interface WithIsGracePeriod { */ WithCreate withIsGracePeriod(Boolean isGracePeriod); } + /** The stage of the GovernanceAssignment definition allowing to specify governanceEmailNotification. */ interface WithGovernanceEmailNotification { /** @@ -188,6 +196,7 @@ interface WithGovernanceEmailNotification { */ WithCreate withGovernanceEmailNotification(GovernanceEmailNotification governanceEmailNotification); } + /** The stage of the GovernanceAssignment definition allowing to specify additionalData. */ interface WithAdditionalData { /** @@ -201,6 +210,7 @@ interface WithAdditionalData { WithCreate withAdditionalData(GovernanceAssignmentAdditionalData additionalData); } } + /** * Begins update for the GovernanceAssignment resource. * @@ -231,6 +241,7 @@ interface Update */ GovernanceAssignment apply(Context context); } + /** The GovernanceAssignment update stages. */ interface UpdateStages { /** The stage of the GovernanceAssignment update allowing to specify owner. */ @@ -244,6 +255,7 @@ interface WithOwner { */ Update withOwner(String owner); } + /** The stage of the GovernanceAssignment update allowing to specify remediationDueDate. */ interface WithRemediationDueDate { /** @@ -256,6 +268,7 @@ interface WithRemediationDueDate { */ Update withRemediationDueDate(OffsetDateTime remediationDueDate); } + /** The stage of the GovernanceAssignment update allowing to specify remediationEta. */ interface WithRemediationEta { /** @@ -267,6 +280,7 @@ interface WithRemediationEta { */ Update withRemediationEta(RemediationEta remediationEta); } + /** The stage of the GovernanceAssignment update allowing to specify isGracePeriod. */ interface WithIsGracePeriod { /** @@ -278,6 +292,7 @@ interface WithIsGracePeriod { */ Update withIsGracePeriod(Boolean isGracePeriod); } + /** The stage of the GovernanceAssignment update allowing to specify governanceEmailNotification. */ interface WithGovernanceEmailNotification { /** @@ -290,6 +305,7 @@ interface WithGovernanceEmailNotification { */ Update withGovernanceEmailNotification(GovernanceEmailNotification governanceEmailNotification); } + /** The stage of the GovernanceAssignment update allowing to specify additionalData. */ interface WithAdditionalData { /** @@ -303,6 +319,7 @@ interface WithAdditionalData { Update withAdditionalData(GovernanceAssignmentAdditionalData additionalData); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRule.java index 29fee19b4c66..0143253cd47f 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRule.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRule.java @@ -152,11 +152,13 @@ public interface GovernanceRule { /** The entirety of the GovernanceRule definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { } + /** The GovernanceRule definition stages. */ interface DefinitionStages { /** The first stage of the GovernanceRule definition. */ interface Blank extends WithScope { } + /** The stage of the GovernanceRule definition allowing to specify parent resource. */ interface WithScope { /** @@ -170,6 +172,7 @@ interface WithScope { */ WithCreate withExistingScope(String scope); } + /** * The stage of the GovernanceRule 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. @@ -204,6 +207,7 @@ interface WithCreate */ GovernanceRule create(Context context); } + /** The stage of the GovernanceRule definition allowing to specify displayName. */ interface WithDisplayName { /** @@ -214,6 +218,7 @@ interface WithDisplayName { */ WithCreate withDisplayName(String displayName); } + /** The stage of the GovernanceRule definition allowing to specify description. */ interface WithDescription { /** @@ -224,6 +229,7 @@ interface WithDescription { */ WithCreate withDescription(String description); } + /** The stage of the GovernanceRule definition allowing to specify remediationTimeframe. */ interface WithRemediationTimeframe { /** @@ -236,6 +242,7 @@ interface WithRemediationTimeframe { */ WithCreate withRemediationTimeframe(String remediationTimeframe); } + /** The stage of the GovernanceRule definition allowing to specify isGracePeriod. */ interface WithIsGracePeriod { /** @@ -246,6 +253,7 @@ interface WithIsGracePeriod { */ WithCreate withIsGracePeriod(Boolean isGracePeriod); } + /** The stage of the GovernanceRule definition allowing to specify rulePriority. */ interface WithRulePriority { /** @@ -258,6 +266,7 @@ interface WithRulePriority { */ WithCreate withRulePriority(int rulePriority); } + /** The stage of the GovernanceRule definition allowing to specify isDisabled. */ interface WithIsDisabled { /** @@ -268,6 +277,7 @@ interface WithIsDisabled { */ WithCreate withIsDisabled(Boolean isDisabled); } + /** The stage of the GovernanceRule definition allowing to specify ruleType. */ interface WithRuleType { /** @@ -279,6 +289,7 @@ interface WithRuleType { */ WithCreate withRuleType(GovernanceRuleType ruleType); } + /** The stage of the GovernanceRule definition allowing to specify sourceResourceType. */ interface WithSourceResourceType { /** @@ -290,6 +301,7 @@ interface WithSourceResourceType { */ WithCreate withSourceResourceType(GovernanceRuleSourceResourceType sourceResourceType); } + /** The stage of the GovernanceRule definition allowing to specify excludedScopes. */ interface WithExcludedScopes { /** @@ -301,6 +313,7 @@ interface WithExcludedScopes { */ WithCreate withExcludedScopes(List excludedScopes); } + /** The stage of the GovernanceRule definition allowing to specify conditionSets. */ interface WithConditionSets { /** @@ -311,6 +324,7 @@ interface WithConditionSets { */ WithCreate withConditionSets(List conditionSets); } + /** The stage of the GovernanceRule definition allowing to specify includeMemberScopes. */ interface WithIncludeMemberScopes { /** @@ -323,6 +337,7 @@ interface WithIncludeMemberScopes { */ WithCreate withIncludeMemberScopes(Boolean includeMemberScopes); } + /** The stage of the GovernanceRule definition allowing to specify ownerSource. */ interface WithOwnerSource { /** @@ -335,6 +350,7 @@ interface WithOwnerSource { */ WithCreate withOwnerSource(GovernanceRuleOwnerSource ownerSource); } + /** The stage of the GovernanceRule definition allowing to specify governanceEmailNotification. */ interface WithGovernanceEmailNotification { /** @@ -347,6 +363,7 @@ interface WithGovernanceEmailNotification { */ WithCreate withGovernanceEmailNotification(GovernanceRuleEmailNotification governanceEmailNotification); } + /** The stage of the GovernanceRule definition allowing to specify metadata. */ interface WithMetadata { /** @@ -358,6 +375,7 @@ interface WithMetadata { WithCreate withMetadata(GovernanceRuleMetadata metadata); } } + /** * Begins update for the GovernanceRule resource. * @@ -396,6 +414,7 @@ interface Update */ GovernanceRule apply(Context context); } + /** The GovernanceRule update stages. */ interface UpdateStages { /** The stage of the GovernanceRule update allowing to specify displayName. */ @@ -408,6 +427,7 @@ interface WithDisplayName { */ Update withDisplayName(String displayName); } + /** The stage of the GovernanceRule update allowing to specify description. */ interface WithDescription { /** @@ -418,6 +438,7 @@ interface WithDescription { */ Update withDescription(String description); } + /** The stage of the GovernanceRule update allowing to specify remediationTimeframe. */ interface WithRemediationTimeframe { /** @@ -430,6 +451,7 @@ interface WithRemediationTimeframe { */ Update withRemediationTimeframe(String remediationTimeframe); } + /** The stage of the GovernanceRule update allowing to specify isGracePeriod. */ interface WithIsGracePeriod { /** @@ -440,6 +462,7 @@ interface WithIsGracePeriod { */ Update withIsGracePeriod(Boolean isGracePeriod); } + /** The stage of the GovernanceRule update allowing to specify rulePriority. */ interface WithRulePriority { /** @@ -452,6 +475,7 @@ interface WithRulePriority { */ Update withRulePriority(int rulePriority); } + /** The stage of the GovernanceRule update allowing to specify isDisabled. */ interface WithIsDisabled { /** @@ -462,6 +486,7 @@ interface WithIsDisabled { */ Update withIsDisabled(Boolean isDisabled); } + /** The stage of the GovernanceRule update allowing to specify ruleType. */ interface WithRuleType { /** @@ -473,6 +498,7 @@ interface WithRuleType { */ Update withRuleType(GovernanceRuleType ruleType); } + /** The stage of the GovernanceRule update allowing to specify sourceResourceType. */ interface WithSourceResourceType { /** @@ -484,6 +510,7 @@ interface WithSourceResourceType { */ Update withSourceResourceType(GovernanceRuleSourceResourceType sourceResourceType); } + /** The stage of the GovernanceRule update allowing to specify excludedScopes. */ interface WithExcludedScopes { /** @@ -495,6 +522,7 @@ interface WithExcludedScopes { */ Update withExcludedScopes(List excludedScopes); } + /** The stage of the GovernanceRule update allowing to specify conditionSets. */ interface WithConditionSets { /** @@ -505,6 +533,7 @@ interface WithConditionSets { */ Update withConditionSets(List conditionSets); } + /** The stage of the GovernanceRule update allowing to specify includeMemberScopes. */ interface WithIncludeMemberScopes { /** @@ -517,6 +546,7 @@ interface WithIncludeMemberScopes { */ Update withIncludeMemberScopes(Boolean includeMemberScopes); } + /** The stage of the GovernanceRule update allowing to specify ownerSource. */ interface WithOwnerSource { /** @@ -529,6 +559,7 @@ interface WithOwnerSource { */ Update withOwnerSource(GovernanceRuleOwnerSource ownerSource); } + /** The stage of the GovernanceRule update allowing to specify governanceEmailNotification. */ interface WithGovernanceEmailNotification { /** @@ -541,6 +572,7 @@ interface WithGovernanceEmailNotification { */ Update withGovernanceEmailNotification(GovernanceRuleEmailNotification governanceEmailNotification); } + /** The stage of the GovernanceRule update allowing to specify metadata. */ interface WithMetadata { /** @@ -552,6 +584,7 @@ interface WithMetadata { Update withMetadata(GovernanceRuleMetadata metadata); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthDataClassification.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthDataClassification.java index 9be26ae2b0db..93971ed70b76 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthDataClassification.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthDataClassification.java @@ -26,7 +26,7 @@ public final class HealthDataClassification { * The resource scope of the health report */ @JsonProperty(value = "scope") - private ScopeName scope; + private String scope; /** Creates an instance of HealthDataClassification class. */ public HealthDataClassification() { @@ -77,7 +77,7 @@ public HealthDataClassification withScenario(String scenario) { * * @return the scope value. */ - public ScopeName scope() { + public String scope() { return this.scope; } @@ -87,7 +87,7 @@ public ScopeName scope() { * @param scope the scope value to set. * @return the HealthDataClassification object itself. */ - public HealthDataClassification withScope(ScopeName scope) { + public HealthDataClassification withScope(String scope) { this.scope = scope; return this; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReport.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReport.java index da93fa084412..a6a78763f05b 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReport.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReport.java @@ -6,6 +6,7 @@ import com.azure.resourcemanager.security.fluent.models.HealthReportInner; import java.util.List; +import java.util.Map; /** An immutable client-side representation of HealthReport. */ public interface HealthReport { @@ -65,6 +66,21 @@ public interface HealthReport { */ List affectedDefendersPlans(); + /** + * Gets the affectedDefendersSubPlans property: The affected defenders sub plans by unhealthy report. + * + * @return the affectedDefendersSubPlans value. + */ + List affectedDefendersSubPlans(); + + /** + * Gets the reportAdditionalData property: Additional data for the given health report, this field can include more + * details on the resource and the health scenario. + * + * @return the reportAdditionalData value. + */ + Map reportAdditionalData(); + /** * Gets the issues property: A collection of the issues in the report. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReports.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReports.java index 8765b15539e7..c1ecaf113e87 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReports.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReports.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.security.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 HealthReports. */ @@ -35,4 +36,29 @@ public interface HealthReports { * @return a list of all health reports inside a scope as paginated response with {@link PagedIterable}. */ PagedIterable list(String scope, Context context); + + /** + * Get health report of resource. + * + * @param resourceId The identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health report of resource along with {@link Response}. + */ + Response getWithResponse(String resourceId, String healthReportName, Context context); + + /** + * Get health report of resource. + * + * @param resourceId The identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health report of resource. + */ + HealthReport get(String resourceId, String healthReportName); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InfoType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InfoType.java new file mode 100644 index 000000000000..1d7793150bb3 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InfoType.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** Custom user-defined information type. */ +@Fluent +public final class InfoType { + /* + * Display name of the info type + */ + @JsonProperty(value = "name") + private String name; + + /* + * Id of the info type + */ + @JsonProperty(value = "id") + private UUID id; + + /* + * Description of the info type + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of InfoType class. */ + public InfoType() { + } + + /** + * Get the name property: Display name of the info type. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Display name of the info type. + * + * @param name the name value to set. + * @return the InfoType object itself. + */ + public InfoType withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: Id of the info type. + * + * @return the id value. + */ + public UUID id() { + return this.id; + } + + /** + * Set the id property: Id of the info type. + * + * @param id the id value to set. + * @return the InfoType object itself. + */ + public InfoType withId(UUID id) { + this.id = id; + return this; + } + + /** + * Get the description property: Description of the info type. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the info type. + * + * @param description the description value to set. + * @return the InfoType object itself. + */ + public InfoType withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionPolicy.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionPolicy.java index b145ac417d4b..884c816c11f3 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionPolicy.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionPolicy.java @@ -70,11 +70,13 @@ public interface InformationProtectionPolicy { /** The entirety of the InformationProtectionPolicy definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { } + /** The InformationProtectionPolicy definition stages. */ interface DefinitionStages { /** The first stage of the InformationProtectionPolicy definition. */ interface Blank extends WithScope { } + /** The stage of the InformationProtectionPolicy definition allowing to specify parent resource. */ interface WithScope { /** @@ -87,6 +89,7 @@ interface WithScope { */ WithCreate withExistingScope(String scope); } + /** * The stage of the InformationProtectionPolicy 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. @@ -107,6 +110,7 @@ interface WithCreate extends DefinitionStages.WithLabels, DefinitionStages.WithI */ InformationProtectionPolicy create(Context context); } + /** The stage of the InformationProtectionPolicy definition allowing to specify labels. */ interface WithLabels { /** @@ -117,6 +121,7 @@ interface WithLabels { */ WithCreate withLabels(Map labels); } + /** The stage of the InformationProtectionPolicy definition allowing to specify informationTypes. */ interface WithInformationTypes { /** @@ -128,6 +133,7 @@ interface WithInformationTypes { WithCreate withInformationTypes(Map informationTypes); } } + /** * Begins update for the InformationProtectionPolicy resource. * @@ -152,6 +158,7 @@ interface Update extends UpdateStages.WithLabels, UpdateStages.WithInformationTy */ InformationProtectionPolicy apply(Context context); } + /** The InformationProtectionPolicy update stages. */ interface UpdateStages { /** The stage of the InformationProtectionPolicy update allowing to specify labels. */ @@ -164,6 +171,7 @@ interface WithLabels { */ Update withLabels(Map labels); } + /** The stage of the InformationProtectionPolicy update allowing to specify informationTypes. */ interface WithInformationTypes { /** @@ -175,6 +183,7 @@ interface WithInformationTypes { Update withInformationTypes(Map informationTypes); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionConnectionString.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionConnectionString.java deleted file mode 100644 index a21e6e058cd1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionConnectionString.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Connection string for ingesting security data and logs. */ -@Immutable -public final class IngestionConnectionString { - /* - * The region where ingested logs and data resides - */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; - - /* - * Connection string value - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private String value; - - /** Creates an instance of IngestionConnectionString class. */ - public IngestionConnectionString() { - } - - /** - * Get the location property: The region where ingested logs and data resides. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the value property: Connection string value. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSetting.java deleted file mode 100644 index 6183e755a761..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSetting.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingInner; - -/** An immutable client-side representation of IngestionSetting. */ -public interface IngestionSetting { - /** - * 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: Ingestion setting data. - * - * @return the properties value. - */ - Object properties(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IngestionSettingInner object. - * - * @return the inner object. - */ - IngestionSettingInner innerModel(); - - /** The entirety of the IngestionSetting definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { - } - /** The IngestionSetting definition stages. */ - interface DefinitionStages { - /** The first stage of the IngestionSetting definition. */ - interface Blank extends WithCreate { - } - /** - * The stage of the IngestionSetting 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. - */ - IngestionSetting create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - IngestionSetting create(Context context); - } - /** The stage of the IngestionSetting definition allowing to specify properties. */ - interface WithProperties { - /** - * Specifies the properties property: Ingestion setting data. - * - * @param properties Ingestion setting data. - * @return the next definition stage. - */ - WithCreate withProperties(Object properties); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - IngestionSetting refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - IngestionSetting refresh(Context context); - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - Response listTokensWithResponse(Context context); - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription. - */ - IngestionSettingToken listTokens(); - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs along with {@link Response}. - */ - Response listConnectionStringsWithResponse(Context context); - - /** - * Connection strings for ingesting security scan logs and data. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs. - */ - ConnectionStrings listConnectionStrings(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettingToken.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettingToken.java deleted file mode 100644 index 2d82c0090921..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettingToken.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.IngestionSettingTokenInner; - -/** An immutable client-side representation of IngestionSettingToken. */ -public interface IngestionSettingToken { - /** - * Gets the token property: The token is used for correlating security data and logs with the resources in the - * subscription. - * - * @return the token value. - */ - String token(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IngestionSettingTokenInner object. - * - * @return the inner object. - */ - IngestionSettingTokenInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettings.java deleted file mode 100644 index 0f3c1c9af4a9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettings.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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 IngestionSettings. */ -public interface IngestionSettings { - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - Response getWithResponse(String ingestionSettingName, Context context); - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription. - */ - IngestionSetting get(String ingestionSettingName); - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String ingestionSettingName, Context context); - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 ingestionSettingName); - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - Response listTokensWithResponse(String ingestionSettingName, Context context); - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription. - */ - IngestionSettingToken listTokens(String ingestionSettingName); - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs along with {@link Response}. - */ - Response listConnectionStringsWithResponse(String ingestionSettingName, Context context); - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs. - */ - ConnectionStrings listConnectionStrings(String ingestionSettingName); - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @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 configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - IngestionSetting getById(String id); - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @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 configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes the ingestion settings for this subscription. - * - * @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); - - /** - * Deletes the ingestion settings for this subscription. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new IngestionSetting resource. - * - * @param name resource name. - * @return the first stage of the new IngestionSetting definition. - */ - IngestionSetting.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InheritFromParentState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InheritFromParentState.java new file mode 100644 index 000000000000..d904866c12f3 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InheritFromParentState.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Update Settings. + * + *

Enabled - Resource should inherit configurations from parent. Disabled - Resource should not inherit + * configurations from parent. + */ +public final class InheritFromParentState extends ExpandableStringEnum { + /** Static value Disabled for InheritFromParentState. */ + public static final InheritFromParentState DISABLED = fromString("Disabled"); + + /** Static value Enabled for InheritFromParentState. */ + public static final InheritFromParentState ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of InheritFromParentState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InheritFromParentState() { + } + + /** + * Creates or finds a InheritFromParentState from its string representation. + * + * @param name a name to look for. + * @return the corresponding InheritFromParentState. + */ + @JsonCreator + public static InheritFromParentState fromString(String name) { + return fromString(name, InheritFromParentState.class); + } + + /** + * Gets known InheritFromParentState values. + * + * @return known InheritFromParentState values. + */ + public static Collection values() { + return values(InheritFromParentState.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionModel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionModel.java index bfab666b43c9..d99121e56061 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionModel.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionModel.java @@ -166,11 +166,13 @@ public interface IoTSecuritySolutionModel { interface Definition extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } + /** The IoTSecuritySolutionModel definition stages. */ interface DefinitionStages { /** The first stage of the IoTSecuritySolutionModel definition. */ interface Blank extends WithResourceGroup { } + /** The stage of the IoTSecuritySolutionModel definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -182,6 +184,7 @@ interface WithResourceGroup { */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the IoTSecuritySolutionModel 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. @@ -214,6 +217,7 @@ interface WithCreate */ IoTSecuritySolutionModel create(Context context); } + /** The stage of the IoTSecuritySolutionModel definition allowing to specify location. */ interface WithLocation { /** @@ -232,6 +236,7 @@ interface WithLocation { */ WithCreate withRegion(String location); } + /** The stage of the IoTSecuritySolutionModel definition allowing to specify tags. */ interface WithTags { /** @@ -242,6 +247,7 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the IoTSecuritySolutionModel definition allowing to specify workspace. */ interface WithWorkspace { /** @@ -252,6 +258,7 @@ interface WithWorkspace { */ WithCreate withWorkspace(String workspace); } + /** The stage of the IoTSecuritySolutionModel definition allowing to specify displayName. */ interface WithDisplayName { /** @@ -262,6 +269,7 @@ interface WithDisplayName { */ WithCreate withDisplayName(String displayName); } + /** The stage of the IoTSecuritySolutionModel definition allowing to specify status. */ interface WithStatus { /** @@ -272,6 +280,7 @@ interface WithStatus { */ WithCreate withStatus(SecuritySolutionStatus status); } + /** The stage of the IoTSecuritySolutionModel definition allowing to specify export. */ interface WithExport { /** @@ -282,6 +291,7 @@ interface WithExport { */ WithCreate withExport(List export); } + /** The stage of the IoTSecuritySolutionModel definition allowing to specify disabledDataSources. */ interface WithDisabledDataSources { /** @@ -293,6 +303,7 @@ interface WithDisabledDataSources { */ WithCreate withDisabledDataSources(List disabledDataSources); } + /** The stage of the IoTSecuritySolutionModel definition allowing to specify iotHubs. */ interface WithIotHubs { /** @@ -303,6 +314,7 @@ interface WithIotHubs { */ WithCreate withIotHubs(List iotHubs); } + /** The stage of the IoTSecuritySolutionModel definition allowing to specify userDefinedResources. */ interface WithUserDefinedResources { /** @@ -314,6 +326,7 @@ interface WithUserDefinedResources { */ WithCreate withUserDefinedResources(UserDefinedResourcesProperties userDefinedResources); } + /** The stage of the IoTSecuritySolutionModel definition allowing to specify recommendationsConfiguration. */ interface WithRecommendationsConfiguration { /** @@ -326,6 +339,7 @@ interface WithRecommendationsConfiguration { WithCreate withRecommendationsConfiguration( List recommendationsConfiguration); } + /** The stage of the IoTSecuritySolutionModel definition allowing to specify unmaskedIpLoggingStatus. */ interface WithUnmaskedIpLoggingStatus { /** @@ -336,6 +350,7 @@ interface WithUnmaskedIpLoggingStatus { */ WithCreate withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus unmaskedIpLoggingStatus); } + /** The stage of the IoTSecuritySolutionModel definition allowing to specify additionalWorkspaces. */ interface WithAdditionalWorkspaces { /** @@ -347,6 +362,7 @@ interface WithAdditionalWorkspaces { WithCreate withAdditionalWorkspaces(List additionalWorkspaces); } } + /** * Begins update for the IoTSecuritySolutionModel resource. * @@ -374,6 +390,7 @@ interface Update */ IoTSecuritySolutionModel apply(Context context); } + /** The IoTSecuritySolutionModel update stages. */ interface UpdateStages { /** The stage of the IoTSecuritySolutionModel update allowing to specify tags. */ @@ -386,6 +403,7 @@ interface WithTags { */ Update withTags(Map tags); } + /** The stage of the IoTSecuritySolutionModel update allowing to specify userDefinedResources. */ interface WithUserDefinedResources { /** @@ -397,6 +415,7 @@ interface WithUserDefinedResources { */ Update withUserDefinedResources(UserDefinedResourcesProperties userDefinedResources); } + /** The stage of the IoTSecuritySolutionModel update allowing to specify recommendationsConfiguration. */ interface WithRecommendationsConfiguration { /** @@ -410,6 +429,7 @@ Update withRecommendationsConfiguration( List recommendationsConfiguration); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicy.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicy.java index ae1a0b0a7eef..b10ce9f4a35b 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicy.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicy.java @@ -103,11 +103,13 @@ interface Definition DefinitionStages.WithVirtualMachines, DefinitionStages.WithCreate { } + /** The JitNetworkAccessPolicy definition stages. */ interface DefinitionStages { /** The first stage of the JitNetworkAccessPolicy definition. */ interface Blank extends WithParentResource { } + /** The stage of the JitNetworkAccessPolicy definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -121,6 +123,7 @@ interface WithParentResource { */ WithVirtualMachines withExistingLocation(String resourceGroupName, String ascLocation); } + /** The stage of the JitNetworkAccessPolicy definition allowing to specify virtualMachines. */ interface WithVirtualMachines { /** @@ -132,6 +135,7 @@ interface WithVirtualMachines { */ WithCreate withVirtualMachines(List virtualMachines); } + /** * The stage of the JitNetworkAccessPolicy 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. @@ -152,6 +156,7 @@ interface WithCreate extends DefinitionStages.WithKind, DefinitionStages.WithReq */ JitNetworkAccessPolicy create(Context context); } + /** The stage of the JitNetworkAccessPolicy definition allowing to specify kind. */ interface WithKind { /** @@ -162,6 +167,7 @@ interface WithKind { */ WithCreate withKind(String kind); } + /** The stage of the JitNetworkAccessPolicy definition allowing to specify requests. */ interface WithRequests { /** @@ -173,6 +179,7 @@ interface WithRequests { WithCreate withRequests(List requests); } } + /** * Begins update for the JitNetworkAccessPolicy resource. * @@ -197,6 +204,7 @@ interface Update extends UpdateStages.WithKind, UpdateStages.WithVirtualMachines */ JitNetworkAccessPolicy apply(Context context); } + /** The JitNetworkAccessPolicy update stages. */ interface UpdateStages { /** The stage of the JitNetworkAccessPolicy update allowing to specify kind. */ @@ -209,6 +217,7 @@ interface WithKind { */ Update withKind(String kind); } + /** The stage of the JitNetworkAccessPolicy update allowing to specify virtualMachines. */ interface WithVirtualMachines { /** @@ -220,6 +229,7 @@ interface WithVirtualMachines { */ Update withVirtualMachines(List virtualMachines); } + /** The stage of the JitNetworkAccessPolicy update allowing to specify requests. */ interface WithRequests { /** @@ -231,6 +241,7 @@ interface WithRequests { Update withRequests(List requests); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Label.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Label.java new file mode 100644 index 000000000000..6096f816fdb3 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Label.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** Microsoft information protection sensitivity label. */ +@Fluent +public final class Label { + /* + * The display name of the label + */ + @JsonProperty(value = "name") + private String name; + + /* + * The ID of the label + */ + @JsonProperty(value = "id") + private UUID id; + + /* + * Labels are ordered by sensitivity level. The higher the order of the label, the more sensitive it is. + */ + @JsonProperty(value = "order") + private Float order; + + /** Creates an instance of Label class. */ + public Label() { + } + + /** + * Get the name property: The display name of the label. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The display name of the label. + * + * @param name the name value to set. + * @return the Label object itself. + */ + public Label withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: The ID of the label. + * + * @return the id value. + */ + public UUID id() { + return this.id; + } + + /** + * Set the id property: The ID of the label. + * + * @param id the id value to set. + * @return the Label object itself. + */ + public Label withId(UUID id) { + this.id = id; + return this; + } + + /** + * Get the order property: Labels are ordered by sensitivity level. The higher the order of the label, the more + * sensitive it is. + * + * @return the order value. + */ + public Float order() { + return this.order; + } + + /** + * Set the order property: Labels are ordered by sensitivity level. The higher the order of the label, the more + * sensitive it is. + * + * @param order the order value to set. + * @return the Label object itself. + */ + public Label withOrder(Float order) { + this.order = order; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MipIntegrationStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MipIntegrationStatus.java new file mode 100644 index 000000000000..16cee50e5f5d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MipIntegrationStatus.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Microsoft information protection integration status. */ +public final class MipIntegrationStatus extends ExpandableStringEnum { + /** Static value Ok for MipIntegrationStatus. */ + public static final MipIntegrationStatus OK = fromString("Ok"); + + /** Static value noConsent for MipIntegrationStatus. */ + public static final MipIntegrationStatus NO_CONSENT = fromString("noConsent"); + + /** Static value noAutoLabelingRules for MipIntegrationStatus. */ + public static final MipIntegrationStatus NO_AUTO_LABELING_RULES = fromString("noAutoLabelingRules"); + + /** Static value noMipLabels for MipIntegrationStatus. */ + public static final MipIntegrationStatus NO_MIP_LABELS = fromString("noMipLabels"); + + /** + * Creates a new instance of MipIntegrationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MipIntegrationStatus() { + } + + /** + * Creates or finds a MipIntegrationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding MipIntegrationStatus. + */ + @JsonCreator + public static MipIntegrationStatus fromString(String name) { + return fromString(name, MipIntegrationStatus.class); + } + + /** + * Gets known MipIntegrationStatus values. + * + * @return known MipIntegrationStatus values. + */ + public static Collection values() { + return values(MipIntegrationStatus.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnboardingState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnboardingState.java new file mode 100644 index 000000000000..fa8d9e742af1 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnboardingState.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Details about resource onboarding status across all connectors. + * + *

OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only applicable + * to top-level resources. Onboarded - this resource has already been onboarded by the specified connector. NotOnboarded + * - this resource has not been onboarded to any connector. NotApplicable - the onboarding state is not applicable to + * the current endpoint. + */ +public final class OnboardingState extends ExpandableStringEnum { + /** Static value NotApplicable for OnboardingState. */ + public static final OnboardingState NOT_APPLICABLE = fromString("NotApplicable"); + + /** Static value OnboardedByOtherConnector for OnboardingState. */ + public static final OnboardingState ONBOARDED_BY_OTHER_CONNECTOR = fromString("OnboardedByOtherConnector"); + + /** Static value Onboarded for OnboardingState. */ + public static final OnboardingState ONBOARDED = fromString("Onboarded"); + + /** Static value NotOnboarded for OnboardingState. */ + public static final OnboardingState NOT_ONBOARDED = fromString("NotOnboarded"); + + /** + * Creates a new instance of OnboardingState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OnboardingState() { + } + + /** + * Creates or finds a OnboardingState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OnboardingState. + */ + @JsonCreator + public static OnboardingState fromString(String name) { + return fromString(name, OnboardingState.class); + } + + /** + * Gets known OnboardingState values. + * + * @return known OnboardingState values. + */ + public static Collection values() { + return values(OnboardingState.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationStatusAutoGenerated.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationStatusAutoGenerated.java new file mode 100644 index 000000000000..d3b8bde5aa90 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationStatusAutoGenerated.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A status describing the success/failure of the enablement/disablement operation. */ +@Fluent +public final class OperationStatusAutoGenerated { + /* + * The operation status code. + */ + @JsonProperty(value = "code") + private String code; + + /* + * Additional information regarding the success/failure of the operation. + */ + @JsonProperty(value = "message") + private String message; + + /** Creates an instance of OperationStatusAutoGenerated class. */ + public OperationStatusAutoGenerated() { + } + + /** + * Get the code property: The operation status code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The operation status code. + * + * @param code the code value to set. + * @return the OperationStatusAutoGenerated object itself. + */ + public OperationStatusAutoGenerated withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: Additional information regarding the success/failure of the operation. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Additional information regarding the success/failure of the operation. + * + * @param message the message value to set. + * @return the OperationStatusAutoGenerated object itself. + */ + public OperationStatusAutoGenerated withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationStatusResult.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationStatusResult.java new file mode 100644 index 000000000000..4cf1e59e7fbf --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationStatusResult.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.security.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. + */ + Float 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 inner com.azure.resourcemanager.security.fluent.models.OperationStatusResultInner object. + * + * @return the inner object. + */ + OperationStatusResultInner innerModel(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceProviders.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceProviders.java new file mode 100644 index 000000000000..92981efe5532 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceProviders.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ResourceProviders. */ +public interface ResourceProviders { + /** + * Updates data sensitivity settings for sensitive data discovery. + * + * @param sensitivitySettings The data sensitivity settings to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery along with {@link Response}. + */ + Response updateSensitivitySettingsWithResponse( + UpdateSensitivitySettingsRequest sensitivitySettings, Context context); + + /** + * Updates data sensitivity settings for sensitive data discovery. + * + * @param sensitivitySettings The data sensitivity settings to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery. + */ + GetSensitivitySettingsResponse updateSensitivitySettings(UpdateSensitivitySettingsRequest sensitivitySettings); + + /** + * Gets data sensitivity settings for sensitive data discovery. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery along with {@link Response}. + */ + Response getSensitivitySettingsWithResponse(Context context); + + /** + * Gets data sensitivity settings for sensitive data discovery. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery. + */ + GetSensitivitySettingsResponse getSensitivitySettings(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleCategory.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleCategory.java new file mode 100644 index 000000000000..aa18fd44a6e4 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleCategory.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Rule categories. Code - code scanning results. Artifact scanning results. Dependencies scanning results. IaC results. + * Secrets scanning results. Container scanning results. + */ +public final class RuleCategory extends ExpandableStringEnum { + /** Static value Code for RuleCategory. */ + public static final RuleCategory CODE = fromString("Code"); + + /** Static value Artifacts for RuleCategory. */ + public static final RuleCategory ARTIFACTS = fromString("Artifacts"); + + /** Static value Dependencies for RuleCategory. */ + public static final RuleCategory DEPENDENCIES = fromString("Dependencies"); + + /** Static value Secrets for RuleCategory. */ + public static final RuleCategory SECRETS = fromString("Secrets"); + + /** Static value IaC for RuleCategory. */ + public static final RuleCategory IAC = fromString("IaC"); + + /** Static value Containers for RuleCategory. */ + public static final RuleCategory CONTAINERS = fromString("Containers"); + + /** + * Creates a new instance of RuleCategory value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleCategory() { + } + + /** + * Creates or finds a RuleCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleCategory. + */ + @JsonCreator + public static RuleCategory fromString(String name) { + return fromString(name, RuleCategory.class); + } + + /** + * Gets known RuleCategory values. + * + * @return known RuleCategory values. + */ + public static Collection values() { + return values(RuleCategory.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleResults.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleResults.java index 68af6ea8d61f..7093c7394cb5 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleResults.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleResults.java @@ -48,11 +48,13 @@ public interface RuleResults { /** The entirety of the RuleResults definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { } + /** The RuleResults definition stages. */ interface DefinitionStages { /** The first stage of the RuleResults definition. */ interface Blank extends WithScope { } + /** The stage of the RuleResults definition allowing to specify parent resource. */ interface WithScope { /** @@ -63,6 +65,7 @@ interface WithScope { */ WithCreate withExistingResourceId(String resourceId); } + /** * The stage of the RuleResults 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. @@ -84,6 +87,7 @@ interface WithCreate */ RuleResults create(Context context); } + /** The stage of the RuleResults definition allowing to specify latestScan. */ interface WithLatestScan { /** @@ -94,6 +98,7 @@ interface WithLatestScan { */ WithCreate withLatestScan(Boolean latestScan); } + /** The stage of the RuleResults definition allowing to specify results. */ interface WithResults { /** @@ -106,6 +111,7 @@ interface WithResults { */ WithCreate withResults(List> results); } + /** The stage of the RuleResults definition allowing to specify workspaceId. */ interface WithWorkspaceId { /** @@ -117,6 +123,7 @@ interface WithWorkspaceId { WithCreate withWorkspaceId(String workspaceId); } } + /** * Begins update for the RuleResults resource. * @@ -141,6 +148,7 @@ interface Update extends UpdateStages.WithLatestScan, UpdateStages.WithResults, */ RuleResults apply(Context context); } + /** The RuleResults update stages. */ interface UpdateStages { /** The stage of the RuleResults update allowing to specify latestScan. */ @@ -153,6 +161,7 @@ interface WithLatestScan { */ Update withLatestScan(Boolean latestScan); } + /** The stage of the RuleResults update allowing to specify results. */ interface WithResults { /** @@ -165,6 +174,7 @@ interface WithResults { */ Update withResults(List> results); } + /** The stage of the RuleResults update allowing to specify workspaceId. */ interface WithWorkspaceId { /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScopeName.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScopeName.java deleted file mode 100644 index b14c4be5daac..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScopeName.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The resource scope of the health report. */ -public final class ScopeName extends ExpandableStringEnum { - /** Static value Connectors for ScopeName. */ - public static final ScopeName CONNECTORS = fromString("Connectors"); - - /** Static value Clusters for ScopeName. */ - public static final ScopeName CLUSTERS = fromString("Clusters"); - - /** Static value VirtualMachines for ScopeName. */ - public static final ScopeName VIRTUAL_MACHINES = fromString("VirtualMachines"); - - /** Static value Unknown for ScopeName. */ - public static final ScopeName UNKNOWN = fromString("Unknown"); - - /** - * Creates a new instance of ScopeName value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ScopeName() { - } - - /** - * Creates or finds a ScopeName from its string representation. - * - * @param name a name to look for. - * @return the corresponding ScopeName. - */ - @JsonCreator - public static ScopeName fromString(String name) { - return fromString(name, ScopeName.class); - } - - /** - * Gets known ScopeName values. - * - * @return known ScopeName values. - */ - public static Collection values() { - return values(ScopeName.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataPartnerData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataPartnerData.java index 27d9d4195c0e..ea8408c7123f 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataPartnerData.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataPartnerData.java @@ -26,7 +26,7 @@ public final class SecurityAssessmentMetadataPartnerData { /* * Secret to authenticate the partner and verify it created the assessment - write only */ - @JsonProperty(value = "secret", required = true) + @JsonProperty(value = "secret") private String secret; /** Creates an instance of SecurityAssessmentMetadataPartnerData class. */ diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponse.java index 51d514a7ddf3..9dc569794774 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponse.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponse.java @@ -156,11 +156,13 @@ public interface SecurityAssessmentMetadataResponse { /** The entirety of the SecurityAssessmentMetadataResponse definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { } + /** The SecurityAssessmentMetadataResponse definition stages. */ interface DefinitionStages { /** The first stage of the SecurityAssessmentMetadataResponse definition. */ interface Blank extends WithCreate { } + /** * The stage of the SecurityAssessmentMetadataResponse 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. @@ -196,6 +198,7 @@ interface WithCreate */ SecurityAssessmentMetadataResponse create(Context context); } + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify publishDates. */ interface WithPublishDates { /** @@ -206,6 +209,7 @@ interface WithPublishDates { */ WithCreate withPublishDates(SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates); } + /** * The stage of the SecurityAssessmentMetadataResponse definition allowing to specify plannedDeprecationDate. */ @@ -218,6 +222,7 @@ interface WithPlannedDeprecationDate { */ WithCreate withPlannedDeprecationDate(String plannedDeprecationDate); } + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify tactics. */ interface WithTactics { /** @@ -228,6 +233,7 @@ interface WithTactics { */ WithCreate withTactics(List tactics); } + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify techniques. */ interface WithTechniques { /** @@ -238,6 +244,7 @@ interface WithTechniques { */ WithCreate withTechniques(List techniques); } + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify displayName. */ interface WithDisplayName { /** @@ -248,6 +255,7 @@ interface WithDisplayName { */ WithCreate withDisplayName(String displayName); } + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify description. */ interface WithDescription { /** @@ -258,6 +266,7 @@ interface WithDescription { */ WithCreate withDescription(String description); } + /** * The stage of the SecurityAssessmentMetadataResponse definition allowing to specify remediationDescription. */ @@ -272,6 +281,7 @@ interface WithRemediationDescription { */ WithCreate withRemediationDescription(String remediationDescription); } + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify categories. */ interface WithCategories { /** @@ -282,6 +292,7 @@ interface WithCategories { */ WithCreate withCategories(List categories); } + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify severity. */ interface WithSeverity { /** @@ -292,6 +303,7 @@ interface WithSeverity { */ WithCreate withSeverity(Severity severity); } + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify userImpact. */ interface WithUserImpact { /** @@ -302,6 +314,7 @@ interface WithUserImpact { */ WithCreate withUserImpact(UserImpact userImpact); } + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify implementationEffort. */ interface WithImplementationEffort { /** @@ -313,6 +326,7 @@ interface WithImplementationEffort { */ WithCreate withImplementationEffort(ImplementationEffort implementationEffort); } + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify threats. */ interface WithThreats { /** @@ -323,6 +337,7 @@ interface WithThreats { */ WithCreate withThreats(List threats); } + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify preview. */ interface WithPreview { /** @@ -333,6 +348,7 @@ interface WithPreview { */ WithCreate withPreview(Boolean preview); } + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify assessmentType. */ interface WithAssessmentType { /** @@ -345,6 +361,7 @@ interface WithAssessmentType { */ WithCreate withAssessmentType(AssessmentType assessmentType); } + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify partnerData. */ interface WithPartnerData { /** @@ -356,6 +373,7 @@ interface WithPartnerData { WithCreate withPartnerData(SecurityAssessmentMetadataPartnerData partnerData); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPartnerData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPartnerData.java index 4dce90e6516d..b759b5d30890 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPartnerData.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPartnerData.java @@ -20,7 +20,7 @@ public final class SecurityAssessmentPartnerData { /* * secret to authenticate the partner - write only */ - @JsonProperty(value = "secret", required = true) + @JsonProperty(value = "secret") private String secret; /** Creates an instance of SecurityAssessmentPartnerData class. */ diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentResponse.java index 36403c276ed8..aa1ab3ff6798 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentResponse.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentResponse.java @@ -91,11 +91,13 @@ public interface SecurityAssessmentResponse { /** The entirety of the SecurityAssessmentResponse definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { } + /** The SecurityAssessmentResponse definition stages. */ interface DefinitionStages { /** The first stage of the SecurityAssessmentResponse definition. */ interface Blank extends WithScope { } + /** The stage of the SecurityAssessmentResponse definition allowing to specify parent resource. */ interface WithScope { /** @@ -106,6 +108,7 @@ interface WithScope { */ WithCreate withExistingResourceId(String resourceId); } + /** * The stage of the SecurityAssessmentResponse 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. @@ -131,6 +134,7 @@ interface WithCreate */ SecurityAssessmentResponse create(Context context); } + /** The stage of the SecurityAssessmentResponse definition allowing to specify status. */ interface WithStatus { /** @@ -141,6 +145,7 @@ interface WithStatus { */ WithCreate withStatus(AssessmentStatus status); } + /** The stage of the SecurityAssessmentResponse definition allowing to specify resourceDetails. */ interface WithResourceDetails { /** @@ -151,6 +156,7 @@ interface WithResourceDetails { */ WithCreate withResourceDetails(ResourceDetails resourceDetails); } + /** The stage of the SecurityAssessmentResponse definition allowing to specify additionalData. */ interface WithAdditionalData { /** @@ -161,6 +167,7 @@ interface WithAdditionalData { */ WithCreate withAdditionalData(Map additionalData); } + /** The stage of the SecurityAssessmentResponse definition allowing to specify metadata. */ interface WithMetadata { /** @@ -171,6 +178,7 @@ interface WithMetadata { */ WithCreate withMetadata(SecurityAssessmentMetadataProperties metadata); } + /** The stage of the SecurityAssessmentResponse definition allowing to specify partnersData. */ interface WithPartnersData { /** @@ -182,6 +190,7 @@ interface WithPartnersData { WithCreate withPartnersData(SecurityAssessmentPartnerData partnersData); } } + /** * Begins update for the SecurityAssessmentResponse resource. * @@ -211,6 +220,7 @@ interface Update */ SecurityAssessmentResponse apply(Context context); } + /** The SecurityAssessmentResponse update stages. */ interface UpdateStages { /** The stage of the SecurityAssessmentResponse update allowing to specify status. */ @@ -223,6 +233,7 @@ interface WithStatus { */ Update withStatus(AssessmentStatus status); } + /** The stage of the SecurityAssessmentResponse update allowing to specify resourceDetails. */ interface WithResourceDetails { /** @@ -233,6 +244,7 @@ interface WithResourceDetails { */ Update withResourceDetails(ResourceDetails resourceDetails); } + /** The stage of the SecurityAssessmentResponse update allowing to specify additionalData. */ interface WithAdditionalData { /** @@ -243,6 +255,7 @@ interface WithAdditionalData { */ Update withAdditionalData(Map additionalData); } + /** The stage of the SecurityAssessmentResponse update allowing to specify metadata. */ interface WithMetadata { /** @@ -253,6 +266,7 @@ interface WithMetadata { */ Update withMetadata(SecurityAssessmentMetadataProperties metadata); } + /** The stage of the SecurityAssessmentResponse update allowing to specify partnersData. */ interface WithPartnersData { /** @@ -264,6 +278,7 @@ interface WithPartnersData { Update withPartnersData(SecurityAssessmentPartnerData partnersData); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnector.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnector.java index 4fa367db0af5..2c8a598c1638 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnector.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnector.java @@ -128,11 +128,13 @@ interface Definition DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } + /** The SecurityConnector definition stages. */ interface DefinitionStages { /** The first stage of the SecurityConnector definition. */ interface Blank extends WithLocation { } + /** The stage of the SecurityConnector definition allowing to specify location. */ interface WithLocation { /** @@ -151,6 +153,7 @@ interface WithLocation { */ WithResourceGroup withRegion(String location); } + /** The stage of the SecurityConnector definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -162,6 +165,7 @@ interface WithResourceGroup { */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the SecurityConnector 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. @@ -187,6 +191,7 @@ interface WithCreate */ SecurityConnector create(Context context); } + /** The stage of the SecurityConnector definition allowing to specify tags. */ interface WithTags { /** @@ -197,6 +202,7 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the SecurityConnector definition allowing to specify hierarchyIdentifier. */ interface WithHierarchyIdentifier { /** @@ -209,6 +215,7 @@ interface WithHierarchyIdentifier { */ WithCreate withHierarchyIdentifier(String hierarchyIdentifier); } + /** The stage of the SecurityConnector definition allowing to specify environmentName. */ interface WithEnvironmentName { /** @@ -219,6 +226,7 @@ interface WithEnvironmentName { */ WithCreate withEnvironmentName(CloudName environmentName); } + /** The stage of the SecurityConnector definition allowing to specify offerings. */ interface WithOfferings { /** @@ -229,6 +237,7 @@ interface WithOfferings { */ WithCreate withOfferings(List offerings); } + /** The stage of the SecurityConnector definition allowing to specify environmentData. */ interface WithEnvironmentData { /** @@ -240,6 +249,7 @@ interface WithEnvironmentData { WithCreate withEnvironmentData(EnvironmentData environmentData); } } + /** * Begins update for the SecurityConnector resource. * @@ -269,6 +279,7 @@ interface Update */ SecurityConnector apply(Context context); } + /** The SecurityConnector update stages. */ interface UpdateStages { /** The stage of the SecurityConnector update allowing to specify tags. */ @@ -281,6 +292,7 @@ interface WithTags { */ Update withTags(Map tags); } + /** The stage of the SecurityConnector update allowing to specify hierarchyIdentifier. */ interface WithHierarchyIdentifier { /** @@ -293,6 +305,7 @@ interface WithHierarchyIdentifier { */ Update withHierarchyIdentifier(String hierarchyIdentifier); } + /** The stage of the SecurityConnector update allowing to specify environmentName. */ interface WithEnvironmentName { /** @@ -303,6 +316,7 @@ interface WithEnvironmentName { */ Update withEnvironmentName(CloudName environmentName); } + /** The stage of the SecurityConnector update allowing to specify offerings. */ interface WithOfferings { /** @@ -313,6 +327,7 @@ interface WithOfferings { */ Update withOfferings(List offerings); } + /** The stage of the SecurityConnector update allowing to specify environmentData. */ interface WithEnvironmentData { /** @@ -324,6 +339,7 @@ interface WithEnvironmentData { Update withEnvironmentData(EnvironmentData environmentData); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContact.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContact.java index c27b37e64543..fc1103ba4b3b 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContact.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContact.java @@ -70,11 +70,13 @@ public interface SecurityContact { /** The entirety of the SecurityContact definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { } + /** The SecurityContact definition stages. */ interface DefinitionStages { /** The first stage of the SecurityContact definition. */ interface Blank extends WithCreate { } + /** * The stage of the SecurityContact 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. @@ -99,6 +101,7 @@ interface WithCreate */ SecurityContact create(Context context); } + /** The stage of the SecurityContact definition allowing to specify emails. */ interface WithEmails { /** @@ -111,6 +114,7 @@ interface WithEmails { */ WithCreate withEmails(String emails); } + /** The stage of the SecurityContact definition allowing to specify phone. */ interface WithPhone { /** @@ -121,6 +125,7 @@ interface WithPhone { */ WithCreate withPhone(String phone); } + /** The stage of the SecurityContact definition allowing to specify alertNotifications. */ interface WithAlertNotifications { /** @@ -132,6 +137,7 @@ interface WithAlertNotifications { */ WithCreate withAlertNotifications(SecurityContactPropertiesAlertNotifications alertNotifications); } + /** The stage of the SecurityContact definition allowing to specify notificationsByRole. */ interface WithNotificationsByRole { /** @@ -145,6 +151,7 @@ interface WithNotificationsByRole { WithCreate withNotificationsByRole(SecurityContactPropertiesNotificationsByRole notificationsByRole); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReportOperations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensitivitySettings.java similarity index 52% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReportOperations.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensitivitySettings.java index df0dbf9b29fe..a9990e6d6636 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReportOperations.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensitivitySettings.java @@ -7,30 +7,25 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of HealthReportOperations. */ -public interface HealthReportOperations { +/** Resource collection API of SensitivitySettings. */ +public interface SensitivitySettings { /** - * Get health report of resource. + * Gets a list with a single sensitivity settings resource. * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource along with {@link Response}. + * @return a list with a single sensitivity settings resource along with {@link Response}. */ - Response getWithResponse(String resourceId, String healthReportName, Context context); + Response listWithResponse(Context context); /** - * Get health report of resource. + * Gets a list with a single sensitivity settings resource. * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource. + * @return a list with a single sensitivity settings resource. */ - HealthReport get(String resourceId, String healthReportName); + GetSensitivitySettingsListResponse list(); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsAzureSettingSelectedProvider.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsAzureSettingSelectedProvider.java new file mode 100644 index 000000000000..135086fe9bd0 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsAzureSettingSelectedProvider.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The selected vulnerability assessments provider on Azure servers in the defined scope. */ +public final class ServerVulnerabilityAssessmentsAzureSettingSelectedProvider + extends ExpandableStringEnum { + /** Static value MdeTvm for ServerVulnerabilityAssessmentsAzureSettingSelectedProvider. */ + public static final ServerVulnerabilityAssessmentsAzureSettingSelectedProvider MDE_TVM = fromString("MdeTvm"); + + /** + * Creates a new instance of ServerVulnerabilityAssessmentsAzureSettingSelectedProvider value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ServerVulnerabilityAssessmentsAzureSettingSelectedProvider() { + } + + /** + * Creates or finds a ServerVulnerabilityAssessmentsAzureSettingSelectedProvider from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServerVulnerabilityAssessmentsAzureSettingSelectedProvider. + */ + @JsonCreator + public static ServerVulnerabilityAssessmentsAzureSettingSelectedProvider fromString(String name) { + return fromString(name, ServerVulnerabilityAssessmentsAzureSettingSelectedProvider.class); + } + + /** + * Gets known ServerVulnerabilityAssessmentsAzureSettingSelectedProvider values. + * + * @return known ServerVulnerabilityAssessmentsAzureSettingSelectedProvider values. + */ + public static Collection values() { + return values(ServerVulnerabilityAssessmentsAzureSettingSelectedProvider.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSetting.java new file mode 100644 index 000000000000..7856423108db --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSetting.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsSettingInner; + +/** An immutable client-side representation of ServerVulnerabilityAssessmentsSetting. */ +public interface ServerVulnerabilityAssessmentsSetting { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsSettingInner + * object. + * + * @return the inner object. + */ + ServerVulnerabilityAssessmentsSettingInner innerModel(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettingKind.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettingKind.java new file mode 100644 index 000000000000..241739a3857e --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettingKind.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The kind of the server vulnerability assessments setting. */ +public final class ServerVulnerabilityAssessmentsSettingKind + extends ExpandableStringEnum { + /** Static value AzureServersSetting for ServerVulnerabilityAssessmentsSettingKind. */ + public static final ServerVulnerabilityAssessmentsSettingKind AZURE_SERVERS_SETTING = + fromString("AzureServersSetting"); + + /** + * Creates a new instance of ServerVulnerabilityAssessmentsSettingKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ServerVulnerabilityAssessmentsSettingKind() { + } + + /** + * Creates or finds a ServerVulnerabilityAssessmentsSettingKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServerVulnerabilityAssessmentsSettingKind. + */ + @JsonCreator + public static ServerVulnerabilityAssessmentsSettingKind fromString(String name) { + return fromString(name, ServerVulnerabilityAssessmentsSettingKind.class); + } + + /** + * Gets known ServerVulnerabilityAssessmentsSettingKind values. + * + * @return known ServerVulnerabilityAssessmentsSettingKind values. + */ + public static Collection values() { + return values(ServerVulnerabilityAssessmentsSettingKind.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettingKindName.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettingKindName.java new file mode 100644 index 000000000000..61dd66938759 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettingKindName.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ServerVulnerabilityAssessmentsSettingKindName. */ +public final class ServerVulnerabilityAssessmentsSettingKindName + extends ExpandableStringEnum { + /** Static value azureServersSetting for ServerVulnerabilityAssessmentsSettingKindName. */ + public static final ServerVulnerabilityAssessmentsSettingKindName AZURE_SERVERS_SETTING = + fromString("azureServersSetting"); + + /** + * Creates a new instance of ServerVulnerabilityAssessmentsSettingKindName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ServerVulnerabilityAssessmentsSettingKindName() { + } + + /** + * Creates or finds a ServerVulnerabilityAssessmentsSettingKindName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServerVulnerabilityAssessmentsSettingKindName. + */ + @JsonCreator + public static ServerVulnerabilityAssessmentsSettingKindName fromString(String name) { + return fromString(name, ServerVulnerabilityAssessmentsSettingKindName.class); + } + + /** + * Gets known ServerVulnerabilityAssessmentsSettingKindName values. + * + * @return known ServerVulnerabilityAssessmentsSettingKindName values. + */ + public static Collection values() { + return values(ServerVulnerabilityAssessmentsSettingKindName.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettings.java new file mode 100644 index 000000000000..d39811f7b838 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettings.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.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.security.fluent.models.ServerVulnerabilityAssessmentsSettingInner; + +/** Resource collection API of ServerVulnerabilityAssessmentsSettings. */ +public interface ServerVulnerabilityAssessmentsSettings { + /** + * Get a list of all the server vulnerability assessments settings over a subscription level scope. + * + * @throws com.azure.core.management.exception.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 all the server vulnerability assessments settings over a subscription level scope as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Get a list of all the server vulnerability assessments settings over a subscription level scope. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 all the server vulnerability assessments settings over a subscription level scope as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Get a server vulnerability assessments setting of the requested kind, that is set on the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 server vulnerability assessments setting of the requested kind, that is set on the subscription along + * with {@link Response}. + */ + Response getWithResponse( + ServerVulnerabilityAssessmentsSettingKindName settingKind, Context context); + + /** + * Get a server vulnerability assessments setting of the requested kind, that is set on the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 server vulnerability assessments setting of the requested kind, that is set on the subscription. + */ + ServerVulnerabilityAssessmentsSetting get(ServerVulnerabilityAssessmentsSettingKindName settingKind); + + /** + * Create or update a server vulnerability assessments setting of the requested kind on the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @param serverVulnerabilityAssessmentsSetting A server vulnerability assessments setting over a predefined scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 base vulnerability assessments setting on servers in the defined scope along with {@link Response}. + */ + Response createOrUpdateWithResponse( + ServerVulnerabilityAssessmentsSettingKindName settingKind, + ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting, + Context context); + + /** + * Create or update a server vulnerability assessments setting of the requested kind on the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @param serverVulnerabilityAssessmentsSetting A server vulnerability assessments setting over a predefined scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 base vulnerability assessments setting on servers in the defined scope. + */ + ServerVulnerabilityAssessmentsSetting createOrUpdate( + ServerVulnerabilityAssessmentsSettingKindName settingKind, + ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting); + + /** + * Delete the server vulnerability assessments setting of the requested kind from the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(ServerVulnerabilityAssessmentsSettingKindName settingKind, Context context); + + /** + * Delete the server vulnerability assessments setting of the requested kind from the subscription. + * + * @param settingKind The kind of the server vulnerability assessments setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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(ServerVulnerabilityAssessmentsSettingKindName settingKind); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettingList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettingsList.java similarity index 60% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettingList.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettingsList.java index 4824d85ba158..9b69ad85b7f9 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettingList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettingsList.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.security.models; import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingInner; +import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsSettingInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of ingestion settings. */ +/** A page of a server vulnerability assessments settings list. */ @Immutable -public final class IngestionSettingList { +public final class ServerVulnerabilityAssessmentsSettingsList { /* - * List of ingestion settings + * A collection of server vulnerability assessments settings in this page */ @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; + private List value; /* - * The URI to fetch the next page. + * The URI to fetch the next page */ @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of IngestionSettingList class. */ - public IngestionSettingList() { + /** Creates an instance of ServerVulnerabilityAssessmentsSettingsList class. */ + public ServerVulnerabilityAssessmentsSettingsList() { } /** - * Get the value property: List of ingestion settings. + * Get the value property: A collection of server vulnerability assessments settings in this page. * * @return the value value. */ - public List value() { + public List value() { return this.value; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingNameAutoGenerated.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingNameAutoGenerated.java new file mode 100644 index 000000000000..ebe205a7c244 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingNameAutoGenerated.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SettingNameAutoGenerated. */ +public final class SettingNameAutoGenerated extends ExpandableStringEnum { + /** Static value current for SettingNameAutoGenerated. */ + public static final SettingNameAutoGenerated CURRENT = fromString("current"); + + /** + * Creates a new instance of SettingNameAutoGenerated value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SettingNameAutoGenerated() { + } + + /** + * Creates or finds a SettingNameAutoGenerated from its string representation. + * + * @param name a name to look for. + * @return the corresponding SettingNameAutoGenerated. + */ + @JsonCreator + public static SettingNameAutoGenerated fromString(String name) { + return fromString(name, SettingNameAutoGenerated.class); + } + + /** + * Gets known SettingNameAutoGenerated values. + * + * @return known SettingNameAutoGenerated values. + */ + public static Collection values() { + return values(SettingNameAutoGenerated.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusAutoGenerated.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusAutoGenerated.java index 9332eaf6883c..c5b1d96f5135 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusAutoGenerated.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusAutoGenerated.java @@ -17,6 +17,18 @@ public final class StatusAutoGenerated { @JsonProperty(value = "code") private StatusName code; + /* + * The reason of the given status + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /* + * The date of when the resource was scanned in the last time + */ + @JsonProperty(value = "lastScannedDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastScannedDate; + /* * The date of when the status of the health report was changed in the last time */ @@ -53,6 +65,24 @@ public StatusAutoGenerated withCode(StatusName code) { return this; } + /** + * Get the reason property: The reason of the given status. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Get the lastScannedDate property: The date of when the resource was scanned in the last time. + * + * @return the lastScannedDate value. + */ + public OffsetDateTime lastScannedDate() { + return this.lastScannedDate; + } + /** * Get the statusChangeDate property: The date of when the status of the health report was changed in the last time. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TargetBranchConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TargetBranchConfiguration.java new file mode 100644 index 000000000000..b806f9046428 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TargetBranchConfiguration.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Repository branch configuration for PR Annotations. */ +@Fluent +public final class TargetBranchConfiguration { + /* + * Gets or sets branches that should have annotations. + */ + @JsonProperty(value = "branchNames") + private List branchNames; + + /* + * Configuration of PR Annotations on default branch. + * + * Enabled - PR Annotations are enabled on the resource's default branch. + * Disabled - PR Annotations are disabled on the resource's default branch. + */ + @JsonProperty(value = "annotateDefaultBranch") + private AnnotateDefaultBranchState annotateDefaultBranch; + + /** Creates an instance of TargetBranchConfiguration class. */ + public TargetBranchConfiguration() { + } + + /** + * Get the branchNames property: Gets or sets branches that should have annotations. + * + * @return the branchNames value. + */ + public List branchNames() { + return this.branchNames; + } + + /** + * Set the branchNames property: Gets or sets branches that should have annotations. + * + * @param branchNames the branchNames value to set. + * @return the TargetBranchConfiguration object itself. + */ + public TargetBranchConfiguration withBranchNames(List branchNames) { + this.branchNames = branchNames; + return this; + } + + /** + * Get the annotateDefaultBranch property: Configuration of PR Annotations on default branch. + * + *

Enabled - PR Annotations are enabled on the resource's default branch. Disabled - PR Annotations are disabled + * on the resource's default branch. + * + * @return the annotateDefaultBranch value. + */ + public AnnotateDefaultBranchState annotateDefaultBranch() { + return this.annotateDefaultBranch; + } + + /** + * Set the annotateDefaultBranch property: Configuration of PR Annotations on default branch. + * + *

Enabled - PR Annotations are enabled on the resource's default branch. Disabled - PR Annotations are disabled + * on the resource's default branch. + * + * @param annotateDefaultBranch the annotateDefaultBranch value to set. + * @return the TargetBranchConfiguration object itself. + */ + public TargetBranchConfiguration withAnnotateDefaultBranch(AnnotateDefaultBranchState annotateDefaultBranch) { + this.annotateDefaultBranch = annotateDefaultBranch; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpdateSensitivitySettingsRequest.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpdateSensitivitySettingsRequest.java new file mode 100644 index 000000000000..e001d9d631eb --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpdateSensitivitySettingsRequest.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.UUID; + +/** Request to update data sensitivity settings for sensitive data discovery. */ +@Fluent +public final class UpdateSensitivitySettingsRequest { + /* + * List of selected sensitive info types' IDs. + */ + @JsonProperty(value = "sensitiveInfoTypesIds", required = true) + private List sensitiveInfoTypesIds; + + /* + * The order of the sensitivity threshold label. Any label at or above this order will be considered sensitive. If + * set to -1, sensitivity by labels is turned off + */ + @JsonProperty(value = "sensitivityThresholdLabelOrder") + private Float sensitivityThresholdLabelOrder; + + /* + * The id of the sensitivity threshold label. Any label at or above this rank will be considered sensitive. + */ + @JsonProperty(value = "sensitivityThresholdLabelId") + private UUID sensitivityThresholdLabelId; + + /** Creates an instance of UpdateSensitivitySettingsRequest class. */ + public UpdateSensitivitySettingsRequest() { + } + + /** + * Get the sensitiveInfoTypesIds property: List of selected sensitive info types' IDs. + * + * @return the sensitiveInfoTypesIds value. + */ + public List sensitiveInfoTypesIds() { + return this.sensitiveInfoTypesIds; + } + + /** + * Set the sensitiveInfoTypesIds property: List of selected sensitive info types' IDs. + * + * @param sensitiveInfoTypesIds the sensitiveInfoTypesIds value to set. + * @return the UpdateSensitivitySettingsRequest object itself. + */ + public UpdateSensitivitySettingsRequest withSensitiveInfoTypesIds(List sensitiveInfoTypesIds) { + this.sensitiveInfoTypesIds = sensitiveInfoTypesIds; + return this; + } + + /** + * Get the sensitivityThresholdLabelOrder property: The order of the sensitivity threshold label. Any label at or + * above this order will be considered sensitive. If set to -1, sensitivity by labels is turned off. + * + * @return the sensitivityThresholdLabelOrder value. + */ + public Float sensitivityThresholdLabelOrder() { + return this.sensitivityThresholdLabelOrder; + } + + /** + * Set the sensitivityThresholdLabelOrder property: The order of the sensitivity threshold label. Any label at or + * above this order will be considered sensitive. If set to -1, sensitivity by labels is turned off. + * + * @param sensitivityThresholdLabelOrder the sensitivityThresholdLabelOrder value to set. + * @return the UpdateSensitivitySettingsRequest object itself. + */ + public UpdateSensitivitySettingsRequest withSensitivityThresholdLabelOrder(Float sensitivityThresholdLabelOrder) { + this.sensitivityThresholdLabelOrder = sensitivityThresholdLabelOrder; + return this; + } + + /** + * Get the sensitivityThresholdLabelId property: The id of the sensitivity threshold label. Any label at or above + * this rank will be considered sensitive. + * + * @return the sensitivityThresholdLabelId value. + */ + public UUID sensitivityThresholdLabelId() { + return this.sensitivityThresholdLabelId; + } + + /** + * Set the sensitivityThresholdLabelId property: The id of the sensitivity threshold label. Any label at or above + * this rank will be considered sensitive. + * + * @param sensitivityThresholdLabelId the sensitivityThresholdLabelId value to set. + * @return the UpdateSensitivitySettingsRequest object itself. + */ + public UpdateSensitivitySettingsRequest withSensitivityThresholdLabelId(UUID sensitivityThresholdLabelId) { + this.sensitivityThresholdLabelId = sensitivityThresholdLabelId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sensitiveInfoTypesIds() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sensitiveInfoTypesIds in model UpdateSensitivitySettingsRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UpdateSensitivitySettingsRequest.class); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/WorkspaceSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/WorkspaceSetting.java index c6b7717a0ce0..c7f252084f97 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/WorkspaceSetting.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/WorkspaceSetting.java @@ -55,11 +55,13 @@ public interface WorkspaceSetting { /** The entirety of the WorkspaceSetting definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { } + /** The WorkspaceSetting definition stages. */ interface DefinitionStages { /** The first stage of the WorkspaceSetting definition. */ interface Blank extends WithCreate { } + /** * The stage of the WorkspaceSetting 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. @@ -80,6 +82,7 @@ interface WithCreate extends DefinitionStages.WithWorkspaceId, DefinitionStages. */ WorkspaceSetting create(Context context); } + /** The stage of the WorkspaceSetting definition allowing to specify workspaceId. */ interface WithWorkspaceId { /** @@ -90,6 +93,7 @@ interface WithWorkspaceId { */ WithCreate withWorkspaceId(String workspaceId); } + /** The stage of the WorkspaceSetting definition allowing to specify scope. */ interface WithScope { /** @@ -103,6 +107,7 @@ interface WithScope { WithCreate withScope(String scope); } } + /** * Begins update for the WorkspaceSetting resource. * @@ -127,6 +132,7 @@ interface Update extends UpdateStages.WithWorkspaceId, UpdateStages.WithScope { */ WorkspaceSetting apply(Context context); } + /** The WorkspaceSetting update stages. */ interface UpdateStages { /** The stage of the WorkspaceSetting update allowing to specify workspaceId. */ @@ -139,6 +145,7 @@ interface WithWorkspaceId { */ Update withWorkspaceId(String workspaceId); } + /** The stage of the WorkspaceSetting update allowing to specify scope. */ interface WithScope { /** @@ -152,6 +159,7 @@ interface WithScope { Update withScope(String scope); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-security/proxy-config.json b/sdk/security/azure-resourcemanager-security/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-security/proxy-config.json new file mode 100644 index 000000000000..d4e8137b0664 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-security/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.security.implementation.MdeOnboardingsClientImpl$MdeOnboardingsService" ], [ "com.azure.resourcemanager.security.implementation.CustomAssessmentAutomationsClientImpl$CustomAssessmentAutomationsService" ], [ "com.azure.resourcemanager.security.implementation.CustomEntityStoreAssignmentsClientImpl$CustomEntityStoreAssignmentsService" ], [ "com.azure.resourcemanager.security.implementation.ComplianceResultsClientImpl$ComplianceResultsService" ], [ "com.azure.resourcemanager.security.implementation.PricingsClientImpl$PricingsService" ], [ "com.azure.resourcemanager.security.implementation.AdvancedThreatProtectionsClientImpl$AdvancedThreatProtectionsService" ], [ "com.azure.resourcemanager.security.implementation.DeviceSecurityGroupsClientImpl$DeviceSecurityGroupsService" ], [ "com.azure.resourcemanager.security.implementation.IotSecuritySolutionsClientImpl$IotSecuritySolutionsService" ], [ "com.azure.resourcemanager.security.implementation.IotSecuritySolutionAnalyticsClientImpl$IotSecuritySolutionAnalyticsService" ], [ "com.azure.resourcemanager.security.implementation.IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl$IotSecuritySolutionsAnalyticsAggregatedAlertsService" ], [ "com.azure.resourcemanager.security.implementation.IotSecuritySolutionsAnalyticsRecommendationsClientImpl$IotSecuritySolutionsAnalyticsRecommendationsService" ], [ "com.azure.resourcemanager.security.implementation.LocationsClientImpl$LocationsService" ], [ "com.azure.resourcemanager.security.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.security.implementation.TasksClientImpl$TasksService" ], [ "com.azure.resourcemanager.security.implementation.AutoProvisioningSettingsClientImpl$AutoProvisioningSettingsService" ], [ "com.azure.resourcemanager.security.implementation.CompliancesClientImpl$CompliancesService" ], [ "com.azure.resourcemanager.security.implementation.InformationProtectionPoliciesClientImpl$InformationProtectionPoliciesService" ], [ "com.azure.resourcemanager.security.implementation.SecurityContactsClientImpl$SecurityContactsService" ], [ "com.azure.resourcemanager.security.implementation.WorkspaceSettingsClientImpl$WorkspaceSettingsService" ], [ "com.azure.resourcemanager.security.implementation.RegulatoryComplianceStandardsClientImpl$RegulatoryComplianceStandardsService" ], [ "com.azure.resourcemanager.security.implementation.RegulatoryComplianceControlsClientImpl$RegulatoryComplianceControlsService" ], [ "com.azure.resourcemanager.security.implementation.RegulatoryComplianceAssessmentsClientImpl$RegulatoryComplianceAssessmentsService" ], [ "com.azure.resourcemanager.security.implementation.SubAssessmentsClientImpl$SubAssessmentsService" ], [ "com.azure.resourcemanager.security.implementation.AutomationsClientImpl$AutomationsService" ], [ "com.azure.resourcemanager.security.implementation.AlertsSuppressionRulesClientImpl$AlertsSuppressionRulesService" ], [ "com.azure.resourcemanager.security.implementation.ServerVulnerabilityAssessmentsClientImpl$ServerVulnerabilityAssessmentsService" ], [ "com.azure.resourcemanager.security.implementation.AssessmentsMetadatasClientImpl$AssessmentsMetadatasService" ], [ "com.azure.resourcemanager.security.implementation.AssessmentsClientImpl$AssessmentsService" ], [ "com.azure.resourcemanager.security.implementation.AdaptiveApplicationControlsClientImpl$AdaptiveApplicationControlsService" ], [ "com.azure.resourcemanager.security.implementation.AdaptiveNetworkHardeningsClientImpl$AdaptiveNetworkHardeningsService" ], [ "com.azure.resourcemanager.security.implementation.AllowedConnectionsClientImpl$AllowedConnectionsService" ], [ "com.azure.resourcemanager.security.implementation.TopologiesClientImpl$TopologiesService" ], [ "com.azure.resourcemanager.security.implementation.JitNetworkAccessPoliciesClientImpl$JitNetworkAccessPoliciesService" ], [ "com.azure.resourcemanager.security.implementation.DiscoveredSecuritySolutionsClientImpl$DiscoveredSecuritySolutionsService" ], [ "com.azure.resourcemanager.security.implementation.SecuritySolutionsReferenceDatasClientImpl$SecuritySolutionsReferenceDatasService" ], [ "com.azure.resourcemanager.security.implementation.ExternalSecuritySolutionsClientImpl$ExternalSecuritySolutionsService" ], [ "com.azure.resourcemanager.security.implementation.SecureScoresClientImpl$SecureScoresService" ], [ "com.azure.resourcemanager.security.implementation.SecureScoreControlsClientImpl$SecureScoreControlsService" ], [ "com.azure.resourcemanager.security.implementation.SecureScoreControlDefinitionsClientImpl$SecureScoreControlDefinitionsService" ], [ "com.azure.resourcemanager.security.implementation.SecuritySolutionsClientImpl$SecuritySolutionsService" ], [ "com.azure.resourcemanager.security.implementation.ConnectorsClientImpl$ConnectorsService" ], [ "com.azure.resourcemanager.security.implementation.ResourceProvidersClientImpl$ResourceProvidersService" ], [ "com.azure.resourcemanager.security.implementation.SensitivitySettingsClientImpl$SensitivitySettingsService" ], [ "com.azure.resourcemanager.security.implementation.AlertsClientImpl$AlertsService" ], [ "com.azure.resourcemanager.security.implementation.SettingsClientImpl$SettingsService" ], [ "com.azure.resourcemanager.security.implementation.SoftwareInventoriesClientImpl$SoftwareInventoriesService" ], [ "com.azure.resourcemanager.security.implementation.GovernanceRulesClientImpl$GovernanceRulesService" ], [ "com.azure.resourcemanager.security.implementation.GovernanceAssignmentsClientImpl$GovernanceAssignmentsService" ], [ "com.azure.resourcemanager.security.implementation.ApplicationsClientImpl$ApplicationsService" ], [ "com.azure.resourcemanager.security.implementation.ApplicationOperationsClientImpl$ApplicationOperationsService" ], [ "com.azure.resourcemanager.security.implementation.SecurityConnectorApplicationsClientImpl$SecurityConnectorApplicationsService" ], [ "com.azure.resourcemanager.security.implementation.SecurityConnectorApplicationOperationsClientImpl$SecurityConnectorApplicationOperationsService" ], [ "com.azure.resourcemanager.security.implementation.ApiCollectionsClientImpl$ApiCollectionsService" ], [ "com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentScansClientImpl$SqlVulnerabilityAssessmentScansService" ], [ "com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentScanResultsClientImpl$SqlVulnerabilityAssessmentScanResultsService" ], [ "com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentBaselineRulesClientImpl$SqlVulnerabilityAssessmentBaselineRulesService" ], [ "com.azure.resourcemanager.security.implementation.SecurityOperatorsClientImpl$SecurityOperatorsService" ], [ "com.azure.resourcemanager.security.implementation.ServerVulnerabilityAssessmentsSettingsClientImpl$ServerVulnerabilityAssessmentsSettingsService" ], [ "com.azure.resourcemanager.security.implementation.HealthReportsClientImpl$HealthReportsService" ], [ "com.azure.resourcemanager.security.implementation.DefenderForStoragesClientImpl$DefenderForStoragesService" ], [ "com.azure.resourcemanager.security.implementation.AzureDevOpsOrgsClientImpl$AzureDevOpsOrgsService" ], [ "com.azure.resourcemanager.security.implementation.AzureDevOpsProjectsClientImpl$AzureDevOpsProjectsService" ], [ "com.azure.resourcemanager.security.implementation.AzureDevOpsReposClientImpl$AzureDevOpsReposService" ], [ "com.azure.resourcemanager.security.implementation.DevOpsConfigurationsClientImpl$DevOpsConfigurationsService" ], [ "com.azure.resourcemanager.security.implementation.GitHubOwnersClientImpl$GitHubOwnersService" ], [ "com.azure.resourcemanager.security.implementation.GitHubReposClientImpl$GitHubReposService" ], [ "com.azure.resourcemanager.security.implementation.GitLabGroupsClientImpl$GitLabGroupsService" ], [ "com.azure.resourcemanager.security.implementation.GitLabSubgroupsClientImpl$GitLabSubgroupsService" ], [ "com.azure.resourcemanager.security.implementation.GitLabProjectsClientImpl$GitLabProjectsService" ], [ "com.azure.resourcemanager.security.implementation.DevOpsOperationResultsClientImpl$DevOpsOperationResultsService" ], [ "com.azure.resourcemanager.security.implementation.SecurityConnectorsClientImpl$SecurityConnectorsService" ] ] \ No newline at end of file diff --git a/sdk/security/azure-resourcemanager-security/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-security/reflect-config.json b/sdk/security/azure-resourcemanager-security/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-security/reflect-config.json new file mode 100644 index 000000000000..90d9ca83ff90 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-security/reflect-config.json @@ -0,0 +1,2811 @@ +[ { + "name" : "com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataListInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.CustomAssessmentAutomationRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationRequestProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.CustomAssessmentAutomationsListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.CustomEntityStoreAssignmentRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentRequestProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.CustomEntityStoreAssignmentsListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ComplianceResultList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ComplianceResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ComplianceResultProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.PricingListInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.PricingInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.PricingProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Extension", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.OperationStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AdvancedThreatProtectionSettingInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AdvancedThreatProtectionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DeviceSecurityGroupList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ThresholdCustomAlertRule", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.CustomAlertRule", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.TimeWindowCustomAlertRule", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AllowlistCustomAlertRule", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ListCustomAlertRule", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DenylistCustomAlertRule", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.IoTSecuritySolutionsList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionModelInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.UserDefinedResourcesProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.RecommendationConfigurationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AdditionalWorkspacesProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.TagsResource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.UpdateIotSecuritySolutionData", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.UpdateIoTSecuritySolutionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelListInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.IoTSeverityMetrics", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.IoTSecurityAlertedDevice", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.IoTSecurityDeviceAlert", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.IoTSecurityDeviceRecommendation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlertList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedAlertInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedAlertProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.IoTSecurityAggregatedRecommendationList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AscLocationList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AscLocationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.OperationList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.OperationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.OperationDisplay", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecurityTaskList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecurityTaskInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecurityTaskProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecurityTaskParameters", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AutoProvisioningSettingList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ComplianceList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ComplianceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ComplianceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ComplianceSegment", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.InformationProtectionPolicyInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.InformationProtectionPolicyProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SensitivityLabel", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.InformationType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.InformationProtectionKeyword", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.InformationProtectionPolicyList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecurityContactList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecurityContactInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecurityContactProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecurityContactPropertiesAlertNotifications", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.WorkspaceSettingList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.WorkspaceSettingInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.WorkspaceSettingProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.RegulatoryComplianceStandardList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.RegulatoryComplianceControlList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.RegulatoryComplianceAssessmentList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecuritySubAssessmentList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecuritySubAssessmentInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecuritySubAssessmentProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SubAssessmentStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ResourceDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AdditionalData", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AutomationList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AutomationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AutomationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AutomationScope", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AutomationSource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AutomationRuleSet", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AutomationTriggeringRule", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AutomationAction", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AzureTrackedResourceLocation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.KindAutoGenerated", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Etag", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Tags", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AlertsSuppressionRulesList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SuppressionAlertsScope", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ScopeElement", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsListInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecurityAssessmentMetadataResponseList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataPropertiesResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPartnerData", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecurityAssessmentList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecurityAssessmentPropertiesResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AssessmentStatusResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AssessmentStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecurityAssessmentPropertiesBase", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AssessmentLinks", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecurityAssessmentPartnerData", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecurityAssessment", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecurityAssessmentProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupsInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupData", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ProtectionMode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AdaptiveApplicationControlIssueSummary", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.VmRecommendation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.PathRecommendation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.PublisherInfo", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.UserRecommendation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Location", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AdaptiveNetworkHardeningsList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AdaptiveNetworkHardeningInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AdaptiveNetworkHardeningProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Rule", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.EffectiveNetworkSecurityGroups", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AdaptiveNetworkHardeningEnforceRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AllowedConnectionsList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AllowedConnectionsResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AllowedConnectionsResourceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ConnectableResource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ConnectedResource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.TopologyList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.TopologyResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.TopologyResourceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.TopologySingleResource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.TopologySingleResourceParent", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.TopologySingleResourceChild", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.JitNetworkAccessPoliciesList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.JitNetworkAccessPolicyVirtualMachine", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.JitNetworkAccessPortRule", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.JitNetworkAccessRequestVirtualMachine", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.JitNetworkAccessRequestPort", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateVirtualMachine", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiatePort", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DiscoveredSecuritySolutionList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecuritySolutionsReferenceDataListInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecuritySolutionsReferenceData", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecuritySolutionsReferenceDataProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ExternalSecuritySolutionList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecureScoresList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecureScoreItemInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecureScoreItemProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ScoreDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecureScoreControlList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecureScoreControlDetailsInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecureScoreControlScoreDetailsInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecureScoreControlDefinitionSource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AzureResourceLink", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecureScoreControlDefinitionList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecuritySolutionList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecuritySolutionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecuritySolutionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ConnectorSettingList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ConnectorSettingProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.HybridComputeSettingsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ProxyServerProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ServicePrincipalProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AuthenticationDetailsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GetSensitivitySettingsResponseProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GetSensitivitySettingsResponsePropertiesMipInformation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Label", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.InfoType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.BuiltInInfoType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AlertList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AlertInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AlertProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ResourceIdentifier", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AlertEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AlertPropertiesSupportingEvidence", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AlertSimulatorRequestBody", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AlertSimulatorRequestProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SettingsList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SettingInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SoftwaresList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SoftwareInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SoftwareProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GovernanceRuleList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.GovernanceRuleProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GovernanceRuleMetadata", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GovernanceAssignmentsList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.GovernanceAssignmentInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.GovernanceAssignmentProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.RemediationEta", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GovernanceEmailNotification", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GovernanceAssignmentAdditionalData", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ApplicationsList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ApplicationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ApplicationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ApiCollectionList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ApiCollectionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ApiCollectionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ScanInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ScanProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ScansInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ScanResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ScanResultProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Remediation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.BaselineAdjustedResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Baseline", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.VaRule", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.QueryCheck", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.BenchmarkReference", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ScanResultsInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.RuleResultsInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.RuleResultsInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.RuleResultsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.RulesResultsInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.RulesResultsInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecurityOperatorListInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecurityOperatorInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Identity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingsList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsSettingInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.HealthReportsList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.HealthReportInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.HealthReportProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ResourceDetailsAutoGenerated", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.EnvironmentDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.HealthDataClassification", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.StatusAutoGenerated", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Issue", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.DefenderForStorageSettingInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.DefenderForStorageSettingProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.MalwareScanningProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.OnUploadProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.OperationStatusAutoGenerated", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SensitiveDataDiscoveryProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgListResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AzureDevOpsOrgProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ActionableRemediation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.CategoryConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.TargetBranchConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AzureDevOpsProjectListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AzureDevOpsProjectProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AzureDevOpsRepositoryListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AzureDevOpsRepositoryProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DevOpsConfigurationListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DevOpsConfigurationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Authorization", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.GitHubOwnerListResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.GitHubOwnerInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GitHubOwnerProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GitHubRepositoryListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.GitHubRepositoryInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GitHubRepositoryProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.GitLabGroupInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GitLabGroupProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GitLabProjectListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.GitLabProjectInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GitLabProjectProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.OperationStatusResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecurityConnectorsList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.SecurityConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.CloudOffering", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.EnvironmentData", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ConnectionToIpNotAllowed", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ConnectionFromIpNotAllowed", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.LocalUserNotAllowed", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ProcessNotAllowed", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ActiveConnectionsNotInAllowedRange", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AmqpC2DMessagesNotInAllowedRange", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.MqttC2DMessagesNotInAllowedRange", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.HttpC2DMessagesNotInAllowedRange", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AmqpC2DRejectedMessagesNotInAllowedRange", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.MqttC2DRejectedMessagesNotInAllowedRange", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.HttpC2DRejectedMessagesNotInAllowedRange", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AmqpD2CMessagesNotInAllowedRange", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.MqttD2CMessagesNotInAllowedRange", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.HttpD2CMessagesNotInAllowedRange", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DirectMethodInvokesNotInAllowedRange", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.FailedLocalLoginsNotInAllowedRange", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.FileUploadsNotInAllowedRange", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.QueuePurgesNotInAllowedRange", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.TwinUpdatesNotInAllowedRange", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.UnauthorizedOperationsNotInAllowedRange", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SqlServerVulnerabilityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ContainerRegistryVulnerabilityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Cvss", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Cve", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.VendorReference", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ServerVulnerabilityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AutomationActionLogicApp", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AutomationActionEventHub", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AutomationActionWorkspace", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.CefExternalSecuritySolution", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.CefSolutionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ExternalSecuritySolutionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ConnectedWorkspace", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AtaExternalSecuritySolution", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AtaSolutionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AadExternalSecuritySolution", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AadSolutionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AadConnectivityStateAutoGenerated", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AwsCredsAuthenticationDetailsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AwAssumeRoleAuthenticationDetailsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GcpCredentialsDetailsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AzureResourceIdentifier", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.LogAnalyticsIdentifier", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AlertSimulatorBundlesRequestProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DataExportSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.DataExportSettingProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AlertSyncSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.AlertSyncSettingProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AzureServersSetting", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsAzureSettingProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AwsEnvironmentData", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AwsOrganizationalData", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AwsOrganizationalDataMaster", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AwsOrganizationalDataMember", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GcpProjectEnvironmentData", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GcpOrganizationalData", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GcpProjectDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GcpOrganizationalDataOrganization", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GcpOrganizationalDataMember", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GithubScopeEnvironmentData", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AzureDevOpsScopeEnvironmentData", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GitlabScopeEnvironmentData", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.CspmMonitorAwsOffering", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.CspmMonitorAwsOfferingNativeCloudConnection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForContainersAwsOffering", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingKubernetesService", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingKubernetesScubaReader", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingCloudWatchToKinesis", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingKinesisToS3", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingContainerVulnerabilityAssessment", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingMdcContainersImageAssessment", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForServersAwsOffering", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingDefenderForServers", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingArcAutoProvisioning", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingArcAutoProvisioningConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVaAutoProvisioning", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVaAutoProvisioningConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingMdeAutoProvisioning", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingSubPlan", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVmScanners", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVmScannersConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOffering", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingArcAutoProvisioning", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingRds", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingDatabasesDspm", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.InformationProtectionAwsOffering", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.InformationProtectionAwsOfferingInformationProtection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.CspmMonitorGcpOffering", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.CspmMonitorGcpOfferingNativeCloudConnection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForServersGcpOffering", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingDefenderForServers", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingArcAutoProvisioning", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingArcAutoProvisioningConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVaAutoProvisioning", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVaAutoProvisioningConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingMdeAutoProvisioning", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingSubPlan", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVmScanners", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVmScannersConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForDatabasesGcpOffering", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForDatabasesGcpOfferingArcAutoProvisioning", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForContainersGcpOffering", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForContainersGcpOfferingNativeCloudConnection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForContainersGcpOfferingMdcContainersImageAssessment", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.CspmMonitorGithubOffering", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.CspmMonitorAzureDevOpsOffering", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderCspmAwsOffering", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingVmScanners", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingVmScannersConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingDataSensitivityDiscovery", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingDatabasesDspm", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingCiem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingCiemDiscovery", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingCiemOidc", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingMdcContainersImageAssessment", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderCspmGcpOffering", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderCspmGcpOfferingCiemDiscovery", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderCspmGcpOfferingVmScanners", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderCspmGcpOfferingVmScannersConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderCspmGcpOfferingDataSensitivityDiscovery", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderCspmGcpOfferingMdcContainersImageAssessment", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForDevOpsGithubOffering", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForDevOpsAzureDevOpsOffering", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.CspmMonitorGitLabOffering", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DefenderForDevOpsGitLabOffering", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AzureResourceDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.OnPremiseResourceDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.OnPremiseSqlResourceDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.TrackedResource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GovernanceRulesOperationResultsHeaders", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SupportedCloudEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SeverityEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ResourceStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.PricingTier", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.IsEnabled", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Code", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ValueType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecuritySolutionStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ExportData", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DataSource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.RecommendationType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.RecommendationConfigStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AdditionalWorkspaceType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AdditionalWorkspaceDataType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ReportedSeverity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.TaskUpdateActionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AutoProvision", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.InformationProtectionPolicyName", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.State", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.MinimalSeverity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Roles", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SubAssessmentStatusCode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Severity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Source", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AssessedResourceType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.EventSource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.PropertyType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Operator", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ActionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentPropertiesProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Tactics", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Techniques", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Categories", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.UserImpact", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ImplementationEffort", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Threats", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AssessmentType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AssessmentStatusCode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ExpandEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.EnforcementMode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ConfigurationStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.RecommendationStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AdaptiveApplicationControlIssue", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SourceSystem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.RecommendationAction", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.EnforcementSupport", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.FileType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Direction", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.TransportProtocol", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ConnectionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Protocol", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Status", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.StatusReason", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SecurityFamily", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ExternalSecuritySolutionKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ExpandControlsEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ControlType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.HybridComputeProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AuthenticationProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.PermissionProperty", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AuthenticationType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.MipIntegrationStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AlertSeverity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Intent", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ResourceIdentifierType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AlertStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Kind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SettingKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SettingName", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.EndOfSupportStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GovernanceRuleType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.GovernanceRuleOwnerSourceType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.OperationResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ApplicationSourceResourceType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ScanTriggerType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ScanState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.RuleStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.RuleSeverity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.RuleType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.StatusName", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SettingNameAutoGenerated", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.DevOpsProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.OnboardingState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ActionableRemediationState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.RuleCategory", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AnnotateDefaultBranchState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.InheritFromParentState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AutoDiscovery", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.CloudName", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.OfferingType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.EnvironmentType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.AadConnectivityState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.BundleType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsAzureSettingSelectedProvider", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.OrganizationMembershipType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Type", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.SubPlan", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ScanningMode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.Rank", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.RuleState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.security.models.ResourceIdentityType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +} ] \ No newline at end of file diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateSamples.java index ec5c5a7887c0..b4dcbf60bcb6 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateSamples.java @@ -60,6 +60,7 @@ public static void updateOrCreateSuppressionRuleForSubscription( com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOffboardingDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOffboardingDeleteSamples.java deleted file mode 100644 index cd679b4b46aa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOffboardingDeleteSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for ApiCollectionOffboarding Delete. */ -public final class ApiCollectionOffboardingDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-11-20-preview/examples/ApiCollections/APICollectionOffboarding_Delete_example.json - */ - /** - * Sample code: Delete a security recommendation task on a resource. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteASecurityRecommendationTaskOnAResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .apiCollectionOffboardings() - .deleteWithResponse("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOnboardingCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOnboardingCreateSamples.java deleted file mode 100644 index 14342e5bb6eb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOnboardingCreateSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for ApiCollectionOnboarding Create. */ -public final class ApiCollectionOnboardingCreateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-11-20-preview/examples/ApiCollections/APICollectionOnboarding_Create_example.json - */ - /** - * Sample code: Onboard an Azure API Management API to Defender for APIs. - * - * @param manager Entry point to SecurityManager. - */ - public static void onboardAnAzureAPIManagementAPIToDefenderForAPIs( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .apiCollectionOnboardings() - .createWithResponse("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsGetByAzureApiManagementServiceSamples.java similarity index 51% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsGetByAzureApiManagementServiceSamples.java index 91a9efb5966e..dcc4c7c15f07 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsGetByAzureApiManagementServiceSamples.java @@ -4,18 +4,21 @@ package com.azure.resourcemanager.security.generated; -/** Samples for ApiCollection Get. */ -public final class ApiCollectionGetSamples { +/** Samples for ApiCollections GetByAzureApiManagementService. */ +public final class ApiCollectionsGetByAzureApiManagementServiceSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-11-20-preview/examples/ApiCollections/APICollection_Get_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/APICollections_GetByAzureApiManagementService_example.json */ /** - * Sample code: Gets an Azure API Management API if it has been onboarded to Defender for APIs. + * Sample code: Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. * * @param manager Entry point to SecurityManager. */ - public static void getsAnAzureAPIManagementAPIIfItHasBeenOnboardedToDefenderForAPIs( + public static void getsAnAzureAPIManagementAPIIfItHasBeenOnboardedToMicrosoftDefenderForAPIs( com.azure.resourcemanager.security.SecurityManager manager) { - manager.apiCollections().getWithResponse("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); + manager + .apiCollections() + .getByAzureApiManagementServiceWithResponse( + "rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListByAzureApiManagementServiceSamples.java similarity index 53% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListByAzureApiManagementServiceSamples.java index 2dcb3c2a2e38..12d1f7dfa3c9 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListByAzureApiManagementServiceSamples.java @@ -4,18 +4,20 @@ package com.azure.resourcemanager.security.generated; -/** Samples for ApiCollection List. */ -public final class ApiCollectionListSamples { +/** Samples for ApiCollections ListByAzureApiManagementService. */ +public final class ApiCollectionsListByAzureApiManagementServiceSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-11-20-preview/examples/ApiCollections/APICollection_List_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/APICollections_ListByAzureApiManagementService_example.json */ /** - * Sample code: Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. + * Sample code: Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. * * @param manager Entry point to SecurityManager. */ - public static void getsAListOfAzureAPIManagementAPIsThatHaveBeenOnboardedToDefenderForAPIs( + public static void getsAListOfAzureAPIManagementAPIsThatHaveBeenOnboardedToMicrosoftDefenderForAPIs( com.azure.resourcemanager.security.SecurityManager manager) { - manager.apiCollections().list("rg1", "apimService1", com.azure.core.util.Context.NONE); + manager + .apiCollections() + .listByAzureApiManagementService("rg1", "apimService1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListByResourceGroupSamples.java new file mode 100644 index 000000000000..df764cd1cc0d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for ApiCollections ListByResourceGroup. */ +public final class ApiCollectionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/APICollections_ListByResourceGroup_example.json + */ + /** + * Sample code: Gets a list of API collections within a resource group that have been onboarded to Microsoft + * Defender for APIs. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsAListOfAPICollectionsWithinAResourceGroupThatHaveBeenOnboardedToMicrosoftDefenderForAPIs( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.apiCollections().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListSamples.java new file mode 100644 index 000000000000..f7de0a5a2c56 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for ApiCollections List. */ +public final class ApiCollectionsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/APICollections_ListBySubscription_example.json + */ + /** + * Sample code: Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender + * for APIs. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsAListOfAPICollectionsWithinASubscriptionThatHaveBeenOnboardedToMicrosoftDefenderForAPIs( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.apiCollections().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsOffboardAzureApiManagementApiSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsOffboardAzureApiManagementApiSamples.java new file mode 100644 index 000000000000..d9586fc3451b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsOffboardAzureApiManagementApiSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for ApiCollections OffboardAzureApiManagementApi. */ +public final class ApiCollectionsOffboardAzureApiManagementApiSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/APICollections_OffboardAzureApiManagementApi_example.json + */ + /** + * Sample code: Offboard an Azure API Management API from Microsoft Defender for APIs. + * + * @param manager Entry point to SecurityManager. + */ + public static void offboardAnAzureAPIManagementAPIFromMicrosoftDefenderForAPIs( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .apiCollections() + .offboardAzureApiManagementApiWithResponse( + "rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsOnboardAzureApiManagementApiSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsOnboardAzureApiManagementApiSamples.java new file mode 100644 index 000000000000..13e2ccb025d0 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsOnboardAzureApiManagementApiSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for ApiCollections OnboardAzureApiManagementApi. */ +public final class ApiCollectionsOnboardAzureApiManagementApiSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/APICollections_OnboardAzureApiManagementApi_example.json + */ + /** + * Sample code: Onboard an Azure API Management API to Microsoft Defender for APIs. + * + * @param manager Entry point to SecurityManager. + */ + public static void onboardAnAzureAPIManagementAPIToMicrosoftDefenderForAPIs( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .apiCollections() + .onboardAzureApiManagementApi("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateSamples.java index 7d93c4568637..02d899bda545 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateSamples.java @@ -172,6 +172,7 @@ public static void createOrUpdateASecurityAutomationForAllHighSeverityAssessment .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsValidateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsValidateSamples.java index 5202ae363608..3abdd5ec37ff 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsValidateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsValidateSamples.java @@ -78,6 +78,7 @@ public static void validateTheSecurityAutomationModelBeforeCreateOrUpdate( com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..6a3d25797a69 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsCreateOrUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsOrgProperties; +import com.azure.resourcemanager.security.models.OnboardingState; + +/** Samples for AzureDevOpsOrgs CreateOrUpdate. */ +public final class AzureDevOpsOrgsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/CreateOrUpdateAzureDevOpsOrgs_example.json + */ + /** + * Sample code: CreateOrUpdate_AzureDevOpsOrgs. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .azureDevOpsOrgs() + .define("myAzDevOpsOrg") + .withExistingSecurityConnector("myRg", "mySecurityConnectorName") + .withProperties( + new AzureDevOpsOrgProperties() + .withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation( + new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsGetSamples.java new file mode 100644 index 000000000000..0d3f085d17cb --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for AzureDevOpsOrgs Get. */ +public final class AzureDevOpsOrgsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetAzureDevOpsOrgs_example.json + */ + /** + * Sample code: Get_AzureDevOpsOrgs. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .azureDevOpsOrgs() + .getWithResponse("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsListAvailableSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsListAvailableSamples.java new file mode 100644 index 000000000000..3cefa2fb0d29 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsListAvailableSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for AzureDevOpsOrgs ListAvailable. */ +public final class AzureDevOpsOrgsListAvailableSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListAvailableAzureDevOpsOrgs_example.json + */ + /** + * Sample code: ListAvailable_AzureDevOpsOrgs. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAvailableAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .azureDevOpsOrgs() + .listAvailableWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsListSamples.java new file mode 100644 index 000000000000..b4b017b485ab --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for AzureDevOpsOrgs List. */ +public final class AzureDevOpsOrgsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListAzureDevOpsOrgs_example.json + */ + /** + * Sample code: List_AzureDevOpsOrgs. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsOrgs().list("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsUpdateSamples.java new file mode 100644 index 000000000000..3d873a49e954 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsUpdateSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsOrg; +import com.azure.resourcemanager.security.models.AzureDevOpsOrgProperties; +import com.azure.resourcemanager.security.models.OnboardingState; + +/** Samples for AzureDevOpsOrgs Update. */ +public final class AzureDevOpsOrgsUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/UpdateAzureDevOpsOrgs_example.json + */ + /** + * Sample code: Update_AzureDevOpsOrgs. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { + AzureDevOpsOrg resource = + manager + .azureDevOpsOrgs() + .getWithResponse("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new AzureDevOpsOrgProperties() + .withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation( + new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) + .apply(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..7f8913c3fb71 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsCreateOrUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsProjectProperties; +import com.azure.resourcemanager.security.models.OnboardingState; + +/** Samples for AzureDevOpsProjects CreateOrUpdate. */ +public final class AzureDevOpsProjectsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/CreateOrUpdateAzureDevOpsProjects_example.json + */ + /** + * Sample code: CreateOrUpdate_AzureDevOpsProjects. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateAzureDevOpsProjects(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .azureDevOpsProjects() + .define("myAzDevOpsProject") + .withExistingAzureDevOpsOrg("myRg", "mySecurityConnectorName", "myAzDevOpsOrg") + .withProperties( + new AzureDevOpsProjectProperties() + .withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation( + new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsGetSamples.java new file mode 100644 index 000000000000..cb77009c49ca --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for AzureDevOpsProjects Get. */ +public final class AzureDevOpsProjectsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetAzureDevOpsProjects_example.json + */ + /** + * Sample code: Get_AzureDevOpsProjects. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAzureDevOpsProjects(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .azureDevOpsProjects() + .getWithResponse( + "myRg", + "mySecurityConnectorName", + "myAzDevOpsOrg", + "myAzDevOpsProject", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsListSamples.java new file mode 100644 index 000000000000..2dcaa2ad75ac --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for AzureDevOpsProjects List. */ +public final class AzureDevOpsProjectsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListAzureDevOpsProjects_example.json + */ + /** + * Sample code: List_AzureDevOpsProjects. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAzureDevOpsProjects(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .azureDevOpsProjects() + .list("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsUpdateSamples.java new file mode 100644 index 000000000000..31d929145325 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsProject; +import com.azure.resourcemanager.security.models.AzureDevOpsProjectProperties; +import com.azure.resourcemanager.security.models.OnboardingState; + +/** Samples for AzureDevOpsProjects Update. */ +public final class AzureDevOpsProjectsUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/UpdateAzureDevOpsProjects_example.json + */ + /** + * Sample code: Update_AzureDevOpsProjects. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateAzureDevOpsProjects(com.azure.resourcemanager.security.SecurityManager manager) { + AzureDevOpsProject resource = + manager + .azureDevOpsProjects() + .getWithResponse( + "myRg", + "mySecurityConnectorName", + "myAzDevOpsOrg", + "myAzDevOpsProject", + com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new AzureDevOpsProjectProperties() + .withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation( + new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) + .apply(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposCreateOrUpdateSamples.java new file mode 100644 index 000000000000..97e117bc17a5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposCreateOrUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsRepositoryProperties; +import com.azure.resourcemanager.security.models.OnboardingState; + +/** Samples for AzureDevOpsRepos CreateOrUpdate. */ +public final class AzureDevOpsReposCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/CreateOrUpdateAzureDevOpsRepos_example.json + */ + /** + * Sample code: CreateOrUpdate_AzureDevOpsRepos. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateAzureDevOpsRepos(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .azureDevOpsRepos() + .define("myAzDevOpsRepo") + .withExistingProject("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject") + .withProperties( + new AzureDevOpsRepositoryProperties() + .withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation( + new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposGetSamples.java new file mode 100644 index 000000000000..077617ecf524 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposGetSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for AzureDevOpsRepos Get. */ +public final class AzureDevOpsReposGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetAzureDevOpsRepos_example.json + */ + /** + * Sample code: Get_AzureDevOpsRepos. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAzureDevOpsRepos(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .azureDevOpsRepos() + .getWithResponse( + "myRg", + "mySecurityConnectorName", + "myAzDevOpsOrg", + "myAzDevOpsProject", + "myAzDevOpsRepo", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposListSamples.java new file mode 100644 index 000000000000..8c6ba87ee06f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposListSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for AzureDevOpsRepos List. */ +public final class AzureDevOpsReposListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListAzureDevOpsRepos_example.json + */ + /** + * Sample code: List_AzureDevOpsRepos. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAzureDevOpsRepos(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .azureDevOpsRepos() + .list( + "myRg", + "mySecurityConnectorName", + "myAzDevOpsOrg", + "myAzDevOpsProject", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposUpdateSamples.java new file mode 100644 index 000000000000..94ca43877b1f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposUpdateSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsRepository; +import com.azure.resourcemanager.security.models.AzureDevOpsRepositoryProperties; +import com.azure.resourcemanager.security.models.OnboardingState; + +/** Samples for AzureDevOpsRepos Update. */ +public final class AzureDevOpsReposUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/UpdateAzureDevOpsRepos_example.json + */ + /** + * Sample code: Update_AzureDevOpsRepos. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateAzureDevOpsRepos(com.azure.resourcemanager.security.SecurityManager manager) { + AzureDevOpsRepository resource = + manager + .azureDevOpsRepos() + .getWithResponse( + "myRg", + "mySecurityConnectorName", + "myAzDevOpsOrg", + "myAzDevOpsProject", + "myAzDevOpsRepo", + com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new AzureDevOpsRepositoryProperties() + .withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation( + new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) + .apply(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageCreateSamples.java new file mode 100644 index 000000000000..c0e91ceffeff --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageCreateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.SettingNameAutoGenerated; + +/** Samples for DefenderForStorage Create. */ +public final class DefenderForStorageCreateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-12-01-preview/examples/DefenderForStorage/PutDefenderForStorageSettings_example.json + */ + /** + * Sample code: Creates or updates the Defender for Storage settings on a specified resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void createsOrUpdatesTheDefenderForStorageSettingsOnASpecifiedResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .defenderForStorages() + .define(SettingNameAutoGenerated.CURRENT) + .withExistingResourceId( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount") + .withIsEnabled(true) + .withOverrideSubscriptionLevelSettings(true) + .withScanResultsEventGridTopicResourceId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.EventGrid/topics/sampletopic") + .withIsEnabledMalwareScanningIsEnabled(true) + .withCapGBPerMonth(-1) + .withIsEnabledSensitiveDataDiscoveryIsEnabled(true) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageGetSamples.java new file mode 100644 index 000000000000..69d4fae0b557 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageGetSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.SettingNameAutoGenerated; + +/** Samples for DefenderForStorage Get. */ +public final class DefenderForStorageGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-12-01-preview/examples/DefenderForStorage/GetDefenderForStorageSettings_example.json + */ + /** + * Sample code: Gets the Defender for Storage settings for the specified resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsTheDefenderForStorageSettingsForTheSpecifiedResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .defenderForStorages() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", + SettingNameAutoGenerated.CURRENT, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..091a18bd3f25 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsCreateOrUpdateSamples.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; +import com.azure.resourcemanager.security.models.Authorization; +import com.azure.resourcemanager.security.models.AutoDiscovery; +import com.azure.resourcemanager.security.models.DevOpsConfigurationProperties; +import java.util.Arrays; + +/** Samples for DevOpsConfigurations CreateOrUpdate. */ +public final class DevOpsConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/CreateOrUpdateDevOpsConfigurationsOnboardCurrentAndFuture_example.json + */ + /** + * Sample code: CreateOrUpdate_DevOpsConfigurations_OnboardCurrentAndFuture. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateDevOpsConfigurationsOnboardCurrentAndFuture( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .devOpsConfigurations() + .createOrUpdate( + "myRg", + "mySecurityConnectorName", + new DevOpsConfigurationInner() + .withProperties( + new DevOpsConfigurationProperties() + .withAuthorization(new Authorization().withCode("fakeTokenPlaceholder")) + .withAutoDiscovery(AutoDiscovery.ENABLED)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/CreateOrUpdateDevOpsConfigurationsOnboardCurrentOnly_example.json + */ + /** + * Sample code: CreateOrUpdate_DevOpsConfigurations_OnboardCurrentOnly. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateDevOpsConfigurationsOnboardCurrentOnly( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .devOpsConfigurations() + .createOrUpdate( + "myRg", + "mySecurityConnectorName", + new DevOpsConfigurationInner() + .withProperties( + new DevOpsConfigurationProperties() + .withAuthorization(new Authorization().withCode("fakeTokenPlaceholder")) + .withAutoDiscovery(AutoDiscovery.DISABLED)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/CreateOrUpdateDevOpsConfigurationsOnboardSelected_example.json + */ + /** + * Sample code: CreateOrUpdate_DevOpsConfigurations_OnboardSelected. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateDevOpsConfigurationsOnboardSelected( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .devOpsConfigurations() + .createOrUpdate( + "myRg", + "mySecurityConnectorName", + new DevOpsConfigurationInner() + .withProperties( + new DevOpsConfigurationProperties() + .withAuthorization(new Authorization().withCode("fakeTokenPlaceholder")) + .withAutoDiscovery(AutoDiscovery.DISABLED) + .withTopLevelInventoryList(Arrays.asList("org1", "org2"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsDeleteSamples.java new file mode 100644 index 000000000000..c2b8f5b4701f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for DevOpsConfigurations Delete. */ +public final class DevOpsConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/DeleteDevOpsConfigurations_example.json + */ + /** + * Sample code: Delete_DevOpsConfigurations. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteDevOpsConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations().delete("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsGetSamples.java new file mode 100644 index 000000000000..ac1ae4945e41 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for DevOpsConfigurations Get. */ +public final class DevOpsConfigurationsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetDevOpsConfigurations_example.json + */ + /** + * Sample code: Get_DevOpsConfigurations. + * + * @param manager Entry point to SecurityManager. + */ + public static void getDevOpsConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .devOpsConfigurations() + .getWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsListSamples.java new file mode 100644 index 000000000000..18729efccb74 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for DevOpsConfigurations List. */ +public final class DevOpsConfigurationsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListDevOpsConfigurations_example.json + */ + /** + * Sample code: List_DevOpsConfigurations. + * + * @param manager Entry point to SecurityManager. + */ + public static void listDevOpsConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations().list("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsUpdateSamples.java new file mode 100644 index 000000000000..1ecc27ad90a9 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsUpdateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; +import com.azure.resourcemanager.security.models.AutoDiscovery; +import com.azure.resourcemanager.security.models.DevOpsConfigurationProperties; + +/** Samples for DevOpsConfigurations Update. */ +public final class DevOpsConfigurationsUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/UpdateDevOpsConfigurations_example.json + */ + /** + * Sample code: Update_DevOpsConfigurations. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateDevOpsConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .devOpsConfigurations() + .update( + "myRg", + "mySecurityConnectorName", + new DevOpsConfigurationInner() + .withProperties(new DevOpsConfigurationProperties().withAutoDiscovery(AutoDiscovery.ENABLED)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsOperationResultsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsOperationResultsGetSamples.java new file mode 100644 index 000000000000..7645eb77bbdb --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsOperationResultsGetSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for DevOpsOperationResults Get. */ +public final class DevOpsOperationResultsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetDevOpsOperationResultsFailed_example.json + */ + /** + * Sample code: Get_DevOpsOperationResults_Failed. + * + * @param manager Entry point to SecurityManager. + */ + public static void getDevOpsOperationResultsFailed(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .devOpsOperationResults() + .getWithResponse( + "myRg", + "mySecurityConnectorName", + "8d4caace-e7b3-4b3e-af99-73f76829ebcf", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetDevOpsOperationResultsSucceeded_example.json + */ + /** + * Sample code: Get_DevOpsOperationResults_Succeeded. + * + * @param manager Entry point to SecurityManager. + */ + public static void getDevOpsOperationResultsSucceeded(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .devOpsOperationResults() + .getWithResponse( + "myRg", + "mySecurityConnectorName", + "4e826cf1-5c36-4808-a7d2-fb4f5170978b", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersGetSamples.java new file mode 100644 index 000000000000..9754ed9f1c9a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for GitHubOwners Get. */ +public final class GitHubOwnersGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetGitHubOwners_example.json + */ + /** + * Sample code: Get_GitHubOwners. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGitHubOwners(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .gitHubOwners() + .getWithResponse("myRg", "mySecurityConnectorName", "myGitHubOwner", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersListAvailableSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersListAvailableSamples.java new file mode 100644 index 000000000000..7088c131c729 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersListAvailableSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for GitHubOwners ListAvailable. */ +public final class GitHubOwnersListAvailableSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListAvailableGitHubOwners_example.json + */ + /** + * Sample code: ListAvailable_GitHubOwners. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAvailableGitHubOwners(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .gitHubOwners() + .listAvailableWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersListSamples.java new file mode 100644 index 000000000000..7371054ac87c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for GitHubOwners List. */ +public final class GitHubOwnersListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListGitHubOwners_example.json + */ + /** + * Sample code: List_GitHubOwners. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGitHubOwners(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitHubOwners().list("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubReposGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubReposGetSamples.java new file mode 100644 index 000000000000..f2cf789c0196 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubReposGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for GitHubRepos Get. */ +public final class GitHubReposGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetGitHubRepos_example.json + */ + /** + * Sample code: Get_GitHubRepos. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGitHubRepos(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .gitHubRepos() + .getWithResponse( + "myRg", "mySecurityConnectorName", "myGitHubOwner", "myGitHubRepo", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubReposListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubReposListSamples.java new file mode 100644 index 000000000000..f407744a4183 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubReposListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for GitHubRepos List. */ +public final class GitHubReposListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListGitHubRepos_example.json + */ + /** + * Sample code: List_GitHubRepos. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGitHubRepos(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .gitHubRepos() + .list("myRg", "mySecurityConnectorName", "myGitHubOwner", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsGetSamples.java new file mode 100644 index 000000000000..e955a0dac33d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for GitLabGroups Get. */ +public final class GitLabGroupsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetGitLabGroups_example.json + */ + /** + * Sample code: Get_GitLabGroups. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGitLabGroups(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .gitLabGroups() + .getWithResponse( + "myRg", "mySecurityConnectorName", "myGitLabGroup$mySubGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsListAvailableSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsListAvailableSamples.java new file mode 100644 index 000000000000..6d3267b0a0dd --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsListAvailableSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for GitLabGroups ListAvailable. */ +public final class GitLabGroupsListAvailableSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListAvailableGitLabGroups_example.json + */ + /** + * Sample code: ListAvailable_GitLabGroups. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAvailableGitLabGroups(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .gitLabGroups() + .listAvailableWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsListSamples.java new file mode 100644 index 000000000000..4443f15ac412 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for GitLabGroups List. */ +public final class GitLabGroupsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListGitLabGroups_example.json + */ + /** + * Sample code: List_GitLabGroups. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGitLabGroups(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitLabGroups().list("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabProjectsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabProjectsGetSamples.java new file mode 100644 index 000000000000..e4abaaedb216 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabProjectsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for GitLabProjects Get. */ +public final class GitLabProjectsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetGitLabProjects_example.json + */ + /** + * Sample code: Get_GitLabProjects. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGitLabProjects(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .gitLabProjects() + .getWithResponse( + "myRg", + "mySecurityConnectorName", + "myGitLabGroup$mySubGroup", + "myGitLabProject", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabProjectsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabProjectsListSamples.java new file mode 100644 index 000000000000..7859b6b09830 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabProjectsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for GitLabProjects List. */ +public final class GitLabProjectsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListGitLabProjects_example.json + */ + /** + * Sample code: List_GitLabProjects. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGitLabProjects(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .gitLabProjects() + .list("myRg", "mySecurityConnectorName", "myGitLabGroup$mySubGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabSubgroupsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabSubgroupsListSamples.java new file mode 100644 index 000000000000..2400393567d6 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabSubgroupsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for GitLabSubgroups List. */ +public final class GitLabSubgroupsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListGitLabSubgroups_example.json + */ + /** + * Sample code: List_GitLabSubgroups. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGitLabSubgroups(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .gitLabSubgroups() + .listWithResponse("myRg", "mySecurityConnectorName", "myGitLabGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportOperationGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportsGetSamples.java similarity index 78% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportOperationGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportsGetSamples.java index 04042dc0cc79..b5bcf4a1136e 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportOperationGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportsGetSamples.java @@ -4,10 +4,10 @@ package com.azure.resourcemanager.security.generated; -/** Samples for HealthReportOperation Get. */ -public final class HealthReportOperationGetSamples { +/** Samples for HealthReports Get. */ +public final class HealthReportsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/HealthReports/GetHealthReport_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-05-01-preview/examples/HealthReports/GetHealthReports_example.json */ /** * Sample code: Get health report of resource. @@ -16,7 +16,7 @@ public final class HealthReportOperationGetSamples { */ public static void getHealthReportOfResource(com.azure.resourcemanager.security.SecurityManager manager) { manager - .healthReportOperations() + .healthReports() .getWithResponse( "subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2/resourcegroups/E2E-IBB0WX/providers/Microsoft.Security/securityconnectors/AwsConnectorAllOfferings", "909c629a-bf39-4521-8e4f-10b443a0bc02", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportsListSamples.java index 2a7ee29833eb..8b909ddb11f7 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportsListSamples.java @@ -7,7 +7,7 @@ /** Samples for HealthReports List. */ public final class HealthReportsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/HealthReports/ListHealthReports_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-05-01-preview/examples/HealthReports/ListHealthReports_example.json */ /** * Sample code: List health reports. diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateSamples.java index d55fa59839ea..21feb4919341 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateSamples.java @@ -70,6 +70,7 @@ public static void createOrUpdateAnInformationProtectionPolicyForAManagementGrou .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteSamples.java deleted file mode 100644 index 4951d449f9f3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for IngestionSettings Delete. */ -public final class IngestionSettingsDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/DeleteIngestionSetting_example.json - */ - /** - * Sample code: Delete an ingestion setting for the subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteAnIngestionSettingForTheSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().deleteWithResponse("default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetSamples.java deleted file mode 100644 index ef8e1251dfc4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for IngestionSettings Get. */ -public final class IngestionSettingsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSetting_example.json - */ - /** - * Sample code: Get a ingestion setting on subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getAIngestionSettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().getWithResponse("default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsSamples.java deleted file mode 100644 index ada2d9866152..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for IngestionSettings ListConnectionStrings. */ -public final class IngestionSettingsListConnectionStringsSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListConnectionStrings_example.json - */ - /** - * Sample code: List connection strings for ingesting security data and logs. - * - * @param manager Entry point to SecurityManager. - */ - public static void listConnectionStringsForIngestingSecurityDataAndLogs( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().listConnectionStringsWithResponse("default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListSamples.java deleted file mode 100644 index 32d658d01c4a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for IngestionSettings List. */ -public final class IngestionSettingsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSettings_example.json - */ - /** - * Sample code: Get ingestion settings on subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getIngestionSettingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListTokensSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListTokensSamples.java deleted file mode 100644 index 62bf0af3b48b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListTokensSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for IngestionSettings ListTokens. */ -public final class IngestionSettingsListTokensSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListTokensIngestionSetting_example.json - */ - /** - * Sample code: List ingestion setting tokens. - * - * @param manager Entry point to SecurityManager. - */ - public static void listIngestionSettingTokens(com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().listTokensWithResponse("default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionCreateOrUpdateSamples.java index 3b20451ebc2e..35d6b4da1e4a 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionCreateOrUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionCreateOrUpdateSamples.java @@ -58,6 +58,7 @@ public static void createOrUpdateAIoTSecuritySolution(com.azure.resourcemanager. .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionUpdateSamples.java index a051bd1be9ad..a581b97684de 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionUpdateSamples.java @@ -49,6 +49,7 @@ public static void useThisMethodToUpdateExistingIoTSecuritySolution( .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ResourceProviderGetSensitivitySettingsSamples.java similarity index 50% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsCreateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ResourceProviderGetSensitivitySettingsSamples.java index 822344341a76..7fe1afbe71ca 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsCreateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ResourceProviderGetSensitivitySettingsSamples.java @@ -4,18 +4,17 @@ package com.azure.resourcemanager.security.generated; -/** Samples for IngestionSettings Create. */ -public final class IngestionSettingsCreateSamples { +/** Samples for ResourceProvider GetSensitivitySettings. */ +public final class ResourceProviderGetSensitivitySettingsSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/CreateIngestionSetting_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-15-preview/examples/SensitivitySettings/GetSensitivitySettings_example.json */ /** - * Sample code: Create an ingestion setting for subscription. + * Sample code: Get sensitivity settings. * * @param manager Entry point to SecurityManager. */ - public static void createAnIngestionSettingForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().define("default").create(); + public static void getSensitivitySettings(com.azure.resourcemanager.security.SecurityManager manager) { + manager.resourceProviders().getSensitivitySettingsWithResponse(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ResourceProviderUpdateSensitivitySettingsSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ResourceProviderUpdateSensitivitySettingsSamples.java new file mode 100644 index 000000000000..1e65112e5d9b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ResourceProviderUpdateSensitivitySettingsSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest; +import java.util.Arrays; +import java.util.UUID; + +/** Samples for ResourceProvider UpdateSensitivitySettings. */ +public final class ResourceProviderUpdateSensitivitySettingsSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-15-preview/examples/SensitivitySettings/PutSensitivitySettings_example.json + */ + /** + * Sample code: Update sensitivity settings. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSensitivitySettings(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .resourceProviders() + .updateSensitivitySettingsWithResponse( + new UpdateSensitivitySettingsRequest() + .withSensitiveInfoTypesIds( + Arrays + .asList( + UUID.fromString("f2f8a7a1-28c0-404b-9ab4-30a0a7af18cb"), + UUID.fromString("b452f22b-f87d-4f48-8490-ecf0873325b5"), + UUID.fromString("d59ee8b6-2618-404b-a5e7-aa377cd67543"))) + .withSensitivityThresholdLabelOrder(2.0F) + .withSensitivityThresholdLabelId(UUID.fromString("f2f8a7a1-28c0-404b-9ab4-30a0a7af18cb")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsCreateOrUpdateSamples.java index 50662f107f7b..67f8d1c65733 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsCreateOrUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsCreateOrUpdateSamples.java @@ -15,7 +15,7 @@ /** Samples for SecurityConnectors CreateOrUpdate. */ public final class SecurityConnectorsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/PutSecurityConnector_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-10-01-preview/examples/SecurityConnectors/PutSecurityConnector_example.json */ /** * Sample code: Create or update a security connector. @@ -38,10 +38,11 @@ public static void createOrUpdateASecurityConnector(com.azure.resourcemanager.se .withNativeCloudConnection( new CspmMonitorAwsOfferingNativeCloudConnection() .withCloudRoleArn("arn:aws:iam::00000000:role/ASCMonitor")))) - .withEnvironmentData(new AwsEnvironmentData()) + .withEnvironmentData(new AwsEnvironmentData().withScanInterval(4L)) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteSamples.java index 7efdb44bb18b..e01cedecf3fb 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for SecurityConnectors Delete. */ public final class SecurityConnectorsDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/DeleteSecurityConnector_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-10-01-preview/examples/SecurityConnectors/DeleteSecurityConnector_example.json */ /** * Sample code: Delete a security connector. diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupSamples.java index 1f308e583139..ade82afb99f3 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for SecurityConnectors GetByResourceGroup. */ public final class SecurityConnectorsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/GetSecurityConnectorSingleResource_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-10-01-preview/examples/SecurityConnectors/GetSecurityConnectorSingleResource_example.json */ /** * Sample code: Retrieve a security connector. diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupSamples.java index 649474989719..d7816412e76f 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for SecurityConnectors ListByResourceGroup. */ public final class SecurityConnectorsListByResourceGroupSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/GetSecurityConnectorsResourceGroup_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-10-01-preview/examples/SecurityConnectors/GetSecurityConnectorsResourceGroup_example.json */ /** * Sample code: List all security connectors of a specified resource group. diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListSamples.java index d2178cf30549..299dbb671ccf 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListSamples.java @@ -7,7 +7,7 @@ /** Samples for SecurityConnectors List. */ public final class SecurityConnectorsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/GetSecurityConnectorsSubscription_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-10-01-preview/examples/SecurityConnectors/GetSecurityConnectorsSubscription_example.json */ /** * Sample code: List all security connectors of a specified subscription. diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsUpdateSamples.java index 9f3ffaccc23a..28fde24e78ad 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsUpdateSamples.java @@ -16,7 +16,7 @@ /** Samples for SecurityConnectors Update. */ public final class SecurityConnectorsUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/PatchSecurityConnector_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-10-01-preview/examples/SecurityConnectors/PatchSecurityConnector_example.json */ /** * Sample code: Update a security connector. @@ -46,6 +46,7 @@ public static void updateASecurityConnector(com.azure.resourcemanager.security.S .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SensitivitySettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SensitivitySettingsListSamples.java new file mode 100644 index 000000000000..84b4a591df9a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SensitivitySettingsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for SensitivitySettings List. */ +public final class SensitivitySettingsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-15-preview/examples/SensitivitySettings/GetSensitivitySettingsList_example.json + */ + /** + * Sample code: Get sensitivity settings list. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSensitivitySettingsList(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sensitivitySettings().listWithResponse(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..d9ad5b5638eb --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsCreateOrUpdateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.AzureServersSetting; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsAzureSettingSelectedProvider; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; + +/** Samples for ServerVulnerabilityAssessmentsSettings CreateOrUpdate. */ +public final class ServerVulnerabilityAssessmentsSettingsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ServerVulnerabilityAssessmentsSettings/PutServerVulnerabilityAssessmentsSetting_example.json + */ + /** + * Sample code: Set a server vulnerability assessments setting of the kind settingKind on the subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void setAServerVulnerabilityAssessmentsSettingOfTheKindSettingKindOnTheSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .serverVulnerabilityAssessmentsSettings() + .createOrUpdateWithResponse( + ServerVulnerabilityAssessmentsSettingKindName.AZURE_SERVERS_SETTING, + new AzureServersSetting() + .withSelectedProvider(ServerVulnerabilityAssessmentsAzureSettingSelectedProvider.MDE_TVM), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsDeleteSamples.java new file mode 100644 index 000000000000..eec7e1181ec2 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; + +/** Samples for ServerVulnerabilityAssessmentsSettings Delete. */ +public final class ServerVulnerabilityAssessmentsSettingsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ServerVulnerabilityAssessmentsSettings/DeleteServerVulnerabilityAssessmentsSetting_example.json + */ + /** + * Sample code: Delete the server vulnerability assessments setting of the kind settingKind from the subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteTheServerVulnerabilityAssessmentsSettingOfTheKindSettingKindFromTheSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .serverVulnerabilityAssessmentsSettings() + .deleteWithResponse( + ServerVulnerabilityAssessmentsSettingKindName.AZURE_SERVERS_SETTING, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsGetSamples.java new file mode 100644 index 000000000000..61172827df65 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; + +/** Samples for ServerVulnerabilityAssessmentsSettings Get. */ +public final class ServerVulnerabilityAssessmentsSettingsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ServerVulnerabilityAssessmentsSettings/GetServerVulnerabilityAssessmentsSetting_example.json + */ + /** + * Sample code: Get the server vulnerability assessments setting of the kind settingKind that is set on the + * subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTheServerVulnerabilityAssessmentsSettingOfTheKindSettingKindThatIsSetOnTheSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .serverVulnerabilityAssessmentsSettings() + .getWithResponse( + ServerVulnerabilityAssessmentsSettingKindName.AZURE_SERVERS_SETTING, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsListSamples.java new file mode 100644 index 000000000000..d65ec936d49a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for ServerVulnerabilityAssessmentsSettings List. */ +public final class ServerVulnerabilityAssessmentsSettingsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ServerVulnerabilityAssessmentsSettings/ListServerVulnerabilityAssessmentsSettings_example.json + */ + /** + * Sample code: List the server vulnerability assessments settings set on the subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void listTheServerVulnerabilityAssessmentsSettingsSetOnTheSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.serverVulnerabilityAssessmentsSettings().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java index c2a326cd6392..90f0e0019d1f 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java @@ -55,6 +55,7 @@ public static void createABaselineForAllRulesUsingTheLatestScanResults( com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadConnectivityStateAutoGeneratedTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadConnectivityStateAutoGeneratedTests.java deleted file mode 100644 index 6017d8ddf8b6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadConnectivityStateAutoGeneratedTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AadConnectivityState; -import com.azure.resourcemanager.security.models.AadConnectivityStateAutoGenerated; -import org.junit.jupiter.api.Assertions; - -public final class AadConnectivityStateAutoGeneratedTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AadConnectivityStateAutoGenerated model = - BinaryData - .fromString("{\"connectivityState\":\"NotLicensed\"}") - .toObject(AadConnectivityStateAutoGenerated.class); - Assertions.assertEquals(AadConnectivityState.NOT_LICENSED, model.connectivityState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AadConnectivityStateAutoGenerated model = - new AadConnectivityStateAutoGenerated().withConnectivityState(AadConnectivityState.NOT_LICENSED); - model = BinaryData.fromObject(model).toObject(AadConnectivityStateAutoGenerated.class); - Assertions.assertEquals(AadConnectivityState.NOT_LICENSED, model.connectivityState()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadExternalSecuritySolutionTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadExternalSecuritySolutionTests.java deleted file mode 100644 index c50ccc6f7816..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadExternalSecuritySolutionTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AadConnectivityState; -import com.azure.resourcemanager.security.models.AadExternalSecuritySolution; -import com.azure.resourcemanager.security.models.AadSolutionProperties; -import com.azure.resourcemanager.security.models.ConnectedWorkspace; -import org.junit.jupiter.api.Assertions; - -public final class AadExternalSecuritySolutionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AadExternalSecuritySolution model = - BinaryData - .fromString( - "{\"kind\":\"AAD\",\"properties\":{\"connectivityState\":\"NotLicensed\",\"deviceVendor\":\"pezkis\",\"deviceType\":\"jm\",\"workspace\":{\"id\":\"syparybjufp\"},\"\":{\"uiyqvldaswvppi\":\"dataczjnc\",\"rr\":\"dataqqzlgcndhz\",\"uww\":\"datacfsrhkhgsn\"}},\"location\":\"phefsbzxlbz\",\"id\":\"omeikjcl\",\"name\":\"zacn\",\"type\":\"wpfsuqtaaz\"}") - .toObject(AadExternalSecuritySolution.class); - Assertions.assertEquals("pezkis", model.properties().deviceVendor()); - Assertions.assertEquals("jm", model.properties().deviceType()); - Assertions.assertEquals("syparybjufp", model.properties().workspace().id()); - Assertions.assertEquals(AadConnectivityState.NOT_LICENSED, model.properties().connectivityState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AadExternalSecuritySolution model = - new AadExternalSecuritySolution() - .withProperties( - new AadSolutionProperties() - .withDeviceVendor("pezkis") - .withDeviceType("jm") - .withWorkspace(new ConnectedWorkspace().withId("syparybjufp")) - .withConnectivityState(AadConnectivityState.NOT_LICENSED)); - model = BinaryData.fromObject(model).toObject(AadExternalSecuritySolution.class); - Assertions.assertEquals("pezkis", model.properties().deviceVendor()); - Assertions.assertEquals("jm", model.properties().deviceType()); - Assertions.assertEquals("syparybjufp", model.properties().workspace().id()); - Assertions.assertEquals(AadConnectivityState.NOT_LICENSED, model.properties().connectivityState()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadSolutionPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadSolutionPropertiesTests.java deleted file mode 100644 index 37e583a94f5b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadSolutionPropertiesTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AadConnectivityState; -import com.azure.resourcemanager.security.models.AadSolutionProperties; -import com.azure.resourcemanager.security.models.ConnectedWorkspace; -import org.junit.jupiter.api.Assertions; - -public final class AadSolutionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AadSolutionProperties model = - BinaryData - .fromString( - "{\"connectivityState\":\"Discovered\",\"deviceVendor\":\"yxoyfp\",\"deviceType\":\"qi\",\"workspace\":{\"id\":\"xlhdj\"},\"\":{\"jriyb\":\"datacadwvpsozjii\",\"epnxwd\":\"datarz\",\"xaurs\":\"datawnjkgvfn\",\"pnqn\":\"dataftibtyibuyvpirfq\"}}") - .toObject(AadSolutionProperties.class); - Assertions.assertEquals("yxoyfp", model.deviceVendor()); - Assertions.assertEquals("qi", model.deviceType()); - Assertions.assertEquals("xlhdj", model.workspace().id()); - Assertions.assertEquals(AadConnectivityState.DISCOVERED, model.connectivityState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AadSolutionProperties model = - new AadSolutionProperties() - .withDeviceVendor("yxoyfp") - .withDeviceType("qi") - .withWorkspace(new ConnectedWorkspace().withId("xlhdj")) - .withConnectivityState(AadConnectivityState.DISCOVERED); - model = BinaryData.fromObject(model).toObject(AadSolutionProperties.class); - Assertions.assertEquals("yxoyfp", model.deviceVendor()); - Assertions.assertEquals("qi", model.deviceType()); - Assertions.assertEquals("xlhdj", model.workspace().id()); - Assertions.assertEquals(AadConnectivityState.DISCOVERED, model.connectivityState()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ActiveConnectionsNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ActiveConnectionsNotInAllowedRangeTests.java deleted file mode 100644 index 07c05e9dbb03..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ActiveConnectionsNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ActiveConnectionsNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class ActiveConnectionsNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ActiveConnectionsNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"ActiveConnectionsNotInAllowedRange\",\"timeWindowSize\":\"PT166H22M2S\",\"minThreshold\":1327259513,\"maxThreshold\":713961317,\"displayName\":\"n\",\"description\":\"mehllizhceu\",\"isEnabled\":true}") - .toObject(ActiveConnectionsNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1327259513, model.minThreshold()); - Assertions.assertEquals(713961317, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT166H22M2S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ActiveConnectionsNotInAllowedRange model = - new ActiveConnectionsNotInAllowedRange() - .withIsEnabled(true) - .withMinThreshold(1327259513) - .withMaxThreshold(713961317) - .withTimeWindowSize(Duration.parse("PT166H22M2S")); - model = BinaryData.fromObject(model).toObject(ActiveConnectionsNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1327259513, model.minThreshold()); - Assertions.assertEquals(713961317, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT166H22M2S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupDataTests.java deleted file mode 100644 index 05cb8413a6c2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupDataTests.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupData; -import com.azure.resourcemanager.security.models.ConfigurationStatus; -import com.azure.resourcemanager.security.models.EnforcementMode; -import com.azure.resourcemanager.security.models.EnforcementSupport; -import com.azure.resourcemanager.security.models.FileType; -import com.azure.resourcemanager.security.models.PathRecommendation; -import com.azure.resourcemanager.security.models.ProtectionMode; -import com.azure.resourcemanager.security.models.PublisherInfo; -import com.azure.resourcemanager.security.models.RecommendationAction; -import com.azure.resourcemanager.security.models.RecommendationType; -import com.azure.resourcemanager.security.models.VmRecommendation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdaptiveApplicationControlGroupDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdaptiveApplicationControlGroupData model = - BinaryData - .fromString( - "{\"enforcementMode\":\"Audit\",\"protectionMode\":{\"exe\":\"None\",\"msi\":\"None\",\"script\":\"None\",\"executable\":\"Audit\"},\"configurationStatus\":\"InProgress\",\"recommendationStatus\":\"NotRecommended\",\"issues\":[{\"issue\":\"RulesViolatedManually\",\"numberOfVms\":15.610468}],\"sourceSystem\":\"Azure_AuditD\",\"vmRecommendations\":[{\"configurationStatus\":\"NoStatus\",\"recommendationAction\":\"Recommended\",\"resourceId\":\"hlf\",\"enforcementSupport\":\"Supported\"}],\"pathRecommendations\":[{\"path\":\"wahfbousnfepgfew\",\"action\":\"Add\",\"type\":\"IoT_SharedCredentials\",\"publisherInfo\":{\"publisherName\":\"ncxykxhdjhlimm\",\"productName\":\"x\",\"binaryName\":\"bcporxvxcjzhqizx\",\"version\":\"xtgqscjavftjuh\"},\"common\":true,\"userSids\":[\"mtggu\"],\"usernames\":[],\"fileType\":\"Script\",\"configurationStatus\":\"Failed\"}]}") - .toObject(AdaptiveApplicationControlGroupData.class); - Assertions.assertEquals(EnforcementMode.AUDIT, model.enforcementMode()); - Assertions.assertEquals(EnforcementMode.NONE, model.protectionMode().exe()); - Assertions.assertEquals(EnforcementMode.NONE, model.protectionMode().msi()); - Assertions.assertEquals(EnforcementMode.NONE, model.protectionMode().script()); - Assertions.assertEquals(EnforcementMode.AUDIT, model.protectionMode().executable()); - Assertions.assertEquals(ConfigurationStatus.NO_STATUS, model.vmRecommendations().get(0).configurationStatus()); - Assertions - .assertEquals(RecommendationAction.RECOMMENDED, model.vmRecommendations().get(0).recommendationAction()); - Assertions.assertEquals("hlf", model.vmRecommendations().get(0).resourceId()); - Assertions.assertEquals(EnforcementSupport.SUPPORTED, model.vmRecommendations().get(0).enforcementSupport()); - Assertions.assertEquals("wahfbousnfepgfew", model.pathRecommendations().get(0).path()); - Assertions.assertEquals(RecommendationAction.ADD, model.pathRecommendations().get(0).action()); - Assertions.assertEquals(RecommendationType.IO_T_SHARED_CREDENTIALS, model.pathRecommendations().get(0).type()); - Assertions.assertEquals("ncxykxhdjhlimm", model.pathRecommendations().get(0).publisherInfo().publisherName()); - Assertions.assertEquals("x", model.pathRecommendations().get(0).publisherInfo().productName()); - Assertions.assertEquals("bcporxvxcjzhqizx", model.pathRecommendations().get(0).publisherInfo().binaryName()); - Assertions.assertEquals("xtgqscjavftjuh", model.pathRecommendations().get(0).publisherInfo().version()); - Assertions.assertEquals(true, model.pathRecommendations().get(0).common()); - Assertions.assertEquals("mtggu", model.pathRecommendations().get(0).userSids().get(0)); - Assertions.assertEquals(FileType.SCRIPT, model.pathRecommendations().get(0).fileType()); - Assertions.assertEquals(ConfigurationStatus.FAILED, model.pathRecommendations().get(0).configurationStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdaptiveApplicationControlGroupData model = - new AdaptiveApplicationControlGroupData() - .withEnforcementMode(EnforcementMode.AUDIT) - .withProtectionMode( - new ProtectionMode() - .withExe(EnforcementMode.NONE) - .withMsi(EnforcementMode.NONE) - .withScript(EnforcementMode.NONE) - .withExecutable(EnforcementMode.AUDIT)) - .withVmRecommendations( - Arrays - .asList( - new VmRecommendation() - .withConfigurationStatus(ConfigurationStatus.NO_STATUS) - .withRecommendationAction(RecommendationAction.RECOMMENDED) - .withResourceId("hlf") - .withEnforcementSupport(EnforcementSupport.SUPPORTED))) - .withPathRecommendations( - Arrays - .asList( - new PathRecommendation() - .withPath("wahfbousnfepgfew") - .withAction(RecommendationAction.ADD) - .withType(RecommendationType.IO_T_SHARED_CREDENTIALS) - .withPublisherInfo( - new PublisherInfo() - .withPublisherName("ncxykxhdjhlimm") - .withProductName("x") - .withBinaryName("bcporxvxcjzhqizx") - .withVersion("xtgqscjavftjuh")) - .withCommon(true) - .withUserSids(Arrays.asList("mtggu")) - .withUsernames(Arrays.asList()) - .withFileType(FileType.SCRIPT) - .withConfigurationStatus(ConfigurationStatus.FAILED))); - model = BinaryData.fromObject(model).toObject(AdaptiveApplicationControlGroupData.class); - Assertions.assertEquals(EnforcementMode.AUDIT, model.enforcementMode()); - Assertions.assertEquals(EnforcementMode.NONE, model.protectionMode().exe()); - Assertions.assertEquals(EnforcementMode.NONE, model.protectionMode().msi()); - Assertions.assertEquals(EnforcementMode.NONE, model.protectionMode().script()); - Assertions.assertEquals(EnforcementMode.AUDIT, model.protectionMode().executable()); - Assertions.assertEquals(ConfigurationStatus.NO_STATUS, model.vmRecommendations().get(0).configurationStatus()); - Assertions - .assertEquals(RecommendationAction.RECOMMENDED, model.vmRecommendations().get(0).recommendationAction()); - Assertions.assertEquals("hlf", model.vmRecommendations().get(0).resourceId()); - Assertions.assertEquals(EnforcementSupport.SUPPORTED, model.vmRecommendations().get(0).enforcementSupport()); - Assertions.assertEquals("wahfbousnfepgfew", model.pathRecommendations().get(0).path()); - Assertions.assertEquals(RecommendationAction.ADD, model.pathRecommendations().get(0).action()); - Assertions.assertEquals(RecommendationType.IO_T_SHARED_CREDENTIALS, model.pathRecommendations().get(0).type()); - Assertions.assertEquals("ncxykxhdjhlimm", model.pathRecommendations().get(0).publisherInfo().publisherName()); - Assertions.assertEquals("x", model.pathRecommendations().get(0).publisherInfo().productName()); - Assertions.assertEquals("bcporxvxcjzhqizx", model.pathRecommendations().get(0).publisherInfo().binaryName()); - Assertions.assertEquals("xtgqscjavftjuh", model.pathRecommendations().get(0).publisherInfo().version()); - Assertions.assertEquals(true, model.pathRecommendations().get(0).common()); - Assertions.assertEquals("mtggu", model.pathRecommendations().get(0).userSids().get(0)); - Assertions.assertEquals(FileType.SCRIPT, model.pathRecommendations().get(0).fileType()); - Assertions.assertEquals(ConfigurationStatus.FAILED, model.pathRecommendations().get(0).configurationStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupInnerTests.java deleted file mode 100644 index 77f3305d4bde..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupInnerTests.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupInner; -import com.azure.resourcemanager.security.models.ConfigurationStatus; -import com.azure.resourcemanager.security.models.EnforcementMode; -import com.azure.resourcemanager.security.models.EnforcementSupport; -import com.azure.resourcemanager.security.models.FileType; -import com.azure.resourcemanager.security.models.PathRecommendation; -import com.azure.resourcemanager.security.models.ProtectionMode; -import com.azure.resourcemanager.security.models.RecommendationAction; -import com.azure.resourcemanager.security.models.RecommendationType; -import com.azure.resourcemanager.security.models.VmRecommendation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdaptiveApplicationControlGroupInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdaptiveApplicationControlGroupInner model = - BinaryData - .fromString( - "{\"properties\":{\"enforcementMode\":\"Enforce\",\"protectionMode\":{\"exe\":\"Audit\",\"msi\":\"Enforce\",\"script\":\"None\",\"executable\":\"Audit\"},\"configurationStatus\":\"Configured\",\"recommendationStatus\":\"NoStatus\",\"issues\":[{\"issue\":\"ExecutableViolationsAudited\",\"numberOfVms\":81.69838},{\"issue\":\"ExecutableViolationsAudited\",\"numberOfVms\":25.884687},{\"issue\":\"ViolationsBlocked\",\"numberOfVms\":0.6237805}],\"sourceSystem\":\"None\",\"vmRecommendations\":[{\"configurationStatus\":\"Failed\",\"recommendationAction\":\"Remove\",\"resourceId\":\"hlabrq\",\"enforcementSupport\":\"Unknown\"},{\"configurationStatus\":\"NoStatus\",\"recommendationAction\":\"Recommended\",\"resourceId\":\"trgaehvv\",\"enforcementSupport\":\"NotSupported\"},{\"configurationStatus\":\"NoStatus\",\"recommendationAction\":\"Remove\",\"resourceId\":\"oqbeitpkxzt\",\"enforcementSupport\":\"Supported\"},{\"configurationStatus\":\"InProgress\",\"recommendationAction\":\"Remove\",\"resourceId\":\"idgfc\",\"enforcementSupport\":\"NotSupported\"}],\"pathRecommendations\":[{\"path\":\"aqxzhemjyho\",\"action\":\"Remove\",\"type\":\"IoT_EdgeLoggingOptions\",\"common\":true,\"userSids\":[],\"usernames\":[],\"fileType\":\"Script\",\"configurationStatus\":\"Configured\"}]},\"location\":\"kb\",\"id\":\"wpfaj\",\"name\":\"jwltlwtjjgu\",\"type\":\"talhsnvkcdmxzr\"}") - .toObject(AdaptiveApplicationControlGroupInner.class); - Assertions.assertEquals(EnforcementMode.ENFORCE, model.enforcementMode()); - Assertions.assertEquals(EnforcementMode.AUDIT, model.protectionMode().exe()); - Assertions.assertEquals(EnforcementMode.ENFORCE, model.protectionMode().msi()); - Assertions.assertEquals(EnforcementMode.NONE, model.protectionMode().script()); - Assertions.assertEquals(EnforcementMode.AUDIT, model.protectionMode().executable()); - Assertions.assertEquals(ConfigurationStatus.FAILED, model.vmRecommendations().get(0).configurationStatus()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.vmRecommendations().get(0).recommendationAction()); - Assertions.assertEquals("hlabrq", model.vmRecommendations().get(0).resourceId()); - Assertions.assertEquals(EnforcementSupport.UNKNOWN, model.vmRecommendations().get(0).enforcementSupport()); - Assertions.assertEquals("aqxzhemjyho", model.pathRecommendations().get(0).path()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.pathRecommendations().get(0).action()); - Assertions - .assertEquals(RecommendationType.IO_T_EDGE_LOGGING_OPTIONS, model.pathRecommendations().get(0).type()); - Assertions.assertEquals(true, model.pathRecommendations().get(0).common()); - Assertions.assertEquals(FileType.SCRIPT, model.pathRecommendations().get(0).fileType()); - Assertions - .assertEquals(ConfigurationStatus.CONFIGURED, model.pathRecommendations().get(0).configurationStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdaptiveApplicationControlGroupInner model = - new AdaptiveApplicationControlGroupInner() - .withEnforcementMode(EnforcementMode.ENFORCE) - .withProtectionMode( - new ProtectionMode() - .withExe(EnforcementMode.AUDIT) - .withMsi(EnforcementMode.ENFORCE) - .withScript(EnforcementMode.NONE) - .withExecutable(EnforcementMode.AUDIT)) - .withVmRecommendations( - Arrays - .asList( - new VmRecommendation() - .withConfigurationStatus(ConfigurationStatus.FAILED) - .withRecommendationAction(RecommendationAction.REMOVE) - .withResourceId("hlabrq") - .withEnforcementSupport(EnforcementSupport.UNKNOWN), - new VmRecommendation() - .withConfigurationStatus(ConfigurationStatus.NO_STATUS) - .withRecommendationAction(RecommendationAction.RECOMMENDED) - .withResourceId("trgaehvv") - .withEnforcementSupport(EnforcementSupport.NOT_SUPPORTED), - new VmRecommendation() - .withConfigurationStatus(ConfigurationStatus.NO_STATUS) - .withRecommendationAction(RecommendationAction.REMOVE) - .withResourceId("oqbeitpkxzt") - .withEnforcementSupport(EnforcementSupport.SUPPORTED), - new VmRecommendation() - .withConfigurationStatus(ConfigurationStatus.IN_PROGRESS) - .withRecommendationAction(RecommendationAction.REMOVE) - .withResourceId("idgfc") - .withEnforcementSupport(EnforcementSupport.NOT_SUPPORTED))) - .withPathRecommendations( - Arrays - .asList( - new PathRecommendation() - .withPath("aqxzhemjyho") - .withAction(RecommendationAction.REMOVE) - .withType(RecommendationType.IO_T_EDGE_LOGGING_OPTIONS) - .withCommon(true) - .withUserSids(Arrays.asList()) - .withUsernames(Arrays.asList()) - .withFileType(FileType.SCRIPT) - .withConfigurationStatus(ConfigurationStatus.CONFIGURED))); - model = BinaryData.fromObject(model).toObject(AdaptiveApplicationControlGroupInner.class); - Assertions.assertEquals(EnforcementMode.ENFORCE, model.enforcementMode()); - Assertions.assertEquals(EnforcementMode.AUDIT, model.protectionMode().exe()); - Assertions.assertEquals(EnforcementMode.ENFORCE, model.protectionMode().msi()); - Assertions.assertEquals(EnforcementMode.NONE, model.protectionMode().script()); - Assertions.assertEquals(EnforcementMode.AUDIT, model.protectionMode().executable()); - Assertions.assertEquals(ConfigurationStatus.FAILED, model.vmRecommendations().get(0).configurationStatus()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.vmRecommendations().get(0).recommendationAction()); - Assertions.assertEquals("hlabrq", model.vmRecommendations().get(0).resourceId()); - Assertions.assertEquals(EnforcementSupport.UNKNOWN, model.vmRecommendations().get(0).enforcementSupport()); - Assertions.assertEquals("aqxzhemjyho", model.pathRecommendations().get(0).path()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.pathRecommendations().get(0).action()); - Assertions - .assertEquals(RecommendationType.IO_T_EDGE_LOGGING_OPTIONS, model.pathRecommendations().get(0).type()); - Assertions.assertEquals(true, model.pathRecommendations().get(0).common()); - Assertions.assertEquals(FileType.SCRIPT, model.pathRecommendations().get(0).fileType()); - Assertions - .assertEquals(ConfigurationStatus.CONFIGURED, model.pathRecommendations().get(0).configurationStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupsInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupsInnerTests.java deleted file mode 100644 index 3dc11f75363d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupsInnerTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupInner; -import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupsInner; -import com.azure.resourcemanager.security.models.EnforcementMode; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdaptiveApplicationControlGroupsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdaptiveApplicationControlGroupsInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"enforcementMode\":\"Audit\",\"configurationStatus\":\"InProgress\",\"recommendationStatus\":\"Recommended\",\"issues\":[],\"sourceSystem\":\"None\",\"vmRecommendations\":[],\"pathRecommendations\":[]},\"location\":\"cojocqwogfnzjvus\",\"id\":\"zldmozuxy\",\"name\":\"fsbtkad\",\"type\":\"ysownbtgkbug\"},{\"properties\":{\"enforcementMode\":\"Enforce\",\"configurationStatus\":\"Failed\",\"recommendationStatus\":\"NotRecommended\",\"issues\":[],\"sourceSystem\":\"None\",\"vmRecommendations\":[],\"pathRecommendations\":[]},\"location\":\"eypefojyqd\",\"id\":\"cuplcplcwkhih\",\"name\":\"hlhzdsqtzbsrgno\",\"type\":\"cjhfgmvecactxmw\"},{\"properties\":{\"enforcementMode\":\"None\",\"configurationStatus\":\"InProgress\",\"recommendationStatus\":\"NotAvailable\",\"issues\":[],\"sourceSystem\":\"Azure_AppLocker\",\"vmRecommendations\":[],\"pathRecommendations\":[]},\"location\":\"qvgqouw\",\"id\":\"fzmpjwyivq\",\"name\":\"kfxcvhrfs\",\"type\":\"huagrttikteusqc\"},{\"properties\":{\"enforcementMode\":\"Audit\",\"configurationStatus\":\"Failed\",\"recommendationStatus\":\"NotAvailable\",\"issues\":[],\"sourceSystem\":\"NonAzure_AuditD\",\"vmRecommendations\":[],\"pathRecommendations\":[]},\"location\":\"mmfblcqcuubgqib\",\"id\":\"talmett\",\"name\":\"wgdsl\",\"type\":\"xih\"}]}") - .toObject(AdaptiveApplicationControlGroupsInner.class); - Assertions.assertEquals(EnforcementMode.AUDIT, model.value().get(0).enforcementMode()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdaptiveApplicationControlGroupsInner model = - new AdaptiveApplicationControlGroupsInner() - .withValue( - Arrays - .asList( - new AdaptiveApplicationControlGroupInner() - .withEnforcementMode(EnforcementMode.AUDIT) - .withVmRecommendations(Arrays.asList()) - .withPathRecommendations(Arrays.asList()), - new AdaptiveApplicationControlGroupInner() - .withEnforcementMode(EnforcementMode.ENFORCE) - .withVmRecommendations(Arrays.asList()) - .withPathRecommendations(Arrays.asList()), - new AdaptiveApplicationControlGroupInner() - .withEnforcementMode(EnforcementMode.NONE) - .withVmRecommendations(Arrays.asList()) - .withPathRecommendations(Arrays.asList()), - new AdaptiveApplicationControlGroupInner() - .withEnforcementMode(EnforcementMode.AUDIT) - .withVmRecommendations(Arrays.asList()) - .withPathRecommendations(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(AdaptiveApplicationControlGroupsInner.class); - Assertions.assertEquals(EnforcementMode.AUDIT, model.value().get(0).enforcementMode()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlIssueSummaryTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlIssueSummaryTests.java deleted file mode 100644 index 697071e2a2b5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlIssueSummaryTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControlIssue; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControlIssueSummary; -import org.junit.jupiter.api.Assertions; - -public final class AdaptiveApplicationControlIssueSummaryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdaptiveApplicationControlIssueSummary model = - BinaryData - .fromString("{\"issue\":\"ViolationsAudited\",\"numberOfVms\":60.195232}") - .toObject(AdaptiveApplicationControlIssueSummary.class); - Assertions.assertEquals(AdaptiveApplicationControlIssue.VIOLATIONS_AUDITED, model.issue()); - Assertions.assertEquals(60.195232F, model.numberOfVms()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdaptiveApplicationControlIssueSummary model = - new AdaptiveApplicationControlIssueSummary() - .withIssue(AdaptiveApplicationControlIssue.VIOLATIONS_AUDITED) - .withNumberOfVms(60.195232F); - model = BinaryData.fromObject(model).toObject(AdaptiveApplicationControlIssueSummary.class); - Assertions.assertEquals(AdaptiveApplicationControlIssue.VIOLATIONS_AUDITED, model.issue()); - Assertions.assertEquals(60.195232F, model.numberOfVms()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsDeleteByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 6c7d348dab9a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdaptiveApplicationControlsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .adaptiveApplicationControls() - .deleteByResourceGroupWithResponse("cfogxhcxnwjt", "fdz", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsGetWithResponseMockTests.java deleted file mode 100644 index f5db92120fbc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsGetWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControlGroup; -import com.azure.resourcemanager.security.models.EnforcementMode; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdaptiveApplicationControlsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"enforcementMode\":\"Enforce\",\"protectionMode\":{\"exe\":\"Enforce\",\"msi\":\"Enforce\",\"script\":\"None\",\"executable\":\"Enforce\"},\"configurationStatus\":\"NoStatus\",\"recommendationStatus\":\"Recommended\",\"issues\":[],\"sourceSystem\":\"NonAzure_AuditD\",\"vmRecommendations\":[],\"pathRecommendations\":[]},\"location\":\"mef\",\"id\":\"vhkmoogjrhskbwgm\",\"name\":\"g\",\"type\":\"u\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AdaptiveApplicationControlGroup response = - manager - .adaptiveApplicationControls() - .getWithResponse("sgwqpsqaz", "hqodv", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(EnforcementMode.ENFORCE, response.enforcementMode()); - Assertions.assertEquals(EnforcementMode.ENFORCE, response.protectionMode().exe()); - Assertions.assertEquals(EnforcementMode.ENFORCE, response.protectionMode().msi()); - Assertions.assertEquals(EnforcementMode.NONE, response.protectionMode().script()); - Assertions.assertEquals(EnforcementMode.ENFORCE, response.protectionMode().executable()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsListWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsListWithResponseMockTests.java deleted file mode 100644 index 69308fc853bb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsListWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControlGroups; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdaptiveApplicationControlsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"pfuofixcnpcfykkp\",\"id\":\"ycpawm\",\"name\":\"jp\",\"type\":\"dpwrp\"},{\"location\":\"pcf\",\"id\":\"fwzlgzawkgyepeya\",\"name\":\"nnidmdiawpzxk\",\"type\":\"rntmkctdhu\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AdaptiveApplicationControlGroups response = - manager - .adaptiveApplicationControls() - .listWithResponse(false, true, com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsPutWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsPutWithResponseMockTests.java deleted file mode 100644 index 4a6d08c82594..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsPutWithResponseMockTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControlGroup; -import com.azure.resourcemanager.security.models.EnforcementMode; -import com.azure.resourcemanager.security.models.ProtectionMode; -import java.nio.ByteBuffer; -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 org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdaptiveApplicationControlsPutWithResponseMockTests { - @Test - public void testPutWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"enforcementMode\":\"Enforce\",\"protectionMode\":{\"exe\":\"None\",\"msi\":\"Audit\",\"script\":\"None\",\"executable\":\"Enforce\"},\"configurationStatus\":\"InProgress\",\"recommendationStatus\":\"NoStatus\",\"issues\":[],\"sourceSystem\":\"Azure_AuditD\",\"vmRecommendations\":[],\"pathRecommendations\":[]},\"location\":\"zusitoqcahfs\",\"id\":\"bjmlreesrfwssz\",\"name\":\"lc\",\"type\":\"lisolntfxxc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AdaptiveApplicationControlGroup response = - manager - .adaptiveApplicationControls() - .define("uzfwo") - .withExistingLocation("c") - .withEnforcementMode(EnforcementMode.AUDIT) - .withProtectionMode( - new ProtectionMode() - .withExe(EnforcementMode.ENFORCE) - .withMsi(EnforcementMode.ENFORCE) - .withScript(EnforcementMode.ENFORCE) - .withExecutable(EnforcementMode.ENFORCE)) - .withVmRecommendations(Arrays.asList()) - .withPathRecommendations(Arrays.asList()) - .create(); - - Assertions.assertEquals(EnforcementMode.ENFORCE, response.enforcementMode()); - Assertions.assertEquals(EnforcementMode.NONE, response.protectionMode().exe()); - Assertions.assertEquals(EnforcementMode.AUDIT, response.protectionMode().msi()); - Assertions.assertEquals(EnforcementMode.NONE, response.protectionMode().script()); - Assertions.assertEquals(EnforcementMode.ENFORCE, response.protectionMode().executable()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningEnforceRequestTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningEnforceRequestTests.java deleted file mode 100644 index 42e85757a0fb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningEnforceRequestTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AdaptiveNetworkHardeningEnforceRequest; -import com.azure.resourcemanager.security.models.Direction; -import com.azure.resourcemanager.security.models.Rule; -import com.azure.resourcemanager.security.models.TransportProtocol; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdaptiveNetworkHardeningEnforceRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdaptiveNetworkHardeningEnforceRequest model = - BinaryData - .fromString( - "{\"rules\":[{\"name\":\"vyc\",\"direction\":\"Inbound\",\"destinationPort\":1491139189,\"protocols\":[\"UDP\"],\"ipAddresses\":[\"nfnw\",\"btmvpdvjdhttza\",\"fedxihchrphkm\",\"rjdqnsdfzp\"]}],\"networkSecurityGroups\":[\"tg\",\"ylkdghrje\",\"utlwxezwzhok\"]}") - .toObject(AdaptiveNetworkHardeningEnforceRequest.class); - Assertions.assertEquals("vyc", model.rules().get(0).name()); - Assertions.assertEquals(Direction.INBOUND, model.rules().get(0).direction()); - Assertions.assertEquals(1491139189, model.rules().get(0).destinationPort()); - Assertions.assertEquals(TransportProtocol.UDP, model.rules().get(0).protocols().get(0)); - Assertions.assertEquals("nfnw", model.rules().get(0).ipAddresses().get(0)); - Assertions.assertEquals("tg", model.networkSecurityGroups().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdaptiveNetworkHardeningEnforceRequest model = - new AdaptiveNetworkHardeningEnforceRequest() - .withRules( - Arrays - .asList( - new Rule() - .withName("vyc") - .withDirection(Direction.INBOUND) - .withDestinationPort(1491139189) - .withProtocols(Arrays.asList(TransportProtocol.UDP)) - .withIpAddresses( - Arrays.asList("nfnw", "btmvpdvjdhttza", "fedxihchrphkm", "rjdqnsdfzp")))) - .withNetworkSecurityGroups(Arrays.asList("tg", "ylkdghrje", "utlwxezwzhok")); - model = BinaryData.fromObject(model).toObject(AdaptiveNetworkHardeningEnforceRequest.class); - Assertions.assertEquals("vyc", model.rules().get(0).name()); - Assertions.assertEquals(Direction.INBOUND, model.rules().get(0).direction()); - Assertions.assertEquals(1491139189, model.rules().get(0).destinationPort()); - Assertions.assertEquals(TransportProtocol.UDP, model.rules().get(0).protocols().get(0)); - Assertions.assertEquals("nfnw", model.rules().get(0).ipAddresses().get(0)); - Assertions.assertEquals("tg", model.networkSecurityGroups().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningInnerTests.java deleted file mode 100644 index da41e2e59d87..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningInnerTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AdaptiveNetworkHardeningInner; -import com.azure.resourcemanager.security.models.Direction; -import com.azure.resourcemanager.security.models.EffectiveNetworkSecurityGroups; -import com.azure.resourcemanager.security.models.Rule; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdaptiveNetworkHardeningInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdaptiveNetworkHardeningInner model = - BinaryData - .fromString( - "{\"properties\":{\"rules\":[{\"name\":\"rfe\",\"direction\":\"Outbound\",\"destinationPort\":301630864,\"protocols\":[],\"ipAddresses\":[]},{\"name\":\"hcans\",\"direction\":\"Inbound\",\"destinationPort\":1800110701,\"protocols\":[],\"ipAddresses\":[]},{\"name\":\"igdivbkbxg\",\"direction\":\"Inbound\",\"destinationPort\":2081513021,\"protocols\":[],\"ipAddresses\":[]},{\"name\":\"sqvdaeyygux\",\"direction\":\"Outbound\",\"destinationPort\":1119953964,\"protocols\":[],\"ipAddresses\":[]}],\"rulesCalculationTime\":\"2021-01-11T12:34:59Z\",\"effectiveNetworkSecurityGroups\":[{\"networkInterface\":\"gims\",\"networkSecurityGroups\":[]},{\"networkInterface\":\"asi\",\"networkSecurityGroups\":[]}]},\"id\":\"dyvvjskgfmocwahp\",\"name\":\"gat\",\"type\":\"eaahhvjhhn\"}") - .toObject(AdaptiveNetworkHardeningInner.class); - Assertions.assertEquals("rfe", model.rules().get(0).name()); - Assertions.assertEquals(Direction.OUTBOUND, model.rules().get(0).direction()); - Assertions.assertEquals(301630864, model.rules().get(0).destinationPort()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T12:34:59Z"), model.rulesCalculationTime()); - Assertions.assertEquals("gims", model.effectiveNetworkSecurityGroups().get(0).networkInterface()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdaptiveNetworkHardeningInner model = - new AdaptiveNetworkHardeningInner() - .withRules( - Arrays - .asList( - new Rule() - .withName("rfe") - .withDirection(Direction.OUTBOUND) - .withDestinationPort(301630864) - .withProtocols(Arrays.asList()) - .withIpAddresses(Arrays.asList()), - new Rule() - .withName("hcans") - .withDirection(Direction.INBOUND) - .withDestinationPort(1800110701) - .withProtocols(Arrays.asList()) - .withIpAddresses(Arrays.asList()), - new Rule() - .withName("igdivbkbxg") - .withDirection(Direction.INBOUND) - .withDestinationPort(2081513021) - .withProtocols(Arrays.asList()) - .withIpAddresses(Arrays.asList()), - new Rule() - .withName("sqvdaeyygux") - .withDirection(Direction.OUTBOUND) - .withDestinationPort(1119953964) - .withProtocols(Arrays.asList()) - .withIpAddresses(Arrays.asList()))) - .withRulesCalculationTime(OffsetDateTime.parse("2021-01-11T12:34:59Z")) - .withEffectiveNetworkSecurityGroups( - Arrays - .asList( - new EffectiveNetworkSecurityGroups() - .withNetworkInterface("gims") - .withNetworkSecurityGroups(Arrays.asList()), - new EffectiveNetworkSecurityGroups() - .withNetworkInterface("asi") - .withNetworkSecurityGroups(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(AdaptiveNetworkHardeningInner.class); - Assertions.assertEquals("rfe", model.rules().get(0).name()); - Assertions.assertEquals(Direction.OUTBOUND, model.rules().get(0).direction()); - Assertions.assertEquals(301630864, model.rules().get(0).destinationPort()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T12:34:59Z"), model.rulesCalculationTime()); - Assertions.assertEquals("gims", model.effectiveNetworkSecurityGroups().get(0).networkInterface()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningPropertiesTests.java deleted file mode 100644 index 171862be894e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningPropertiesTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AdaptiveNetworkHardeningProperties; -import com.azure.resourcemanager.security.models.Direction; -import com.azure.resourcemanager.security.models.EffectiveNetworkSecurityGroups; -import com.azure.resourcemanager.security.models.Rule; -import com.azure.resourcemanager.security.models.TransportProtocol; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdaptiveNetworkHardeningPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdaptiveNetworkHardeningProperties model = - BinaryData - .fromString( - "{\"rules\":[{\"name\":\"bbjjidjksyxk\",\"direction\":\"Inbound\",\"destinationPort\":1732474011,\"protocols\":[\"TCP\",\"UDP\"],\"ipAddresses\":[\"dnlj\",\"age\"]},{\"name\":\"ulxunsmjbnkpp\",\"direction\":\"Outbound\",\"destinationPort\":2047909976,\"protocols\":[\"TCP\",\"TCP\",\"TCP\",\"TCP\"],\"ipAddresses\":[\"gwklnsr\"]}],\"rulesCalculationTime\":\"2021-08-04T15:57:37Z\",\"effectiveNetworkSecurityGroups\":[{\"networkInterface\":\"xcktpiymerteeamm\",\"networkSecurityGroups\":[\"ekkkzd\",\"rtkgdojbmxvavref\",\"eesvecu\",\"jpxtxsuwprtuj\"]},{\"networkInterface\":\"awddjibab\",\"networkSecurityGroups\":[\"titvtzeexavox\",\"fglecdmdqbwp\",\"pqtgsfjac\",\"slhhxudbxv\"]},{\"networkInterface\":\"htnsi\",\"networkSecurityGroups\":[\"hzmme\",\"ckdlpag\",\"rcxfailcfxwmdb\"]}]}") - .toObject(AdaptiveNetworkHardeningProperties.class); - Assertions.assertEquals("bbjjidjksyxk", model.rules().get(0).name()); - Assertions.assertEquals(Direction.INBOUND, model.rules().get(0).direction()); - Assertions.assertEquals(1732474011, model.rules().get(0).destinationPort()); - Assertions.assertEquals(TransportProtocol.TCP, model.rules().get(0).protocols().get(0)); - Assertions.assertEquals("dnlj", model.rules().get(0).ipAddresses().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-04T15:57:37Z"), model.rulesCalculationTime()); - Assertions.assertEquals("xcktpiymerteeamm", model.effectiveNetworkSecurityGroups().get(0).networkInterface()); - Assertions.assertEquals("ekkkzd", model.effectiveNetworkSecurityGroups().get(0).networkSecurityGroups().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdaptiveNetworkHardeningProperties model = - new AdaptiveNetworkHardeningProperties() - .withRules( - Arrays - .asList( - new Rule() - .withName("bbjjidjksyxk") - .withDirection(Direction.INBOUND) - .withDestinationPort(1732474011) - .withProtocols(Arrays.asList(TransportProtocol.TCP, TransportProtocol.UDP)) - .withIpAddresses(Arrays.asList("dnlj", "age")), - new Rule() - .withName("ulxunsmjbnkpp") - .withDirection(Direction.OUTBOUND) - .withDestinationPort(2047909976) - .withProtocols( - Arrays - .asList( - TransportProtocol.TCP, - TransportProtocol.TCP, - TransportProtocol.TCP, - TransportProtocol.TCP)) - .withIpAddresses(Arrays.asList("gwklnsr")))) - .withRulesCalculationTime(OffsetDateTime.parse("2021-08-04T15:57:37Z")) - .withEffectiveNetworkSecurityGroups( - Arrays - .asList( - new EffectiveNetworkSecurityGroups() - .withNetworkInterface("xcktpiymerteeamm") - .withNetworkSecurityGroups( - Arrays.asList("ekkkzd", "rtkgdojbmxvavref", "eesvecu", "jpxtxsuwprtuj")), - new EffectiveNetworkSecurityGroups() - .withNetworkInterface("awddjibab") - .withNetworkSecurityGroups( - Arrays.asList("titvtzeexavox", "fglecdmdqbwp", "pqtgsfjac", "slhhxudbxv")), - new EffectiveNetworkSecurityGroups() - .withNetworkInterface("htnsi") - .withNetworkSecurityGroups(Arrays.asList("hzmme", "ckdlpag", "rcxfailcfxwmdb")))); - model = BinaryData.fromObject(model).toObject(AdaptiveNetworkHardeningProperties.class); - Assertions.assertEquals("bbjjidjksyxk", model.rules().get(0).name()); - Assertions.assertEquals(Direction.INBOUND, model.rules().get(0).direction()); - Assertions.assertEquals(1732474011, model.rules().get(0).destinationPort()); - Assertions.assertEquals(TransportProtocol.TCP, model.rules().get(0).protocols().get(0)); - Assertions.assertEquals("dnlj", model.rules().get(0).ipAddresses().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-04T15:57:37Z"), model.rulesCalculationTime()); - Assertions.assertEquals("xcktpiymerteeamm", model.effectiveNetworkSecurityGroups().get(0).networkInterface()); - Assertions.assertEquals("ekkkzd", model.effectiveNetworkSecurityGroups().get(0).networkSecurityGroups().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsEnforceMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsEnforceMockTests.java deleted file mode 100644 index ca9b785dd927..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsEnforceMockTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AdaptiveNetworkHardeningEnforceRequest; -import com.azure.resourcemanager.security.models.Direction; -import com.azure.resourcemanager.security.models.Rule; -import com.azure.resourcemanager.security.models.TransportProtocol; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdaptiveNetworkHardeningsEnforceMockTests { - @Test - public void testEnforce() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .adaptiveNetworkHardenings() - .enforce( - "qs", - "eiihfymko", - "ihyeseu", - "gcigzh", - "gsmgb", - new AdaptiveNetworkHardeningEnforceRequest() - .withRules( - Arrays - .asList( - new Rule() - .withName("dwrqbeb") - .withDirection(Direction.OUTBOUND) - .withDestinationPort(2023900183) - .withProtocols(Arrays.asList(TransportProtocol.TCP)) - .withIpAddresses(Arrays.asList("vkbiw", "nhtfgfi", "udy")))) - .withNetworkSecurityGroups(Arrays.asList("zpacz", "uhbcak")), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsGetWithResponseMockTests.java deleted file mode 100644 index 8e5c9412fac9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AdaptiveNetworkHardening; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdaptiveNetworkHardeningsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"rules\":[],\"rulesCalculationTime\":\"2021-08-13T04:35:03Z\",\"effectiveNetworkSecurityGroups\":[]},\"id\":\"ybkekym\",\"name\":\"fztsi\",\"type\":\"sc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AdaptiveNetworkHardening response = - manager - .adaptiveNetworkHardenings() - .getWithResponse("ktwtk", "ih", "pfliwo", "nguuzhwvla", "p", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(OffsetDateTime.parse("2021-08-13T04:35:03Z"), response.rulesCalculationTime()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListByExtendedResourceMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListByExtendedResourceMockTests.java deleted file mode 100644 index 3e866aa96567..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListByExtendedResourceMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AdaptiveNetworkHardening; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdaptiveNetworkHardeningsListByExtendedResourceMockTests { - @Test - public void testListByExtendedResource() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"rules\":[],\"rulesCalculationTime\":\"2021-10-09T16:12:07Z\",\"effectiveNetworkSecurityGroups\":[]},\"id\":\"qmqipaydhfnzoc\",\"name\":\"mtfshksnyzmspa\",\"type\":\"wbwmbnlslcefiq\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .adaptiveNetworkHardenings() - .listByExtendedResource( - "qmipfj", "foygizmshxxba", "zabulnvgsk", "toxjdzj", com.azure.core.util.Context.NONE); - - Assertions - .assertEquals( - OffsetDateTime.parse("2021-10-09T16:12:07Z"), response.iterator().next().rulesCalculationTime()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListTests.java deleted file mode 100644 index dbf2ff91a164..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AdaptiveNetworkHardeningInner; -import com.azure.resourcemanager.security.models.AdaptiveNetworkHardeningsList; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdaptiveNetworkHardeningsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdaptiveNetworkHardeningsList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"rules\":[],\"rulesCalculationTime\":\"2021-02-04T03:03:52Z\",\"effectiveNetworkSecurityGroups\":[]},\"id\":\"pgclrciv\",\"name\":\"soxfrken\",\"type\":\"pmyyefrpmpdnqq\"},{\"properties\":{\"rules\":[],\"rulesCalculationTime\":\"2021-07-14T06:34:32Z\",\"effectiveNetworkSecurityGroups\":[]},\"id\":\"qvmmbn\",\"name\":\"qfr\",\"type\":\"qlkzme\"}],\"nextLink\":\"itgvkx\"}") - .toObject(AdaptiveNetworkHardeningsList.class); - Assertions - .assertEquals(OffsetDateTime.parse("2021-02-04T03:03:52Z"), model.value().get(0).rulesCalculationTime()); - Assertions.assertEquals("itgvkx", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdaptiveNetworkHardeningsList model = - new AdaptiveNetworkHardeningsList() - .withValue( - Arrays - .asList( - new AdaptiveNetworkHardeningInner() - .withRules(Arrays.asList()) - .withRulesCalculationTime(OffsetDateTime.parse("2021-02-04T03:03:52Z")) - .withEffectiveNetworkSecurityGroups(Arrays.asList()), - new AdaptiveNetworkHardeningInner() - .withRules(Arrays.asList()) - .withRulesCalculationTime(OffsetDateTime.parse("2021-07-14T06:34:32Z")) - .withEffectiveNetworkSecurityGroups(Arrays.asList()))) - .withNextLink("itgvkx"); - model = BinaryData.fromObject(model).toObject(AdaptiveNetworkHardeningsList.class); - Assertions - .assertEquals(OffsetDateTime.parse("2021-02-04T03:03:52Z"), model.value().get(0).rulesCalculationTime()); - Assertions.assertEquals("itgvkx", model.nextLink()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdditionalDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdditionalDataTests.java deleted file mode 100644 index eba091dd52f7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdditionalDataTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AdditionalData; - -public final class AdditionalDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdditionalData model = - BinaryData.fromString("{\"assessedResourceType\":\"AdditionalData\"}").toObject(AdditionalData.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdditionalData model = new AdditionalData(); - model = BinaryData.fromObject(model).toObject(AdditionalData.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdditionalWorkspacesPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdditionalWorkspacesPropertiesTests.java deleted file mode 100644 index d6a5a12cda1c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdditionalWorkspacesPropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AdditionalWorkspaceDataType; -import com.azure.resourcemanager.security.models.AdditionalWorkspaceType; -import com.azure.resourcemanager.security.models.AdditionalWorkspacesProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdditionalWorkspacesPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdditionalWorkspacesProperties model = - BinaryData - .fromString("{\"workspace\":\"yq\",\"type\":\"Sentinel\",\"dataTypes\":[\"Alerts\",\"RawEvents\"]}") - .toObject(AdditionalWorkspacesProperties.class); - Assertions.assertEquals("yq", model.workspace()); - Assertions.assertEquals(AdditionalWorkspaceType.SENTINEL, model.type()); - Assertions.assertEquals(AdditionalWorkspaceDataType.ALERTS, model.dataTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdditionalWorkspacesProperties model = - new AdditionalWorkspacesProperties() - .withWorkspace("yq") - .withType(AdditionalWorkspaceType.SENTINEL) - .withDataTypes( - Arrays.asList(AdditionalWorkspaceDataType.ALERTS, AdditionalWorkspaceDataType.RAW_EVENTS)); - model = BinaryData.fromObject(model).toObject(AdditionalWorkspacesProperties.class); - Assertions.assertEquals("yq", model.workspace()); - Assertions.assertEquals(AdditionalWorkspaceType.SENTINEL, model.type()); - Assertions.assertEquals(AdditionalWorkspaceDataType.ALERTS, model.dataTypes().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionPropertiesTests.java deleted file mode 100644 index 1f1bceab6521..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AdvancedThreatProtectionProperties; -import org.junit.jupiter.api.Assertions; - -public final class AdvancedThreatProtectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdvancedThreatProtectionProperties model = - BinaryData.fromString("{\"isEnabled\":false}").toObject(AdvancedThreatProtectionProperties.class); - Assertions.assertEquals(false, model.isEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdvancedThreatProtectionProperties model = new AdvancedThreatProtectionProperties().withIsEnabled(false); - model = BinaryData.fromObject(model).toObject(AdvancedThreatProtectionProperties.class); - Assertions.assertEquals(false, model.isEnabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionSettingInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionSettingInnerTests.java deleted file mode 100644 index 91035c765ee1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionSettingInnerTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AdvancedThreatProtectionSettingInner; -import org.junit.jupiter.api.Assertions; - -public final class AdvancedThreatProtectionSettingInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdvancedThreatProtectionSettingInner model = - BinaryData - .fromString( - "{\"properties\":{\"isEnabled\":true},\"id\":\"ijcmmx\",\"name\":\"cufufsrpymz\",\"type\":\"dnsezcxtbzs\"}") - .toObject(AdvancedThreatProtectionSettingInner.class); - Assertions.assertEquals(true, model.isEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdvancedThreatProtectionSettingInner model = new AdvancedThreatProtectionSettingInner().withIsEnabled(true); - model = BinaryData.fromObject(model).toObject(AdvancedThreatProtectionSettingInner.class); - Assertions.assertEquals(true, model.isEnabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionsCreateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionsCreateWithResponseMockTests.java deleted file mode 100644 index a9ecc1d834ab..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionsCreateWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AdvancedThreatProtectionSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdvancedThreatProtectionsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"isEnabled\":true},\"id\":\"lwljss\",\"name\":\"ctsnldkpwol\",\"type\":\"isubxbteog\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AdvancedThreatProtectionSetting response = - manager.advancedThreatProtections().define().withExistingResourceId("ezay").withIsEnabled(true).create(); - - Assertions.assertEquals(true, response.isEnabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionsGetWithResponseMockTests.java deleted file mode 100644 index 094f2c1cb2ab..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AdvancedThreatProtectionSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdvancedThreatProtectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"isEnabled\":true},\"id\":\"minxojjluxxdh\",\"name\":\"lzzdz\",\"type\":\"qjm\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AdvancedThreatProtectionSetting response = - manager.advancedThreatProtections().getWithResponse("jlf", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals(true, response.isEnabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertEntityTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertEntityTests.java deleted file mode 100644 index 8db52d56935a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertEntityTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AlertEntity; -import java.util.HashMap; -import java.util.Map; - -public final class AlertEntityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AlertEntity model = - BinaryData - .fromString( - "{\"type\":\"hqjjys\",\"\":{\"mpqvwwsk\":\"datalpshhkvpedwqslsr\",\"uvqejosovyrrle\":\"datandcbrwi\"}}") - .toObject(AlertEntity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertEntity model = new AlertEntity().withAdditionalProperties(mapOf("type", "hqjjys")); - model = BinaryData.fromObject(model).toObject(AlertEntity.class); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertPropertiesSupportingEvidenceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertPropertiesSupportingEvidenceTests.java deleted file mode 100644 index dce644a75666..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertPropertiesSupportingEvidenceTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AlertPropertiesSupportingEvidence; -import java.util.HashMap; -import java.util.Map; - -public final class AlertPropertiesSupportingEvidenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AlertPropertiesSupportingEvidence model = - BinaryData - .fromString( - "{\"type\":\"sinuqtljqobbpih\",\"\":{\"bmpxdlvykfrexc\":\"dataecybmrqbrj\",\"qwjksghudgz\":\"datas\",\"ggsvoujkxibdaf\":\"dataxog\",\"xfbvfb\":\"datarkmdyom\"}}") - .toObject(AlertPropertiesSupportingEvidence.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertPropertiesSupportingEvidence model = - new AlertPropertiesSupportingEvidence().withAdditionalProperties(mapOf("type", "sinuqtljqobbpih")); - model = BinaryData.fromObject(model).toObject(AlertPropertiesSupportingEvidence.class); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorBundlesRequestPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorBundlesRequestPropertiesTests.java deleted file mode 100644 index 3188369dec35..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorBundlesRequestPropertiesTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AlertSimulatorBundlesRequestProperties; -import com.azure.resourcemanager.security.models.BundleType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AlertSimulatorBundlesRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AlertSimulatorBundlesRequestProperties model = - BinaryData - .fromString( - "{\"kind\":\"Bundles\",\"bundles\":[\"DNS\"],\"\":{\"dtfohfaog\":\"datakywymxgaabj\",\"ykcrraue\":\"datavkiwrsiwdyjqu\",\"ddacbcbgydlqidy\":\"datakcsueho\"}}") - .toObject(AlertSimulatorBundlesRequestProperties.class); - Assertions.assertEquals(BundleType.DNS, model.bundles().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertSimulatorBundlesRequestProperties model = - new AlertSimulatorBundlesRequestProperties().withBundles(Arrays.asList(BundleType.DNS)); - model = BinaryData.fromObject(model).toObject(AlertSimulatorBundlesRequestProperties.class); - Assertions.assertEquals(BundleType.DNS, model.bundles().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorRequestBodyTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorRequestBodyTests.java deleted file mode 100644 index 346f3c6d98e1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorRequestBodyTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AlertSimulatorRequestBody; -import com.azure.resourcemanager.security.models.AlertSimulatorRequestProperties; -import java.util.HashMap; -import java.util.Map; - -public final class AlertSimulatorRequestBodyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AlertSimulatorRequestBody model = - BinaryData - .fromString( - "{\"properties\":{\"kind\":\"AlertSimulatorRequestProperties\",\"\":{\"gddeimaw\":\"datarhpw\"}}}") - .toObject(AlertSimulatorRequestBody.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertSimulatorRequestBody model = - new AlertSimulatorRequestBody() - .withProperties( - new AlertSimulatorRequestProperties() - .withAdditionalProperties(mapOf("kind", "AlertSimulatorRequestProperties"))); - model = BinaryData.fromObject(model).toObject(AlertSimulatorRequestBody.class); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorRequestPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorRequestPropertiesTests.java deleted file mode 100644 index e6ff4dc8f323..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorRequestPropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AlertSimulatorRequestProperties; -import java.util.HashMap; -import java.util.Map; - -public final class AlertSimulatorRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AlertSimulatorRequestProperties model = - BinaryData - .fromString("{\"kind\":\"AlertSimulatorRequestProperties\",\"\":{\"aztb\":\"datagkkumuikjcj\"}}") - .toObject(AlertSimulatorRequestProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertSimulatorRequestProperties model = - new AlertSimulatorRequestProperties() - .withAdditionalProperties(mapOf("kind", "AlertSimulatorRequestProperties")); - model = BinaryData.fromObject(model).toObject(AlertSimulatorRequestProperties.class); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSyncSettingPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSyncSettingPropertiesTests.java deleted file mode 100644 index 6020bd948993..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSyncSettingPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AlertSyncSettingProperties; -import org.junit.jupiter.api.Assertions; - -public final class AlertSyncSettingPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AlertSyncSettingProperties model = - BinaryData.fromString("{\"enabled\":true}").toObject(AlertSyncSettingProperties.class); - Assertions.assertEquals(true, model.enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertSyncSettingProperties model = new AlertSyncSettingProperties().withEnabled(true); - model = BinaryData.fromObject(model).toObject(AlertSyncSettingProperties.class); - Assertions.assertEquals(true, model.enabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSyncSettingsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSyncSettingsTests.java deleted file mode 100644 index 29517813259d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSyncSettingsTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AlertSyncSettings; -import org.junit.jupiter.api.Assertions; - -public final class AlertSyncSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AlertSyncSettings model = - BinaryData - .fromString( - "{\"kind\":\"AlertSyncSettings\",\"properties\":{\"enabled\":false},\"id\":\"leexahvmywh\",\"name\":\"brcary\",\"type\":\"sjjzyvoaqajuveh\"}") - .toObject(AlertSyncSettings.class); - Assertions.assertEquals(false, model.enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertSyncSettings model = new AlertSyncSettings().withEnabled(false); - model = BinaryData.fromObject(model).toObject(AlertSyncSettings.class); - Assertions.assertEquals(false, model.enabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRuleInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRuleInnerTests.java deleted file mode 100644 index 579dcb7c5fe3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRuleInnerTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import com.azure.resourcemanager.security.models.RuleState; -import com.azure.resourcemanager.security.models.SuppressionAlertsScope; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AlertsSuppressionRuleInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AlertsSuppressionRuleInner model = - BinaryData - .fromString( - "{\"properties\":{\"alertType\":\"vhmxtdrjfu\",\"lastModifiedUtc\":\"2021-09-25T19:58:32Z\",\"expirationDateUtc\":\"2021-07-27T22:13:32Z\",\"reason\":\"bj\",\"state\":\"Expired\",\"comment\":\"zcjznmwcpmgua\",\"suppressionAlertsScope\":{\"allOf\":[]}},\"id\":\"aufactkahzovajjz\",\"name\":\"uxxpshne\",\"type\":\"kulfg\"}") - .toObject(AlertsSuppressionRuleInner.class); - Assertions.assertEquals("vhmxtdrjfu", model.alertType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-27T22:13:32Z"), model.expirationDateUtc()); - Assertions.assertEquals("bj", model.reason()); - Assertions.assertEquals(RuleState.EXPIRED, model.state()); - Assertions.assertEquals("zcjznmwcpmgua", model.comment()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertsSuppressionRuleInner model = - new AlertsSuppressionRuleInner() - .withAlertType("vhmxtdrjfu") - .withExpirationDateUtc(OffsetDateTime.parse("2021-07-27T22:13:32Z")) - .withReason("bj") - .withState(RuleState.EXPIRED) - .withComment("zcjznmwcpmgua") - .withSuppressionAlertsScope(new SuppressionAlertsScope().withAllOf(Arrays.asList())); - model = BinaryData.fromObject(model).toObject(AlertsSuppressionRuleInner.class); - Assertions.assertEquals("vhmxtdrjfu", model.alertType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-27T22:13:32Z"), model.expirationDateUtc()); - Assertions.assertEquals("bj", model.reason()); - Assertions.assertEquals(RuleState.EXPIRED, model.state()); - Assertions.assertEquals("zcjznmwcpmgua", model.comment()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulePropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulePropertiesTests.java deleted file mode 100644 index 431476f96438..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulePropertiesTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleProperties; -import com.azure.resourcemanager.security.models.RuleState; -import com.azure.resourcemanager.security.models.ScopeElement; -import com.azure.resourcemanager.security.models.SuppressionAlertsScope; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AlertsSuppressionRulePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AlertsSuppressionRuleProperties model = - BinaryData - .fromString( - "{\"alertType\":\"lqubkwdlen\",\"lastModifiedUtc\":\"2021-02-18T06:07:47Z\",\"expirationDateUtc\":\"2021-03-05T15:56:58Z\",\"reason\":\"ujbazpjuohminyfl\",\"state\":\"Enabled\",\"comment\":\"wmd\",\"suppressionAlertsScope\":{\"allOf\":[{\"field\":\"klvxwmyg\",\"\":{}},{\"field\":\"gpqch\",\"\":{}}]}}") - .toObject(AlertsSuppressionRuleProperties.class); - Assertions.assertEquals("lqubkwdlen", model.alertType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-05T15:56:58Z"), model.expirationDateUtc()); - Assertions.assertEquals("ujbazpjuohminyfl", model.reason()); - Assertions.assertEquals(RuleState.ENABLED, model.state()); - Assertions.assertEquals("wmd", model.comment()); - Assertions.assertEquals("klvxwmyg", model.suppressionAlertsScope().allOf().get(0).field()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertsSuppressionRuleProperties model = - new AlertsSuppressionRuleProperties() - .withAlertType("lqubkwdlen") - .withExpirationDateUtc(OffsetDateTime.parse("2021-03-05T15:56:58Z")) - .withReason("ujbazpjuohminyfl") - .withState(RuleState.ENABLED) - .withComment("wmd") - .withSuppressionAlertsScope( - new SuppressionAlertsScope() - .withAllOf( - Arrays - .asList( - new ScopeElement().withField("klvxwmyg").withAdditionalProperties(mapOf()), - new ScopeElement().withField("gpqch").withAdditionalProperties(mapOf())))); - model = BinaryData.fromObject(model).toObject(AlertsSuppressionRuleProperties.class); - Assertions.assertEquals("lqubkwdlen", model.alertType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-05T15:56:58Z"), model.expirationDateUtc()); - Assertions.assertEquals("ujbazpjuohminyfl", model.reason()); - Assertions.assertEquals(RuleState.ENABLED, model.state()); - Assertions.assertEquals("wmd", model.comment()); - Assertions.assertEquals("klvxwmyg", model.suppressionAlertsScope().allOf().get(0).field()); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesDeleteWithResponseMockTests.java deleted file mode 100644 index b3a229222dad..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesDeleteWithResponseMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsSuppressionRulesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.alertsSuppressionRules().deleteWithResponse("bkl", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesGetWithResponseMockTests.java deleted file mode 100644 index 538b05331343..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesGetWithResponseMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AlertsSuppressionRule; -import com.azure.resourcemanager.security.models.RuleState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsSuppressionRulesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"alertType\":\"jqqwmtqsmoxsazu\",\"lastModifiedUtc\":\"2021-10-28T14:39:50Z\",\"expirationDateUtc\":\"2021-11-13T00:25:40Z\",\"reason\":\"ecywn\",\"state\":\"Disabled\",\"comment\":\"zzaczsinqbdn\",\"suppressionAlertsScope\":{\"allOf\":[]}},\"id\":\"bbozsyvr\",\"name\":\"kjmyitrchwudlx\",\"type\":\"eihtpmnoejh\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AlertsSuppressionRule response = - manager.alertsSuppressionRules().getWithResponse("bpnjodf", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("jqqwmtqsmoxsazu", response.alertType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-13T00:25:40Z"), response.expirationDateUtc()); - Assertions.assertEquals("ecywn", response.reason()); - Assertions.assertEquals(RuleState.DISABLED, response.state()); - Assertions.assertEquals("zzaczsinqbdn", response.comment()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListMockTests.java deleted file mode 100644 index d366dd8edd49..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AlertsSuppressionRule; -import com.azure.resourcemanager.security.models.RuleState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsSuppressionRulesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"alertType\":\"ntujmoilunwemhd\",\"lastModifiedUtc\":\"2021-12-02T08:52:50Z\",\"expirationDateUtc\":\"2021-10-18T05:10:35Z\",\"reason\":\"lkyozdsfzj\",\"state\":\"Enabled\",\"comment\":\"rhrhtsl\",\"suppressionAlertsScope\":{\"allOf\":[]}},\"id\":\"tv\",\"name\":\"j\",\"type\":\"xvgjbfi\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.alertsSuppressionRules().list("dsaidjanormovdxx", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ntujmoilunwemhd", response.iterator().next().alertType()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-10-18T05:10:35Z"), response.iterator().next().expirationDateUtc()); - Assertions.assertEquals("lkyozdsfzj", response.iterator().next().reason()); - Assertions.assertEquals(RuleState.ENABLED, response.iterator().next().state()); - Assertions.assertEquals("rhrhtsl", response.iterator().next().comment()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListTests.java deleted file mode 100644 index be6e6b5ea835..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import com.azure.resourcemanager.security.models.AlertsSuppressionRulesList; -import com.azure.resourcemanager.security.models.RuleState; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AlertsSuppressionRulesListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AlertsSuppressionRulesList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"alertType\":\"hvbbxuripltfnh\",\"lastModifiedUtc\":\"2021-05-19T04:32:03Z\",\"expirationDateUtc\":\"2021-08-21T19:13:45Z\",\"reason\":\"gx\",\"state\":\"Expired\",\"comment\":\"ckpyklyhplu\"},\"id\":\"pvruudlg\",\"name\":\"ibthostgktstvd\",\"type\":\"eclze\"},{\"properties\":{\"alertType\":\"bcvhzlhpl\",\"lastModifiedUtc\":\"2021-07-07T17:09:43Z\",\"expirationDateUtc\":\"2021-05-30T19:04:16Z\",\"reason\":\"lwwqfbumlkxtrqj\",\"state\":\"Disabled\",\"comment\":\"lmbtxhwgfwsrt\"},\"id\":\"coezbrhubskh\",\"name\":\"dyg\",\"type\":\"ookk\"},{\"properties\":{\"alertType\":\"qjbvleorfmlu\",\"lastModifiedUtc\":\"2021-07-18T04:19:58Z\",\"expirationDateUtc\":\"2021-10-19T17:51:06Z\",\"reason\":\"fa\",\"state\":\"Disabled\",\"comment\":\"nqqyba\"},\"id\":\"euayjkqabqgzsles\",\"name\":\"cbhernntiewdj\",\"type\":\"vbquwr\"}],\"nextLink\":\"hwagohbuffkmrqe\"}") - .toObject(AlertsSuppressionRulesList.class); - Assertions.assertEquals("hvbbxuripltfnh", model.value().get(0).alertType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-21T19:13:45Z"), model.value().get(0).expirationDateUtc()); - Assertions.assertEquals("gx", model.value().get(0).reason()); - Assertions.assertEquals(RuleState.EXPIRED, model.value().get(0).state()); - Assertions.assertEquals("ckpyklyhplu", model.value().get(0).comment()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertsSuppressionRulesList model = - new AlertsSuppressionRulesList() - .withValue( - Arrays - .asList( - new AlertsSuppressionRuleInner() - .withAlertType("hvbbxuripltfnh") - .withExpirationDateUtc(OffsetDateTime.parse("2021-08-21T19:13:45Z")) - .withReason("gx") - .withState(RuleState.EXPIRED) - .withComment("ckpyklyhplu"), - new AlertsSuppressionRuleInner() - .withAlertType("bcvhzlhpl") - .withExpirationDateUtc(OffsetDateTime.parse("2021-05-30T19:04:16Z")) - .withReason("lwwqfbumlkxtrqj") - .withState(RuleState.DISABLED) - .withComment("lmbtxhwgfwsrt"), - new AlertsSuppressionRuleInner() - .withAlertType("qjbvleorfmlu") - .withExpirationDateUtc(OffsetDateTime.parse("2021-10-19T17:51:06Z")) - .withReason("fa") - .withState(RuleState.DISABLED) - .withComment("nqqyba"))); - model = BinaryData.fromObject(model).toObject(AlertsSuppressionRulesList.class); - Assertions.assertEquals("hvbbxuripltfnh", model.value().get(0).alertType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-21T19:13:45Z"), model.value().get(0).expirationDateUtc()); - Assertions.assertEquals("gx", model.value().get(0).reason()); - Assertions.assertEquals(RuleState.EXPIRED, model.value().get(0).state()); - Assertions.assertEquals("ckpyklyhplu", model.value().get(0).comment()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateWithResponseMockTests.java deleted file mode 100644 index 02c680c4c7bd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateWithResponseMockTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import com.azure.resourcemanager.security.models.AlertsSuppressionRule; -import com.azure.resourcemanager.security.models.RuleState; -import com.azure.resourcemanager.security.models.SuppressionAlertsScope; -import java.nio.ByteBuffer; -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 org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsSuppressionRulesUpdateWithResponseMockTests { - @Test - public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"alertType\":\"kgd\",\"lastModifiedUtc\":\"2021-11-26T23:11:17Z\",\"expirationDateUtc\":\"2021-10-12T17:44:39Z\",\"reason\":\"k\",\"state\":\"Disabled\",\"comment\":\"hgsqtnqsktxq\",\"suppressionAlertsScope\":{\"allOf\":[]}},\"id\":\"jbqggweeiwdhdm\",\"name\":\"cgbfzuscstun\",\"type\":\"lhxd\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AlertsSuppressionRule response = - manager - .alertsSuppressionRules() - .updateWithResponse( - "lfmsibzoyrfg", - new AlertsSuppressionRuleInner() - .withAlertType("ydpmypgfqvmt") - .withExpirationDateUtc(OffsetDateTime.parse("2021-08-23T13:21:07Z")) - .withReason("kxp") - .withState(RuleState.ENABLED) - .withComment("ewp") - .withSuppressionAlertsScope(new SuppressionAlertsScope().withAllOf(Arrays.asList())), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("kgd", response.alertType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-12T17:44:39Z"), response.expirationDateUtc()); - Assertions.assertEquals("k", response.reason()); - Assertions.assertEquals(RuleState.DISABLED, response.state()); - Assertions.assertEquals("hgsqtnqsktxq", response.comment()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToActivateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToActivateWithResponseMockTests.java deleted file mode 100644 index 56338bb46e38..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToActivateWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsUpdateResourceGroupLevelStateToActivateWithResponseMockTests { - @Test - public void testUpdateResourceGroupLevelStateToActivateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .alerts() - .updateResourceGroupLevelStateToActivateWithResponse( - "x", "mdbgi", "ehfgsm", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToDismissWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToDismissWithResponseMockTests.java deleted file mode 100644 index 74577e554101..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToDismissWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsUpdateResourceGroupLevelStateToDismissWithResponseMockTests { - @Test - public void testUpdateResourceGroupLevelStateToDismissWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .alerts() - .updateResourceGroupLevelStateToDismissWithResponse( - "dfddtullygtav", "zcxdfweapyfmlxrl", "phraspifleim", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToInProgressWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToInProgressWithResponseMockTests.java deleted file mode 100644 index 37052ed1b3de..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToInProgressWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsUpdateResourceGroupLevelStateToInProgressWithResponseMockTests { - @Test - public void testUpdateResourceGroupLevelStateToInProgressWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .alerts() - .updateResourceGroupLevelStateToInProgressWithResponse( - "rjuqbpxtokl", "mtznpaxwfqtyyqi", "rcltungbsoljckm", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToResolveWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToResolveWithResponseMockTests.java deleted file mode 100644 index f8a4d2f86b45..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToResolveWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsUpdateResourceGroupLevelStateToResolveWithResponseMockTests { - @Test - public void testUpdateResourceGroupLevelStateToResolveWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .alerts() - .updateResourceGroupLevelStateToResolveWithResponse( - "d", "ffhsdpzouhk", "qrxqwqnjx", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToActivateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToActivateWithResponseMockTests.java deleted file mode 100644 index 0830b07b98ac..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToActivateWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsUpdateSubscriptionLevelStateToActivateWithResponseMockTests { - @Test - public void testUpdateSubscriptionLevelStateToActivateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .alerts() - .updateSubscriptionLevelStateToActivateWithResponse("cn", "rfijhggabq", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToDismissWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToDismissWithResponseMockTests.java deleted file mode 100644 index 972e6b0487e3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToDismissWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsUpdateSubscriptionLevelStateToDismissWithResponseMockTests { - @Test - public void testUpdateSubscriptionLevelStateToDismissWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .alerts() - .updateSubscriptionLevelStateToDismissWithResponse( - "tkwppthuzd", "rmimrljdpoqfxyem", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToInProgressWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToInProgressWithResponseMockTests.java deleted file mode 100644 index 826f8a062c3d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToInProgressWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsUpdateSubscriptionLevelStateToInProgressWithResponseMockTests { - @Test - public void testUpdateSubscriptionLevelStateToInProgressWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .alerts() - .updateSubscriptionLevelStateToInProgressWithResponse("gamk", "ilir", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToResolveWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToResolveWithResponseMockTests.java deleted file mode 100644 index ae393fa92296..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToResolveWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsUpdateSubscriptionLevelStateToResolveWithResponseMockTests { - @Test - public void testUpdateSubscriptionLevelStateToResolveWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .alerts() - .updateSubscriptionLevelStateToResolveWithResponse( - "kftbaewhte", "loamfmxtllfltym", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsGetWithResponseMockTests.java deleted file mode 100644 index 815260eb5f73..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AllowedConnectionsResource; -import com.azure.resourcemanager.security.models.ConnectionType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AllowedConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"calculatedDateTime\":\"2021-09-15T08:15:42Z\",\"connectableResources\":[]},\"location\":\"ktyhhmvfxl\",\"id\":\"pjajodmkrrwe\",\"name\":\"gqvqokqluj\",\"type\":\"gira\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AllowedConnectionsResource response = - manager - .allowedConnections() - .getWithResponse( - "rouigdmfivjqte", "dqqigdydkghpc", ConnectionType.EXTERNAL, com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListByHomeRegionMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListByHomeRegionMockTests.java deleted file mode 100644 index a6389f1b0cd4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListByHomeRegionMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AllowedConnectionsResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AllowedConnectionsListByHomeRegionMockTests { - @Test - public void testListByHomeRegion() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"calculatedDateTime\":\"2021-09-16T09:02:02Z\",\"connectableResources\":[]},\"location\":\"xsure\",\"id\":\"qrshzzbgullcxiq\",\"name\":\"zjk\",\"type\":\"xdupnamg\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.allowedConnections().listByHomeRegion("xdede", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListMockTests.java deleted file mode 100644 index cfa7d53f20db..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AllowedConnectionsResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AllowedConnectionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"calculatedDateTime\":\"2021-12-05T18:52:31Z\",\"connectableResources\":[]},\"location\":\"itwhrjsdmmazdnck\",\"id\":\"dbjp\",\"name\":\"lhzqpxzbawkikcdg\",\"type\":\"hbssdpjeyo\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.allowedConnections().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListTests.java deleted file mode 100644 index 35d06482012a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AllowedConnectionsList; - -public final class AllowedConnectionsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AllowedConnectionsList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"calculatedDateTime\":\"2021-08-31T13:06:45Z\",\"connectableResources\":[]},\"location\":\"lgehg\",\"id\":\"pipifh\",\"name\":\"f\",\"type\":\"oajvgcxtxjcs\"},{\"properties\":{\"calculatedDateTime\":\"2021-01-13T18:57:24Z\",\"connectableResources\":[]},\"location\":\"ltugsresmkssjhoi\",\"id\":\"txfkfweg\",\"name\":\"rhptilluc\",\"type\":\"iqtgdqoh\"},{\"properties\":{\"calculatedDateTime\":\"2021-03-25T09:14:26Z\",\"connectableResources\":[]},\"location\":\"riz\",\"id\":\"tpwb\",\"name\":\"a\",\"type\":\"llibphbqzmizak\"},{\"properties\":{\"calculatedDateTime\":\"2021-02-12T00:07:30Z\",\"connectableResources\":[]},\"location\":\"p\",\"id\":\"n\",\"name\":\"zhajoylhjlmuo\",\"type\":\"xprimrsop\"}],\"nextLink\":\"ecj\"}") - .toObject(AllowedConnectionsList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AllowedConnectionsList model = new AllowedConnectionsList(); - model = BinaryData.fromObject(model).toObject(AllowedConnectionsList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsResourceInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsResourceInnerTests.java deleted file mode 100644 index ea05528b8a62..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsResourceInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AllowedConnectionsResourceInner; - -public final class AllowedConnectionsResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AllowedConnectionsResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"calculatedDateTime\":\"2021-01-03T12:26:20Z\",\"connectableResources\":[{\"id\":\"vasylwxdzau\",\"inboundConnectedResources\":[],\"outboundConnectedResources\":[]},{\"id\":\"ohguuf\",\"inboundConnectedResources\":[],\"outboundConnectedResources\":[]},{\"id\":\"yjathwtzo\",\"inboundConnectedResources\":[],\"outboundConnectedResources\":[]},{\"id\":\"mwmdxmebwjscjpa\",\"inboundConnectedResources\":[],\"outboundConnectedResources\":[]}]},\"location\":\"eabfqxnm\",\"id\":\"mqt\",\"name\":\"bxyijddtvq\",\"type\":\"ttadijae\"}") - .toObject(AllowedConnectionsResourceInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AllowedConnectionsResourceInner model = new AllowedConnectionsResourceInner(); - model = BinaryData.fromObject(model).toObject(AllowedConnectionsResourceInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsResourcePropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsResourcePropertiesTests.java deleted file mode 100644 index a64ed5ef9566..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsResourcePropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AllowedConnectionsResourceProperties; - -public final class AllowedConnectionsResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AllowedConnectionsResourceProperties model = - BinaryData - .fromString( - "{\"calculatedDateTime\":\"2021-07-31T17:06:26Z\",\"connectableResources\":[{\"id\":\"eekpndz\",\"inboundConnectedResources\":[],\"outboundConnectedResources\":[]},{\"id\":\"qmeqwigpibudqwyx\",\"inboundConnectedResources\":[],\"outboundConnectedResources\":[]},{\"id\":\"mzznrtffyaqitmhh\",\"inboundConnectedResources\":[],\"outboundConnectedResources\":[]},{\"id\":\"hvseufuqyrx\",\"inboundConnectedResources\":[],\"outboundConnectedResources\":[]}]}") - .toObject(AllowedConnectionsResourceProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AllowedConnectionsResourceProperties model = new AllowedConnectionsResourceProperties(); - model = BinaryData.fromObject(model).toObject(AllowedConnectionsResourceProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowlistCustomAlertRuleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowlistCustomAlertRuleTests.java deleted file mode 100644 index e48a91350e3f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowlistCustomAlertRuleTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AllowlistCustomAlertRule; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AllowlistCustomAlertRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AllowlistCustomAlertRule model = - BinaryData - .fromString( - "{\"ruleType\":\"AllowlistCustomAlertRule\",\"allowlistValues\":[\"vkwlzuvccfwnf\",\"bacfionlebxetq\",\"tzxdpnqbqqwx\",\"jfeallnwsub\"],\"valueType\":\"IpCidr\",\"displayName\":\"ampmngnz\",\"description\":\"xaqwoochcbonqv\",\"isEnabled\":false}") - .toObject(AllowlistCustomAlertRule.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals("vkwlzuvccfwnf", model.allowlistValues().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AllowlistCustomAlertRule model = - new AllowlistCustomAlertRule() - .withIsEnabled(false) - .withAllowlistValues(Arrays.asList("vkwlzuvccfwnf", "bacfionlebxetq", "tzxdpnqbqqwx", "jfeallnwsub")); - model = BinaryData.fromObject(model).toObject(AllowlistCustomAlertRule.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals("vkwlzuvccfwnf", model.allowlistValues().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpC2DMessagesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpC2DMessagesNotInAllowedRangeTests.java deleted file mode 100644 index c139164b01cf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpC2DMessagesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AmqpC2DMessagesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class AmqpC2DMessagesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AmqpC2DMessagesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"AmqpC2DMessagesNotInAllowedRange\",\"timeWindowSize\":\"PT71H1M20S\",\"minThreshold\":1281785865,\"maxThreshold\":384532828,\"displayName\":\"adppyibn\",\"description\":\"ladywrxwhyd\",\"isEnabled\":false}") - .toObject(AmqpC2DMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1281785865, model.minThreshold()); - Assertions.assertEquals(384532828, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT71H1M20S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AmqpC2DMessagesNotInAllowedRange model = - new AmqpC2DMessagesNotInAllowedRange() - .withIsEnabled(false) - .withMinThreshold(1281785865) - .withMaxThreshold(384532828) - .withTimeWindowSize(Duration.parse("PT71H1M20S")); - model = BinaryData.fromObject(model).toObject(AmqpC2DMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1281785865, model.minThreshold()); - Assertions.assertEquals(384532828, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT71H1M20S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpC2DRejectedMessagesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpC2DRejectedMessagesNotInAllowedRangeTests.java deleted file mode 100644 index ea2027f0ced9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpC2DRejectedMessagesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AmqpC2DRejectedMessagesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class AmqpC2DRejectedMessagesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AmqpC2DRejectedMessagesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"AmqpC2DRejectedMessagesNotInAllowedRange\",\"timeWindowSize\":\"PT118H2M58S\",\"minThreshold\":1648107284,\"maxThreshold\":1284555207,\"displayName\":\"rfmvlihcvjdrqcrj\",\"description\":\"h\",\"isEnabled\":false}") - .toObject(AmqpC2DRejectedMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1648107284, model.minThreshold()); - Assertions.assertEquals(1284555207, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT118H2M58S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AmqpC2DRejectedMessagesNotInAllowedRange model = - new AmqpC2DRejectedMessagesNotInAllowedRange() - .withIsEnabled(false) - .withMinThreshold(1648107284) - .withMaxThreshold(1284555207) - .withTimeWindowSize(Duration.parse("PT118H2M58S")); - model = BinaryData.fromObject(model).toObject(AmqpC2DRejectedMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1648107284, model.minThreshold()); - Assertions.assertEquals(1284555207, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT118H2M58S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpD2CMessagesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpD2CMessagesNotInAllowedRangeTests.java deleted file mode 100644 index ed3dfea10c4a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpD2CMessagesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AmqpD2CMessagesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class AmqpD2CMessagesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AmqpD2CMessagesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"AmqpD2CMessagesNotInAllowedRange\",\"timeWindowSize\":\"PT179H38M47S\",\"minThreshold\":1851609223,\"maxThreshold\":1126673643,\"displayName\":\"gfxonjtpusllyw\",\"description\":\"tiotzb\",\"isEnabled\":false}") - .toObject(AmqpD2CMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1851609223, model.minThreshold()); - Assertions.assertEquals(1126673643, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT179H38M47S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AmqpD2CMessagesNotInAllowedRange model = - new AmqpD2CMessagesNotInAllowedRange() - .withIsEnabled(false) - .withMinThreshold(1851609223) - .withMaxThreshold(1126673643) - .withTimeWindowSize(Duration.parse("PT179H38M47S")); - model = BinaryData.fromObject(model).toObject(AmqpD2CMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1851609223, model.minThreshold()); - Assertions.assertEquals(1126673643, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT179H38M47S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionOffboardingsDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionOffboardingsDeleteWithResponseMockTests.java deleted file mode 100644 index 55ec6a654fb6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionOffboardingsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ApiCollectionOffboardingsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .apiCollectionOffboardings() - .deleteWithResponse("rnrnjrcufmbgacnr", "fdtncmspsanma", "eubkqiqmlf", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionOnboardingsCreateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionOnboardingsCreateWithResponseMockTests.java deleted file mode 100644 index 24971fcf7a0a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionOnboardingsCreateWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ApiCollectionResponse; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ApiCollectionOnboardingsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"xkwyk\",\"additionalData\":{\"ykhkg\":\"ndx\"}},\"id\":\"apvd\",\"name\":\"t\",\"type\":\"peerscd\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ApiCollectionResponse response = - manager - .apiCollectionOnboardings() - .createWithResponse("tkihonikzs", "zfffjilzfbpnt", "gkensckhbmcarmo", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xkwyk", response.displayName()); - Assertions.assertEquals("ndx", response.additionalData().get("ykhkg")); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionPropertiesTests.java deleted file mode 100644 index fac7b90d0316..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionPropertiesTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ApiCollectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiCollectionProperties model = - BinaryData - .fromString( - "{\"displayName\":\"y\",\"additionalData\":{\"fkak\":\"mwineof\",\"knyuxgvttxpn\":\"oldtvevboclzhz\",\"ids\":\"upzaamrdixtre\",\"l\":\"yskbruff\"}}") - .toObject(ApiCollectionProperties.class); - Assertions.assertEquals("y", model.displayName()); - Assertions.assertEquals("mwineof", model.additionalData().get("fkak")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiCollectionProperties model = - new ApiCollectionProperties() - .withDisplayName("y") - .withAdditionalData( - mapOf( - "fkak", "mwineof", "knyuxgvttxpn", "oldtvevboclzhz", "ids", "upzaamrdixtre", "l", "yskbruff")); - model = BinaryData.fromObject(model).toObject(ApiCollectionProperties.class); - Assertions.assertEquals("y", model.displayName()); - Assertions.assertEquals("mwineof", model.additionalData().get("fkak")); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionResponseInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionResponseInnerTests.java deleted file mode 100644 index 4e134a165c2d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionResponseInnerTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionResponseInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ApiCollectionResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiCollectionResponseInner model = - BinaryData - .fromString( - "{\"properties\":{\"displayName\":\"zealbmqkyo\",\"additionalData\":{\"mbtsuahxsg\":\"vf\",\"wsdrnpxqwodif\":\"jcmmzrrscub\"}},\"id\":\"jxcjrmmuabwib\",\"name\":\"jogjonmc\",\"type\":\"e\"}") - .toObject(ApiCollectionResponseInner.class); - Assertions.assertEquals("zealbmqkyo", model.displayName()); - Assertions.assertEquals("vf", model.additionalData().get("mbtsuahxsg")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiCollectionResponseInner model = - new ApiCollectionResponseInner() - .withDisplayName("zealbmqkyo") - .withAdditionalData(mapOf("mbtsuahxsg", "vf", "wsdrnpxqwodif", "jcmmzrrscub")); - model = BinaryData.fromObject(model).toObject(ApiCollectionResponseInner.class); - Assertions.assertEquals("zealbmqkyo", model.displayName()); - Assertions.assertEquals("vf", model.additionalData().get("mbtsuahxsg")); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionResponseListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionResponseListTests.java deleted file mode 100644 index 781622c42653..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionResponseListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ApiCollectionResponseList; - -public final class ApiCollectionResponseListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiCollectionResponseList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"yjq\",\"additionalData\":{}},\"id\":\"kfnozoeoqbvj\",\"name\":\"vefgwbmqjchntas\",\"type\":\"ay\"}],\"nextLink\":\"b\"}") - .toObject(ApiCollectionResponseList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiCollectionResponseList model = new ApiCollectionResponseList(); - model = BinaryData.fromObject(model).toObject(ApiCollectionResponseList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionsGetWithResponseMockTests.java deleted file mode 100644 index 6bc6da68571f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ApiCollectionResponse; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ApiCollectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"oewyhxessmvrkd\",\"additionalData\":{\"mdsesbrujbjpp\":\"eqfbd\"}},\"id\":\"ktlpdibfmthieat\",\"name\":\"ejrnmi\",\"type\":\"zqpl\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ApiCollectionResponse response = - manager - .apiCollections() - .getWithResponse("ortbnukkfax", "svbxxyjisskob", "ocl", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("oewyhxessmvrkd", response.displayName()); - Assertions.assertEquals("eqfbd", response.additionalData().get("mdsesbrujbjpp")); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionsListMockTests.java deleted file mode 100644 index da73e2c4bedb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionsListMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ApiCollectionResponse; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ApiCollectionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"zwhpjlwyxedz\",\"additionalData\":{\"ckewvm\":\"rfo\",\"utxfptofhgnuyw\":\"ifopxfjjtpdyz\"}},\"id\":\"zygvadgaaqwvkgjp\",\"name\":\"tpmpvd\",\"type\":\"ogehluf\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.apiCollections().list("gyedzfzqi", "uqhtdereuno", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("zwhpjlwyxedz", response.iterator().next().displayName()); - Assertions.assertEquals("rfo", response.iterator().next().additionalData().get("ckewvm")); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationInnerTests.java deleted file mode 100644 index 3fd094f1050a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationInnerTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ApplicationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplicationInner model = - BinaryData - .fromString( - "{\"properties\":{\"displayName\":\"cfehuwaoagu\",\"description\":\"cqlliz\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[\"datacsjvhrwef\"]},\"id\":\"kwqejpmvsseh\",\"name\":\"epwamcxtcz\",\"type\":\"upeuknijduyye\"}") - .toObject(ApplicationInner.class); - Assertions.assertEquals("cfehuwaoagu", model.displayName()); - Assertions.assertEquals("cqlliz", model.description()); - Assertions.assertEquals(ApplicationSourceResourceType.ASSESSMENTS, model.sourceResourceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationInner model = - new ApplicationInner() - .withDisplayName("cfehuwaoagu") - .withDescription("cqlliz") - .withSourceResourceType(ApplicationSourceResourceType.ASSESSMENTS) - .withConditionSets(Arrays.asList("datacsjvhrwef")); - model = BinaryData.fromObject(model).toObject(ApplicationInner.class); - Assertions.assertEquals("cfehuwaoagu", model.displayName()); - Assertions.assertEquals("cqlliz", model.description()); - Assertions.assertEquals(ApplicationSourceResourceType.ASSESSMENTS, model.sourceResourceType()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index a741d734b636..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.nio.ByteBuffer; -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 org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ApplicationOperationsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"mgqbgcxhnq\",\"description\":\"zxlermkmer\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[\"datakirhn\",\"dataupkcbkfukdljqnvt\"]},\"id\":\"dydshk\",\"name\":\"afyalo\",\"type\":\"ww\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Application response = - manager - .applicationOperations() - .define("ntojovfnybydhuih") - .withDisplayName("wud") - .withDescription("aorhjkehwvumo") - .withSourceResourceType(ApplicationSourceResourceType.ASSESSMENTS) - .withConditionSets(Arrays.asList("datarcamqp", "datal", "databrugejcvjkjycz")) - .create(); - - Assertions.assertEquals("mgqbgcxhnq", response.displayName()); - Assertions.assertEquals("zxlermkmer", response.description()); - Assertions.assertEquals(ApplicationSourceResourceType.ASSESSMENTS, response.sourceResourceType()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsDeleteWithResponseMockTests.java deleted file mode 100644 index b25e90758dc6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ApplicationOperationsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.applicationOperations().deleteWithResponse("i", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsGetWithResponseMockTests.java deleted file mode 100644 index 4e24d91a35e0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ApplicationOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"nmpaklwzlweepr\",\"description\":\"jzltkaszfjs\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[\"databduxapgrcq\",\"databmvrdjomlnwsbv\",\"datadls\",\"datalxkqesdfeds\"]},\"id\":\"gzancoinmphy\",\"name\":\"cqidkltvdhqnufbx\",\"type\":\"e\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Application response = - manager.applicationOperations().getWithResponse("wrqkza", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("nmpaklwzlweepr", response.displayName()); - Assertions.assertEquals("jzltkaszfjs", response.description()); - Assertions.assertEquals(ApplicationSourceResourceType.ASSESSMENTS, response.sourceResourceType()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationPropertiesTests.java deleted file mode 100644 index c0f1478e494c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationPropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ApplicationProperties; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ApplicationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplicationProperties model = - BinaryData - .fromString( - "{\"displayName\":\"ydjfb\",\"description\":\"yv\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[\"datalrtywikdmhlakuf\",\"datagbhgau\",\"datacdixmx\"]}") - .toObject(ApplicationProperties.class); - Assertions.assertEquals("ydjfb", model.displayName()); - Assertions.assertEquals("yv", model.description()); - Assertions.assertEquals(ApplicationSourceResourceType.ASSESSMENTS, model.sourceResourceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationProperties model = - new ApplicationProperties() - .withDisplayName("ydjfb") - .withDescription("yv") - .withSourceResourceType(ApplicationSourceResourceType.ASSESSMENTS) - .withConditionSets(Arrays.asList("datalrtywikdmhlakuf", "datagbhgau", "datacdixmx")); - model = BinaryData.fromObject(model).toObject(ApplicationProperties.class); - Assertions.assertEquals("ydjfb", model.displayName()); - Assertions.assertEquals("yv", model.description()); - Assertions.assertEquals(ApplicationSourceResourceType.ASSESSMENTS, model.sourceResourceType()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationsListMockTests.java deleted file mode 100644 index de04b9c78cad..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationsListMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ApplicationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"zgbjbhrpgi\",\"description\":\"ttcucrcm\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[\"dataxp\",\"datajiwifhbksldttoh\"]},\"id\":\"clnaihtg\",\"name\":\"iqikvllr\",\"type\":\"tpmglxkoikmtr\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.applications().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("zgbjbhrpgi", response.iterator().next().displayName()); - Assertions.assertEquals("ttcucrcm", response.iterator().next().description()); - Assertions - .assertEquals(ApplicationSourceResourceType.ASSESSMENTS, response.iterator().next().sourceResourceType()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationsListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationsListTests.java deleted file mode 100644 index a666e51ec3ce..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationsListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ApplicationsList; - -public final class ApplicationsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplicationsList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"fbwqrooht\",\"description\":\"vmaonurjt\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[]},\"id\":\"ghihpvecms\",\"name\":\"clbl\",\"type\":\"jxl\"},{\"properties\":{\"displayName\":\"juscvsfx\",\"description\":\"ctmgxuupbezqccy\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[]},\"id\":\"tce\",\"name\":\"kdqkkyihzt\",\"type\":\"eq\"}],\"nextLink\":\"qzgwldoychil\"}") - .toObject(ApplicationsList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationsList model = new ApplicationsList(); - model = BinaryData.fromObject(model).toObject(ApplicationsList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AscLocationInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AscLocationInnerTests.java deleted file mode 100644 index ca0b19baf373..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AscLocationInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AscLocationInner; - -public final class AscLocationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AscLocationInner model = - BinaryData - .fromString( - "{\"properties\":\"datasdqrhzoymibmrq\",\"id\":\"ibahwflus\",\"name\":\"dtmhrkwofyyvoqa\",\"type\":\"piexpbtgiw\"}") - .toObject(AscLocationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AscLocationInner model = new AscLocationInner().withProperties("datasdqrhzoymibmrq"); - model = BinaryData.fromObject(model).toObject(AscLocationInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AscLocationListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AscLocationListTests.java deleted file mode 100644 index acef2fad6e2a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AscLocationListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AscLocationList; - -public final class AscLocationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AscLocationList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":\"datasmond\",\"id\":\"mquxvypo\",\"name\":\"gkopkwhojvpajqgx\",\"type\":\"smocmbq\"},{\"properties\":\"datavmkcx\",\"id\":\"zapvhelx\",\"name\":\"rgly\",\"type\":\"tddckcb\"}],\"nextLink\":\"ejrjxgciqibrho\"}") - .toObject(AscLocationList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AscLocationList model = new AscLocationList(); - model = BinaryData.fromObject(model).toObject(AscLocationList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentLinksTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentLinksTests.java deleted file mode 100644 index c415b483f63c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentLinksTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AssessmentLinks; - -public final class AssessmentLinksTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessmentLinks model = - BinaryData.fromString("{\"azurePortalUri\":\"ycavodggxdbees\"}").toObject(AssessmentLinks.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessmentLinks model = new AssessmentLinks(); - model = BinaryData.fromObject(model).toObject(AssessmentLinks.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentsDeleteByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index b7eb6ccb24a2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AssessmentsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .assessments() - .deleteByResourceGroupWithResponse("dtmvecdhdyswcrp", "veajczxvlgsrg", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentsMetadatasDeleteInSubscriptionWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentsMetadatasDeleteInSubscriptionWithResponseMockTests.java deleted file mode 100644 index a3c54e4ccd1a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentsMetadatasDeleteInSubscriptionWithResponseMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AssessmentsMetadatasDeleteInSubscriptionWithResponseMockTests { - @Test - public void testDeleteInSubscriptionWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.assessmentsMetadatas().deleteInSubscriptionWithResponse("buwvorba", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AtaExternalSecuritySolutionTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AtaExternalSecuritySolutionTests.java deleted file mode 100644 index ad2a34e9f49a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AtaExternalSecuritySolutionTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AtaExternalSecuritySolution; -import com.azure.resourcemanager.security.models.AtaSolutionProperties; -import com.azure.resourcemanager.security.models.ConnectedWorkspace; -import org.junit.jupiter.api.Assertions; - -public final class AtaExternalSecuritySolutionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AtaExternalSecuritySolution model = - BinaryData - .fromString( - "{\"kind\":\"ATA\",\"properties\":{\"lastEventReceived\":\"gv\",\"deviceVendor\":\"e\",\"deviceType\":\"uoqujlyeg\",\"workspace\":{\"id\":\"nigflqqbtnyj\"},\"\":{\"vabm\":\"dataxdb\",\"wuhvaj\":\"datamsxbaevwjcnkott\",\"wjiqullqxb\":\"dataailfemjjzak\"}},\"location\":\"vr\",\"id\":\"cm\",\"name\":\"erndbrnyeofltfnn\",\"type\":\"rkadjfynnfmuiiir\"}") - .toObject(AtaExternalSecuritySolution.class); - Assertions.assertEquals("e", model.properties().deviceVendor()); - Assertions.assertEquals("uoqujlyeg", model.properties().deviceType()); - Assertions.assertEquals("nigflqqbtnyj", model.properties().workspace().id()); - Assertions.assertEquals("gv", model.properties().lastEventReceived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AtaExternalSecuritySolution model = - new AtaExternalSecuritySolution() - .withProperties( - new AtaSolutionProperties() - .withDeviceVendor("e") - .withDeviceType("uoqujlyeg") - .withWorkspace(new ConnectedWorkspace().withId("nigflqqbtnyj")) - .withLastEventReceived("gv")); - model = BinaryData.fromObject(model).toObject(AtaExternalSecuritySolution.class); - Assertions.assertEquals("e", model.properties().deviceVendor()); - Assertions.assertEquals("uoqujlyeg", model.properties().deviceType()); - Assertions.assertEquals("nigflqqbtnyj", model.properties().workspace().id()); - Assertions.assertEquals("gv", model.properties().lastEventReceived()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AtaSolutionPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AtaSolutionPropertiesTests.java deleted file mode 100644 index a820c548dcf9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AtaSolutionPropertiesTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AtaSolutionProperties; -import com.azure.resourcemanager.security.models.ConnectedWorkspace; -import org.junit.jupiter.api.Assertions; - -public final class AtaSolutionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AtaSolutionProperties model = - BinaryData - .fromString( - "{\"lastEventReceived\":\"fohyk\",\"deviceVendor\":\"xbbcbrw\",\"deviceType\":\"u\",\"workspace\":{\"id\":\"jizbeew\"},\"\":{\"juyrsrziuctixg\":\"datamrvz\",\"uifr\":\"datad\"}}") - .toObject(AtaSolutionProperties.class); - Assertions.assertEquals("xbbcbrw", model.deviceVendor()); - Assertions.assertEquals("u", model.deviceType()); - Assertions.assertEquals("jizbeew", model.workspace().id()); - Assertions.assertEquals("fohyk", model.lastEventReceived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AtaSolutionProperties model = - new AtaSolutionProperties() - .withDeviceVendor("xbbcbrw") - .withDeviceType("u") - .withWorkspace(new ConnectedWorkspace().withId("jizbeew")) - .withLastEventReceived("fohyk"); - model = BinaryData.fromObject(model).toObject(AtaSolutionProperties.class); - Assertions.assertEquals("xbbcbrw", model.deviceVendor()); - Assertions.assertEquals("u", model.deviceType()); - Assertions.assertEquals("jizbeew", model.workspace().id()); - Assertions.assertEquals("fohyk", model.lastEventReceived()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AuthenticationDetailsPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AuthenticationDetailsPropertiesTests.java deleted file mode 100644 index 590dc411410c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AuthenticationDetailsPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AuthenticationDetailsProperties; - -public final class AuthenticationDetailsPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AuthenticationDetailsProperties model = - BinaryData - .fromString( - "{\"authenticationType\":\"AuthenticationDetailsProperties\",\"authenticationProvisioningState\":\"Valid\",\"grantedPermissions\":[\"AWS::AWSSecurityHubReadOnlyAccess\",\"AWS::AmazonSSMAutomationRole\",\"AWS::SecurityAudit\"]}") - .toObject(AuthenticationDetailsProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AuthenticationDetailsProperties model = new AuthenticationDetailsProperties(); - model = BinaryData.fromObject(model).toObject(AuthenticationDetailsProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingInnerTests.java deleted file mode 100644 index dd38cf540c13..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingInnerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; -import com.azure.resourcemanager.security.models.AutoProvision; -import org.junit.jupiter.api.Assertions; - -public final class AutoProvisioningSettingInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoProvisioningSettingInner model = - BinaryData - .fromString( - "{\"properties\":{\"autoProvision\":\"On\"},\"id\":\"ikh\",\"name\":\"yf\",\"type\":\"hdgqggeb\"}") - .toObject(AutoProvisioningSettingInner.class); - Assertions.assertEquals(AutoProvision.ON, model.autoProvision()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoProvisioningSettingInner model = new AutoProvisioningSettingInner().withAutoProvision(AutoProvision.ON); - model = BinaryData.fromObject(model).toObject(AutoProvisioningSettingInner.class); - Assertions.assertEquals(AutoProvision.ON, model.autoProvision()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingListTests.java deleted file mode 100644 index 00d317e22087..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingListTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.AutoProvisioningSettingList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AutoProvisioningSettingListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoProvisioningSettingList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"autoProvision\":\"On\"},\"id\":\"irels\",\"name\":\"eae\",\"type\":\"wabfatkl\"},{\"properties\":{\"autoProvision\":\"Off\"},\"id\":\"bjhwuaan\",\"name\":\"zjosp\",\"type\":\"youlp\"},{\"properties\":{\"autoProvision\":\"On\"},\"id\":\"xagl\",\"name\":\"vimjwos\",\"type\":\"tx\"}],\"nextLink\":\"cskfcktqumiekk\"}") - .toObject(AutoProvisioningSettingList.class); - Assertions.assertEquals(AutoProvision.ON, model.value().get(0).autoProvision()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoProvisioningSettingList model = - new AutoProvisioningSettingList() - .withValue( - Arrays - .asList( - new AutoProvisioningSettingInner().withAutoProvision(AutoProvision.ON), - new AutoProvisioningSettingInner().withAutoProvision(AutoProvision.OFF), - new AutoProvisioningSettingInner().withAutoProvision(AutoProvision.ON))); - model = BinaryData.fromObject(model).toObject(AutoProvisioningSettingList.class); - Assertions.assertEquals(AutoProvision.ON, model.value().get(0).autoProvision()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingPropertiesTests.java deleted file mode 100644 index 4c07192125e5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingPropertiesTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingProperties; -import com.azure.resourcemanager.security.models.AutoProvision; -import org.junit.jupiter.api.Assertions; - -public final class AutoProvisioningSettingPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoProvisioningSettingProperties model = - BinaryData.fromString("{\"autoProvision\":\"Off\"}").toObject(AutoProvisioningSettingProperties.class); - Assertions.assertEquals(AutoProvision.OFF, model.autoProvision()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoProvisioningSettingProperties model = - new AutoProvisioningSettingProperties().withAutoProvision(AutoProvision.OFF); - model = BinaryData.fromObject(model).toObject(AutoProvisioningSettingProperties.class); - Assertions.assertEquals(AutoProvision.OFF, model.autoProvision()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsCreateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsCreateWithResponseMockTests.java deleted file mode 100644 index b02a8a5568b2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsCreateWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.AutoProvisioningSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AutoProvisioningSettingsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"autoProvision\":\"On\"},\"id\":\"qady\",\"name\":\"zjahwriuomz\",\"type\":\"zfkiceevsaaxwsp\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AutoProvisioningSetting response = - manager.autoProvisioningSettings().define("ybsjrc").withAutoProvision(AutoProvision.OFF).create(); - - Assertions.assertEquals(AutoProvision.ON, response.autoProvision()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsGetWithResponseMockTests.java deleted file mode 100644 index 418e8ce8f96f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.AutoProvisioningSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AutoProvisioningSettingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"autoProvision\":\"Off\"},\"id\":\"ckhmocgjshgouarh\",\"name\":\"vi\",\"type\":\"qqgglj\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AutoProvisioningSetting response = - manager - .autoProvisioningSettings() - .getWithResponse("ynbpvzlqywauy", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(AutoProvision.OFF, response.autoProvision()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsListMockTests.java deleted file mode 100644 index a9bf5542c139..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsListMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.AutoProvisioningSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AutoProvisioningSettingsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"autoProvision\":\"On\"},\"id\":\"dneyttlr\",\"name\":\"xivcbkutpumlt\",\"type\":\"jflu\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.autoProvisioningSettings().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AutoProvision.ON, response.iterator().next().autoProvision()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionEventHubTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionEventHubTests.java deleted file mode 100644 index d9cd34116ccf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionEventHubTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AutomationActionEventHub; -import org.junit.jupiter.api.Assertions; - -public final class AutomationActionEventHubTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationActionEventHub model = - BinaryData - .fromString( - "{\"actionType\":\"EventHub\",\"eventHubResourceId\":\"gvpyigdaqqilzdc\",\"sasPolicyName\":\"wjoe\",\"connectionString\":\"ngucaifpaurww\"}") - .toObject(AutomationActionEventHub.class); - Assertions.assertEquals("gvpyigdaqqilzdc", model.eventHubResourceId()); - Assertions.assertEquals("ngucaifpaurww", model.connectionString()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationActionEventHub model = - new AutomationActionEventHub() - .withEventHubResourceId("gvpyigdaqqilzdc") - .withConnectionString("ngucaifpaurww"); - model = BinaryData.fromObject(model).toObject(AutomationActionEventHub.class); - Assertions.assertEquals("gvpyigdaqqilzdc", model.eventHubResourceId()); - Assertions.assertEquals("ngucaifpaurww", model.connectionString()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionLogicAppTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionLogicAppTests.java deleted file mode 100644 index bbf764644c44..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionLogicAppTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AutomationActionLogicApp; -import org.junit.jupiter.api.Assertions; - -public final class AutomationActionLogicAppTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationActionLogicApp model = - BinaryData - .fromString("{\"actionType\":\"LogicApp\",\"logicAppResourceId\":\"bqc\",\"uri\":\"jfgxxsaetg\"}") - .toObject(AutomationActionLogicApp.class); - Assertions.assertEquals("bqc", model.logicAppResourceId()); - Assertions.assertEquals("jfgxxsaetg", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationActionLogicApp model = - new AutomationActionLogicApp().withLogicAppResourceId("bqc").withUri("jfgxxsaetg"); - model = BinaryData.fromObject(model).toObject(AutomationActionLogicApp.class); - Assertions.assertEquals("bqc", model.logicAppResourceId()); - Assertions.assertEquals("jfgxxsaetg", model.uri()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionTests.java deleted file mode 100644 index 8b8800223b67..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AutomationAction; - -public final class AutomationActionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationAction model = - BinaryData.fromString("{\"actionType\":\"AutomationAction\"}").toObject(AutomationAction.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationAction model = new AutomationAction(); - model = BinaryData.fromObject(model).toObject(AutomationAction.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionWorkspaceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionWorkspaceTests.java deleted file mode 100644 index 4f0043678db0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionWorkspaceTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AutomationActionWorkspace; -import org.junit.jupiter.api.Assertions; - -public final class AutomationActionWorkspaceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationActionWorkspace model = - BinaryData - .fromString("{\"actionType\":\"Workspace\",\"workspaceResourceId\":\"l\"}") - .toObject(AutomationActionWorkspace.class); - Assertions.assertEquals("l", model.workspaceResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationActionWorkspace model = new AutomationActionWorkspace().withWorkspaceResourceId("l"); - model = BinaryData.fromObject(model).toObject(AutomationActionWorkspace.class); - Assertions.assertEquals("l", model.workspaceResourceId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationInnerTests.java deleted file mode 100644 index a3f329e64d64..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationInnerTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import com.azure.resourcemanager.security.models.AutomationAction; -import com.azure.resourcemanager.security.models.AutomationScope; -import com.azure.resourcemanager.security.models.AutomationSource; -import com.azure.resourcemanager.security.models.EventSource; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AutomationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationInner model = - BinaryData - .fromString( - "{\"properties\":{\"description\":\"opqgikyzirtxdyux\",\"isEnabled\":true,\"scopes\":[{\"description\":\"sewgioilqukr\",\"scopePath\":\"xtqmieoxor\"},{\"description\":\"ufhyaomtbgh\",\"scopePath\":\"vgrvkffo\"}],\"sources\":[{\"eventSource\":\"Alerts\",\"ruleSets\":[]}],\"actions\":[{\"actionType\":\"AutomationAction\"},{\"actionType\":\"AutomationAction\"},{\"actionType\":\"AutomationAction\"},{\"actionType\":\"AutomationAction\"}]},\"location\":\"bgj\",\"tags\":{\"ovwxnbkfezzxsc\":\"umvfclu\",\"omvzzbtd\":\"hwzdgirujbz\",\"yujviylwdshfssn\":\"qvpn\"},\"id\":\"bgye\",\"name\":\"rymsgaojfmw\",\"type\":\"cotmr\"}") - .toObject(AutomationInner.class); - Assertions.assertEquals("bgj", model.location()); - Assertions.assertEquals("umvfclu", model.tags().get("ovwxnbkfezzxsc")); - Assertions.assertEquals("opqgikyzirtxdyux", model.description()); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals("sewgioilqukr", model.scopes().get(0).description()); - Assertions.assertEquals("xtqmieoxor", model.scopes().get(0).scopePath()); - Assertions.assertEquals(EventSource.ALERTS, model.sources().get(0).eventSource()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationInner model = - new AutomationInner() - .withLocation("bgj") - .withTags(mapOf("ovwxnbkfezzxsc", "umvfclu", "omvzzbtd", "hwzdgirujbz", "yujviylwdshfssn", "qvpn")) - .withDescription("opqgikyzirtxdyux") - .withIsEnabled(true) - .withScopes( - Arrays - .asList( - new AutomationScope().withDescription("sewgioilqukr").withScopePath("xtqmieoxor"), - new AutomationScope().withDescription("ufhyaomtbgh").withScopePath("vgrvkffo"))) - .withSources( - Arrays - .asList( - new AutomationSource().withEventSource(EventSource.ALERTS).withRuleSets(Arrays.asList()))) - .withActions( - Arrays - .asList( - new AutomationAction(), - new AutomationAction(), - new AutomationAction(), - new AutomationAction())); - model = BinaryData.fromObject(model).toObject(AutomationInner.class); - Assertions.assertEquals("bgj", model.location()); - Assertions.assertEquals("umvfclu", model.tags().get("ovwxnbkfezzxsc")); - Assertions.assertEquals("opqgikyzirtxdyux", model.description()); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals("sewgioilqukr", model.scopes().get(0).description()); - Assertions.assertEquals("xtqmieoxor", model.scopes().get(0).scopePath()); - Assertions.assertEquals(EventSource.ALERTS, model.sources().get(0).eventSource()); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationListTests.java deleted file mode 100644 index 0103de6de228..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationListTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import com.azure.resourcemanager.security.models.AutomationList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AutomationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"description\":\"jpqqmted\",\"isEnabled\":false,\"scopes\":[],\"sources\":[],\"actions\":[]},\"location\":\"hyeozphvwau\",\"tags\":{\"gupkvipmdscwxq\":\"c\"},\"id\":\"pevzhfst\",\"name\":\"txhojujb\",\"type\":\"pelmcuvhixbjxyf\"},{\"properties\":{\"description\":\"lrcoolsttpki\",\"isEnabled\":false,\"scopes\":[],\"sources\":[],\"actions\":[]},\"location\":\"jrywvtylbfpnc\",\"tags\":{\"cbihwqk\":\"oiwiithtywub\",\"umwctondz\":\"fdntwjchrdgoih\"},\"id\":\"luudfdlwggytsb\",\"name\":\"tov\",\"type\":\"tgseinqfiufxqkn\"},{\"properties\":{\"description\":\"gnepttwqmsni\",\"isEnabled\":false,\"scopes\":[],\"sources\":[],\"actions\":[]},\"location\":\"nrojlpijnkr\",\"tags\":{\"nasx\":\"ddhcratizzr\"},\"id\":\"ft\",\"name\":\"zq\",\"type\":\"zh\"},{\"properties\":{\"description\":\"esgogc\",\"isEnabled\":true,\"scopes\":[],\"sources\":[],\"actions\":[]},\"location\":\"krlgnyhm\",\"tags\":{\"thrrgh\":\"xkk\",\"gf\":\"jbdhqxvc\"},\"id\":\"pdso\",\"name\":\"bshrnsvbuswd\",\"type\":\"z\"}],\"nextLink\":\"bycnunvjsrtkf\"}") - .toObject(AutomationList.class); - Assertions.assertEquals("hyeozphvwau", model.value().get(0).location()); - Assertions.assertEquals("c", model.value().get(0).tags().get("gupkvipmdscwxq")); - Assertions.assertEquals("jpqqmted", model.value().get(0).description()); - Assertions.assertEquals(false, model.value().get(0).isEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationList model = - new AutomationList() - .withValue( - Arrays - .asList( - new AutomationInner() - .withLocation("hyeozphvwau") - .withTags(mapOf("gupkvipmdscwxq", "c")) - .withDescription("jpqqmted") - .withIsEnabled(false) - .withScopes(Arrays.asList()) - .withSources(Arrays.asList()) - .withActions(Arrays.asList()), - new AutomationInner() - .withLocation("jrywvtylbfpnc") - .withTags(mapOf("cbihwqk", "oiwiithtywub", "umwctondz", "fdntwjchrdgoih")) - .withDescription("lrcoolsttpki") - .withIsEnabled(false) - .withScopes(Arrays.asList()) - .withSources(Arrays.asList()) - .withActions(Arrays.asList()), - new AutomationInner() - .withLocation("nrojlpijnkr") - .withTags(mapOf("nasx", "ddhcratizzr")) - .withDescription("gnepttwqmsni") - .withIsEnabled(false) - .withScopes(Arrays.asList()) - .withSources(Arrays.asList()) - .withActions(Arrays.asList()), - new AutomationInner() - .withLocation("krlgnyhm") - .withTags(mapOf("thrrgh", "xkk", "gf", "jbdhqxvc")) - .withDescription("esgogc") - .withIsEnabled(true) - .withScopes(Arrays.asList()) - .withSources(Arrays.asList()) - .withActions(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(AutomationList.class); - Assertions.assertEquals("hyeozphvwau", model.value().get(0).location()); - Assertions.assertEquals("c", model.value().get(0).tags().get("gupkvipmdscwxq")); - Assertions.assertEquals("jpqqmted", model.value().get(0).description()); - Assertions.assertEquals(false, model.value().get(0).isEnabled()); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationPropertiesTests.java deleted file mode 100644 index 8e374d423f4c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationPropertiesTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AutomationProperties; -import com.azure.resourcemanager.security.models.AutomationAction; -import com.azure.resourcemanager.security.models.AutomationScope; -import com.azure.resourcemanager.security.models.AutomationSource; -import com.azure.resourcemanager.security.models.EventSource; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AutomationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationProperties model = - BinaryData - .fromString( - "{\"description\":\"irctymoxoftpipiw\",\"isEnabled\":false,\"scopes\":[{\"description\":\"a\",\"scopePath\":\"qjlihhyuspska\"},{\"description\":\"vlmfwdgzxulucv\",\"scopePath\":\"mrsreuzvxurisjnh\"},{\"description\":\"txifqj\",\"scopePath\":\"xmrhu\"},{\"description\":\"wp\",\"scopePath\":\"sutrgjup\"}],\"sources\":[{\"eventSource\":\"SubAssessmentsSnapshot\",\"ruleSets\":[]},{\"eventSource\":\"RegulatoryComplianceAssessment\",\"ruleSets\":[]},{\"eventSource\":\"Alerts\",\"ruleSets\":[]},{\"eventSource\":\"RegulatoryComplianceAssessmentSnapshot\",\"ruleSets\":[]}],\"actions\":[{\"actionType\":\"AutomationAction\"},{\"actionType\":\"AutomationAction\"},{\"actionType\":\"AutomationAction\"},{\"actionType\":\"AutomationAction\"}]}") - .toObject(AutomationProperties.class); - Assertions.assertEquals("irctymoxoftpipiw", model.description()); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals("a", model.scopes().get(0).description()); - Assertions.assertEquals("qjlihhyuspska", model.scopes().get(0).scopePath()); - Assertions.assertEquals(EventSource.SUB_ASSESSMENTS_SNAPSHOT, model.sources().get(0).eventSource()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationProperties model = - new AutomationProperties() - .withDescription("irctymoxoftpipiw") - .withIsEnabled(false) - .withScopes( - Arrays - .asList( - new AutomationScope().withDescription("a").withScopePath("qjlihhyuspska"), - new AutomationScope().withDescription("vlmfwdgzxulucv").withScopePath("mrsreuzvxurisjnh"), - new AutomationScope().withDescription("txifqj").withScopePath("xmrhu"), - new AutomationScope().withDescription("wp").withScopePath("sutrgjup"))) - .withSources( - Arrays - .asList( - new AutomationSource() - .withEventSource(EventSource.SUB_ASSESSMENTS_SNAPSHOT) - .withRuleSets(Arrays.asList()), - new AutomationSource() - .withEventSource(EventSource.REGULATORY_COMPLIANCE_ASSESSMENT) - .withRuleSets(Arrays.asList()), - new AutomationSource().withEventSource(EventSource.ALERTS).withRuleSets(Arrays.asList()), - new AutomationSource() - .withEventSource(EventSource.REGULATORY_COMPLIANCE_ASSESSMENT_SNAPSHOT) - .withRuleSets(Arrays.asList()))) - .withActions( - Arrays - .asList( - new AutomationAction(), - new AutomationAction(), - new AutomationAction(), - new AutomationAction())); - model = BinaryData.fromObject(model).toObject(AutomationProperties.class); - Assertions.assertEquals("irctymoxoftpipiw", model.description()); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals("a", model.scopes().get(0).description()); - Assertions.assertEquals("qjlihhyuspska", model.scopes().get(0).scopePath()); - Assertions.assertEquals(EventSource.SUB_ASSESSMENTS_SNAPSHOT, model.sources().get(0).eventSource()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationRuleSetTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationRuleSetTests.java deleted file mode 100644 index c41517f68b2d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationRuleSetTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AutomationRuleSet; -import com.azure.resourcemanager.security.models.AutomationTriggeringRule; -import com.azure.resourcemanager.security.models.Operator; -import com.azure.resourcemanager.security.models.PropertyType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AutomationRuleSetTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationRuleSet model = - BinaryData - .fromString( - "{\"rules\":[{\"propertyJPath\":\"hvygdyftumr\",\"propertyType\":\"Boolean\",\"expectedValue\":\"wjslbiwkojgcyzt\",\"operator\":\"LesserThan\"}]}") - .toObject(AutomationRuleSet.class); - Assertions.assertEquals("hvygdyftumr", model.rules().get(0).propertyJPath()); - Assertions.assertEquals(PropertyType.BOOLEAN, model.rules().get(0).propertyType()); - Assertions.assertEquals("wjslbiwkojgcyzt", model.rules().get(0).expectedValue()); - Assertions.assertEquals(Operator.LESSER_THAN, model.rules().get(0).operator()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationRuleSet model = - new AutomationRuleSet() - .withRules( - Arrays - .asList( - new AutomationTriggeringRule() - .withPropertyJPath("hvygdyftumr") - .withPropertyType(PropertyType.BOOLEAN) - .withExpectedValue("wjslbiwkojgcyzt") - .withOperator(Operator.LESSER_THAN))); - model = BinaryData.fromObject(model).toObject(AutomationRuleSet.class); - Assertions.assertEquals("hvygdyftumr", model.rules().get(0).propertyJPath()); - Assertions.assertEquals(PropertyType.BOOLEAN, model.rules().get(0).propertyType()); - Assertions.assertEquals("wjslbiwkojgcyzt", model.rules().get(0).expectedValue()); - Assertions.assertEquals(Operator.LESSER_THAN, model.rules().get(0).operator()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationScopeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationScopeTests.java deleted file mode 100644 index 18bc6495f4c0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationScopeTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AutomationScope; -import org.junit.jupiter.api.Assertions; - -public final class AutomationScopeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationScope model = - BinaryData - .fromString("{\"description\":\"tcypsxjvfoim\",\"scopePath\":\"slirciz\"}") - .toObject(AutomationScope.class); - Assertions.assertEquals("tcypsxjvfoim", model.description()); - Assertions.assertEquals("slirciz", model.scopePath()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationScope model = new AutomationScope().withDescription("tcypsxjvfoim").withScopePath("slirciz"); - model = BinaryData.fromObject(model).toObject(AutomationScope.class); - Assertions.assertEquals("tcypsxjvfoim", model.description()); - Assertions.assertEquals("slirciz", model.scopePath()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationSourceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationSourceTests.java deleted file mode 100644 index 7379f70c7554..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationSourceTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AutomationRuleSet; -import com.azure.resourcemanager.security.models.AutomationSource; -import com.azure.resourcemanager.security.models.EventSource; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AutomationSourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationSource model = - BinaryData - .fromString("{\"eventSource\":\"SubAssessmentsSnapshot\",\"ruleSets\":[{\"rules\":[]},{\"rules\":[]}]}") - .toObject(AutomationSource.class); - Assertions.assertEquals(EventSource.SUB_ASSESSMENTS_SNAPSHOT, model.eventSource()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationSource model = - new AutomationSource() - .withEventSource(EventSource.SUB_ASSESSMENTS_SNAPSHOT) - .withRuleSets( - Arrays - .asList( - new AutomationRuleSet().withRules(Arrays.asList()), - new AutomationRuleSet().withRules(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(AutomationSource.class); - Assertions.assertEquals(EventSource.SUB_ASSESSMENTS_SNAPSHOT, model.eventSource()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationTriggeringRuleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationTriggeringRuleTests.java deleted file mode 100644 index e0d355d4af39..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationTriggeringRuleTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AutomationTriggeringRule; -import com.azure.resourcemanager.security.models.Operator; -import com.azure.resourcemanager.security.models.PropertyType; -import org.junit.jupiter.api.Assertions; - -public final class AutomationTriggeringRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationTriggeringRule model = - BinaryData - .fromString( - "{\"propertyJPath\":\"nbaeqphchqn\",\"propertyType\":\"Integer\",\"expectedValue\":\"x\",\"operator\":\"LesserThan\"}") - .toObject(AutomationTriggeringRule.class); - Assertions.assertEquals("nbaeqphchqn", model.propertyJPath()); - Assertions.assertEquals(PropertyType.INTEGER, model.propertyType()); - Assertions.assertEquals("x", model.expectedValue()); - Assertions.assertEquals(Operator.LESSER_THAN, model.operator()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationTriggeringRule model = - new AutomationTriggeringRule() - .withPropertyJPath("nbaeqphchqn") - .withPropertyType(PropertyType.INTEGER) - .withExpectedValue("x") - .withOperator(Operator.LESSER_THAN); - model = BinaryData.fromObject(model).toObject(AutomationTriggeringRule.class); - Assertions.assertEquals("nbaeqphchqn", model.propertyJPath()); - Assertions.assertEquals(PropertyType.INTEGER, model.propertyType()); - Assertions.assertEquals("x", model.expectedValue()); - Assertions.assertEquals(Operator.LESSER_THAN, model.operator()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationValidationStatusInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationValidationStatusInnerTests.java deleted file mode 100644 index aad3a0708105..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationValidationStatusInnerTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner; -import org.junit.jupiter.api.Assertions; - -public final class AutomationValidationStatusInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationValidationStatusInner model = - BinaryData - .fromString("{\"isValid\":false,\"message\":\"tczheydbsdshmkx\"}") - .toObject(AutomationValidationStatusInner.class); - Assertions.assertEquals(false, model.isValid()); - Assertions.assertEquals("tczheydbsdshmkx", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationValidationStatusInner model = - new AutomationValidationStatusInner().withIsValid(false).withMessage("tczheydbsdshmkx"); - model = BinaryData.fromObject(model).toObject(AutomationValidationStatusInner.class); - Assertions.assertEquals(false, model.isValid()); - Assertions.assertEquals("tczheydbsdshmkx", model.message()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 3b9776d9aa5e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Automation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AutomationsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"description\":\"tnp\",\"isEnabled\":true,\"scopes\":[],\"sources\":[],\"actions\":[]},\"location\":\"rqxw\",\"tags\":{\"tfdoadtx\":\"tdrh\",\"ctkbbxuha\":\"pgehpadkmdzgsszx\"},\"id\":\"lsi\",\"name\":\"ncclabvoyngsuxxc\",\"type\":\"bmyqjog\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Automation response = - manager - .automations() - .define("e") - .withRegion("xsm") - .withExistingResourceGroup("hquhczygxvhajp") - .withTags(mapOf("ud", "pwirfljfewxqouo", "nqi", "mckaprh", "ihkkyowl", "jgencdgmoque")) - .withDescription("nwh") - .withIsEnabled(true) - .withScopes(Arrays.asList()) - .withSources(Arrays.asList()) - .withActions(Arrays.asList()) - .create(); - - Assertions.assertEquals("rqxw", response.location()); - Assertions.assertEquals("tdrh", response.tags().get("tfdoadtx")); - Assertions.assertEquals("tnp", response.description()); - Assertions.assertEquals(true, response.isEnabled()); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsDeleteByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 53a75cee395c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AutomationsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .automations() - .deleteByResourceGroupWithResponse("yjmqrf", "iocuselqkr", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 31ebf320dbe4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Automation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AutomationsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"description\":\"rhhmojusu\",\"isEnabled\":false,\"scopes\":[],\"sources\":[],\"actions\":[]},\"location\":\"xoia\",\"tags\":{\"dxku\":\"fxwcco\",\"shavljqkx\":\"mkczynuhhoqe\",\"kgzukwdrnzkjth\":\"rqolnthbb\"},\"id\":\"ceyjnc\",\"name\":\"mlfuyfjbp\",\"type\":\"iddhlrufzc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Automation response = - manager - .automations() - .getByResourceGroupWithResponse("jjsbcmlzaahzbhur", "olk", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xoia", response.location()); - Assertions.assertEquals("fxwcco", response.tags().get("dxku")); - Assertions.assertEquals("rhhmojusu", response.description()); - Assertions.assertEquals(false, response.isEnabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsListByResourceGroupMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsListByResourceGroupMockTests.java deleted file mode 100644 index f9cc80cfca11..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsListByResourceGroupMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Automation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AutomationsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"zboimyfpqdo\",\"isEnabled\":true,\"scopes\":[],\"sources\":[],\"actions\":[]},\"location\":\"fvpctfji\",\"tags\":{\"vuldbkkejjk\":\"ffgkuhznw\"},\"id\":\"igaw\",\"name\":\"azmxjqi\",\"type\":\"h\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.automations().listByResourceGroup("trnzpducdaaktu", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fvpctfji", response.iterator().next().location()); - Assertions.assertEquals("ffgkuhznw", response.iterator().next().tags().get("vuldbkkejjk")); - Assertions.assertEquals("zboimyfpqdo", response.iterator().next().description()); - Assertions.assertEquals(true, response.iterator().next().isEnabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsListMockTests.java deleted file mode 100644 index ac79e0ba8762..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsListMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Automation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AutomationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"ssaekewnaze\",\"isEnabled\":true,\"scopes\":[],\"sources\":[],\"actions\":[]},\"location\":\"izyddcvxodk\",\"tags\":{\"desqlvg\":\"sxxb\",\"bygoo\":\"cpwgoljtzxnmxsd\"},\"id\":\"xqapjxvazyjfucsa\",\"name\":\"djnosdkvibf\",\"type\":\"sgm\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.automations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("izyddcvxodk", response.iterator().next().location()); - Assertions.assertEquals("sxxb", response.iterator().next().tags().get("desqlvg")); - Assertions.assertEquals("ssaekewnaze", response.iterator().next().description()); - Assertions.assertEquals(true, response.iterator().next().isEnabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsValidateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsValidateWithResponseMockTests.java deleted file mode 100644 index 671d430c2377..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsValidateWithResponseMockTests.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import com.azure.resourcemanager.security.models.AutomationValidationStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AutomationsValidateWithResponseMockTests { - @Test - public void testValidateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"isValid\":false,\"message\":\"yrnskb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AutomationValidationStatus response = - manager - .automations() - .validateWithResponse( - "azrhxudd", - "mdtff", - new AutomationInner() - .withLocation("kwtjawhva") - .withTags( - mapOf("vmyolcaym", "fqqdl", "z", "chtvsnvlaqd", "othymgobl", "zawatuwqkokbc", "gwi", "msn")) - .withDescription("mrkkhmwd") - .withIsEnabled(true) - .withScopes(Arrays.asList()) - .withSources(Arrays.asList()) - .withActions(Arrays.asList()), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(false, response.isValid()); - Assertions.assertEquals("yrnskb", response.message()); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwAssumeRoleAuthenticationDetailsPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwAssumeRoleAuthenticationDetailsPropertiesTests.java deleted file mode 100644 index f2620fc58bfc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwAssumeRoleAuthenticationDetailsPropertiesTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AwAssumeRoleAuthenticationDetailsProperties; -import org.junit.jupiter.api.Assertions; - -public final class AwAssumeRoleAuthenticationDetailsPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AwAssumeRoleAuthenticationDetailsProperties model = - BinaryData - .fromString( - "{\"authenticationType\":\"awsAssumeRole\",\"accountId\":\"mnhjevdyzn\",\"awsAssumeRoleArn\":\"ajsvk\",\"awsExternalId\":\"kmq\",\"authenticationProvisioningState\":\"IncorrectPolicy\",\"grantedPermissions\":[\"AWS::SecurityAudit\",\"AWS::AmazonSSMAutomationRole\",\"GCP::Security" - + " Center Admin Viewer\",\"AWS::SecurityAudit\"]}") - .toObject(AwAssumeRoleAuthenticationDetailsProperties.class); - Assertions.assertEquals("ajsvk", model.awsAssumeRoleArn()); - Assertions.assertEquals("kmq", model.awsExternalId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AwAssumeRoleAuthenticationDetailsProperties model = - new AwAssumeRoleAuthenticationDetailsProperties().withAwsAssumeRoleArn("ajsvk").withAwsExternalId("kmq"); - model = BinaryData.fromObject(model).toObject(AwAssumeRoleAuthenticationDetailsProperties.class); - Assertions.assertEquals("ajsvk", model.awsAssumeRoleArn()); - Assertions.assertEquals("kmq", model.awsExternalId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsEnvironmentDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsEnvironmentDataTests.java deleted file mode 100644 index 4d072ac75096..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsEnvironmentDataTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AwsEnvironmentData; -import com.azure.resourcemanager.security.models.AwsOrganizationalData; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AwsEnvironmentDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AwsEnvironmentData model = - BinaryData - .fromString( - "{\"environmentType\":\"AwsAccount\",\"organizationalData\":{\"organizationMembershipType\":\"AwsOrganizationalData\"},\"regions\":[\"krrbhmpful\"],\"accountName\":\"efgybpmfbfununmp\"}") - .toObject(AwsEnvironmentData.class); - Assertions.assertEquals("krrbhmpful", model.regions().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AwsEnvironmentData model = - new AwsEnvironmentData() - .withOrganizationalData(new AwsOrganizationalData()) - .withRegions(Arrays.asList("krrbhmpful")); - model = BinaryData.fromObject(model).toObject(AwsEnvironmentData.class); - Assertions.assertEquals("krrbhmpful", model.regions().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataMasterTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataMasterTests.java deleted file mode 100644 index 1fc708fdd542..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataMasterTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AwsOrganizationalDataMaster; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AwsOrganizationalDataMasterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AwsOrganizationalDataMaster model = - BinaryData - .fromString( - "{\"organizationMembershipType\":\"Organization\",\"stacksetName\":\"rvfyifkdsch\",\"excludedAccountIds\":[\"fict\",\"kjjwgcwn\",\"hbkgfyrt\",\"gm\"]}") - .toObject(AwsOrganizationalDataMaster.class); - Assertions.assertEquals("rvfyifkdsch", model.stacksetName()); - Assertions.assertEquals("fict", model.excludedAccountIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AwsOrganizationalDataMaster model = - new AwsOrganizationalDataMaster() - .withStacksetName("rvfyifkdsch") - .withExcludedAccountIds(Arrays.asList("fict", "kjjwgcwn", "hbkgfyrt", "gm")); - model = BinaryData.fromObject(model).toObject(AwsOrganizationalDataMaster.class); - Assertions.assertEquals("rvfyifkdsch", model.stacksetName()); - Assertions.assertEquals("fict", model.excludedAccountIds().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataMemberTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataMemberTests.java deleted file mode 100644 index 25187ba99e91..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataMemberTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AwsOrganizationalDataMember; -import org.junit.jupiter.api.Assertions; - -public final class AwsOrganizationalDataMemberTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AwsOrganizationalDataMember model = - BinaryData - .fromString("{\"organizationMembershipType\":\"Member\",\"parentHierarchyId\":\"j\"}") - .toObject(AwsOrganizationalDataMember.class); - Assertions.assertEquals("j", model.parentHierarchyId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AwsOrganizationalDataMember model = new AwsOrganizationalDataMember().withParentHierarchyId("j"); - model = BinaryData.fromObject(model).toObject(AwsOrganizationalDataMember.class); - Assertions.assertEquals("j", model.parentHierarchyId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataTests.java deleted file mode 100644 index 2832b96e508c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AwsOrganizationalData; - -public final class AwsOrganizationalDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AwsOrganizationalData model = - BinaryData - .fromString("{\"organizationMembershipType\":\"AwsOrganizationalData\"}") - .toObject(AwsOrganizationalData.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AwsOrganizationalData model = new AwsOrganizationalData(); - model = BinaryData.fromObject(model).toObject(AwsOrganizationalData.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsScopeEnvironmentDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsScopeEnvironmentDataTests.java deleted file mode 100644 index b2306356746b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsScopeEnvironmentDataTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AzureDevOpsScopeEnvironmentData; - -public final class AzureDevOpsScopeEnvironmentDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureDevOpsScopeEnvironmentData model = - BinaryData - .fromString("{\"environmentType\":\"AzureDevOpsScope\"}") - .toObject(AzureDevOpsScopeEnvironmentData.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureDevOpsScopeEnvironmentData model = new AzureDevOpsScopeEnvironmentData(); - model = BinaryData.fromObject(model).toObject(AzureDevOpsScopeEnvironmentData.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceDetailsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceDetailsTests.java deleted file mode 100644 index 705d3b3ed5aa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceDetailsTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AzureResourceDetails; - -public final class AzureResourceDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureResourceDetails model = - BinaryData.fromString("{\"source\":\"Azure\",\"id\":\"aohoqkpjtnq\"}").toObject(AzureResourceDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureResourceDetails model = new AzureResourceDetails(); - model = BinaryData.fromObject(model).toObject(AzureResourceDetails.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceIdentifierTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceIdentifierTests.java deleted file mode 100644 index 1b0ad3dbb7d0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceIdentifierTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AzureResourceIdentifier; - -public final class AzureResourceIdentifierTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureResourceIdentifier model = - BinaryData - .fromString("{\"type\":\"AzureResource\",\"azureResourceId\":\"hvuqbo\"}") - .toObject(AzureResourceIdentifier.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureResourceIdentifier model = new AzureResourceIdentifier(); - model = BinaryData.fromObject(model).toObject(AzureResourceIdentifier.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceLinkTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceLinkTests.java deleted file mode 100644 index 1363a09cc59c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceLinkTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AzureResourceLink; - -public final class AzureResourceLinkTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureResourceLink model = - BinaryData.fromString("{\"id\":\"cbuewmrswnjlxuz\"}").toObject(AzureResourceLink.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureResourceLink model = new AzureResourceLink(); - model = BinaryData.fromObject(model).toObject(AzureResourceLink.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureTrackedResourceLocationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureTrackedResourceLocationTests.java deleted file mode 100644 index 485e00c4dd5a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureTrackedResourceLocationTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AzureTrackedResourceLocation; -import org.junit.jupiter.api.Assertions; - -public final class AzureTrackedResourceLocationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureTrackedResourceLocation model = - BinaryData.fromString("{\"location\":\"ltducea\"}").toObject(AzureTrackedResourceLocation.class); - Assertions.assertEquals("ltducea", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureTrackedResourceLocation model = new AzureTrackedResourceLocation().withLocation("ltducea"); - model = BinaryData.fromObject(model).toObject(AzureTrackedResourceLocation.class); - Assertions.assertEquals("ltducea", model.location()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BaselineAdjustedResultTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BaselineAdjustedResultTests.java deleted file mode 100644 index 507760ad319e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BaselineAdjustedResultTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Baseline; -import com.azure.resourcemanager.security.models.BaselineAdjustedResult; -import com.azure.resourcemanager.security.models.RuleStatus; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class BaselineAdjustedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BaselineAdjustedResult model = - BinaryData - .fromString( - "{\"baseline\":{\"expectedResults\":[[\"mfzsbf\"],[\"rzx\",\"dew\",\"rsxkr\",\"lbjazejww\"]],\"updatedTime\":\"2021-03-06T21:39:52Z\"},\"status\":\"Finding\",\"resultsNotInBaseline\":[[\"hbrnnhjx\",\"qwjhqkbiwetpozyc\",\"qiqyhgfsetzlexbs\"],[\"e\",\"ynojpziuw\",\"bzkkd\"]],\"resultsOnlyInBaseline\":[[\"sycljsel\",\"kpbafvafhl\"],[\"lc\"],[\"evxrhyz\",\"fwrsofpltdbmair\",\"hvhfnracw\"]]}") - .toObject(BaselineAdjustedResult.class); - Assertions.assertEquals("mfzsbf", model.baseline().expectedResults().get(0).get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-06T21:39:52Z"), model.baseline().updatedTime()); - Assertions.assertEquals(RuleStatus.FINDING, model.status()); - Assertions.assertEquals("hbrnnhjx", model.resultsNotInBaseline().get(0).get(0)); - Assertions.assertEquals("sycljsel", model.resultsOnlyInBaseline().get(0).get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BaselineAdjustedResult model = - new BaselineAdjustedResult() - .withBaseline( - new Baseline() - .withExpectedResults( - Arrays.asList(Arrays.asList("mfzsbf"), Arrays.asList("rzx", "dew", "rsxkr", "lbjazejww"))) - .withUpdatedTime(OffsetDateTime.parse("2021-03-06T21:39:52Z"))) - .withStatus(RuleStatus.FINDING) - .withResultsNotInBaseline( - Arrays - .asList( - Arrays.asList("hbrnnhjx", "qwjhqkbiwetpozyc", "qiqyhgfsetzlexbs"), - Arrays.asList("e", "ynojpziuw", "bzkkd"))) - .withResultsOnlyInBaseline( - Arrays - .asList( - Arrays.asList("sycljsel", "kpbafvafhl"), - Arrays.asList("lc"), - Arrays.asList("evxrhyz", "fwrsofpltdbmair", "hvhfnracw"))); - model = BinaryData.fromObject(model).toObject(BaselineAdjustedResult.class); - Assertions.assertEquals("mfzsbf", model.baseline().expectedResults().get(0).get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-06T21:39:52Z"), model.baseline().updatedTime()); - Assertions.assertEquals(RuleStatus.FINDING, model.status()); - Assertions.assertEquals("hbrnnhjx", model.resultsNotInBaseline().get(0).get(0)); - Assertions.assertEquals("sycljsel", model.resultsOnlyInBaseline().get(0).get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BaselineTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BaselineTests.java deleted file mode 100644 index 44a63e1b7e6e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BaselineTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Baseline; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class BaselineTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Baseline model = - BinaryData - .fromString( - "{\"expectedResults\":[[\"g\",\"uuj\"],[\"uhd\",\"wsigrbjbxsj\",\"bvitvqkjya\"],[\"umtggmuwdchozfn\"],[\"exlvxnoakiz\"]],\"updatedTime\":\"2021-02-16T18:23:50Z\"}") - .toObject(Baseline.class); - Assertions.assertEquals("g", model.expectedResults().get(0).get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-16T18:23:50Z"), model.updatedTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Baseline model = - new Baseline() - .withExpectedResults( - Arrays - .asList( - Arrays.asList("g", "uuj"), - Arrays.asList("uhd", "wsigrbjbxsj", "bvitvqkjya"), - Arrays.asList("umtggmuwdchozfn"), - Arrays.asList("exlvxnoakiz"))) - .withUpdatedTime(OffsetDateTime.parse("2021-02-16T18:23:50Z")); - model = BinaryData.fromObject(model).toObject(Baseline.class); - Assertions.assertEquals("g", model.expectedResults().get(0).get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-16T18:23:50Z"), model.updatedTime()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BenchmarkReferenceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BenchmarkReferenceTests.java deleted file mode 100644 index 369304ea61ed..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BenchmarkReferenceTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.BenchmarkReference; -import org.junit.jupiter.api.Assertions; - -public final class BenchmarkReferenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BenchmarkReference model = - BinaryData - .fromString("{\"benchmark\":\"vovjufycsjmlbe\",\"reference\":\"ej\"}") - .toObject(BenchmarkReference.class); - Assertions.assertEquals("vovjufycsjmlbe", model.benchmark()); - Assertions.assertEquals("ej", model.reference()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BenchmarkReference model = new BenchmarkReference().withBenchmark("vovjufycsjmlbe").withReference("ej"); - model = BinaryData.fromObject(model).toObject(BenchmarkReference.class); - Assertions.assertEquals("vovjufycsjmlbe", model.benchmark()); - Assertions.assertEquals("ej", model.reference()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CefExternalSecuritySolutionTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CefExternalSecuritySolutionTests.java deleted file mode 100644 index c79cf40c25e9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CefExternalSecuritySolutionTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CefExternalSecuritySolution; -import com.azure.resourcemanager.security.models.CefSolutionProperties; -import com.azure.resourcemanager.security.models.ConnectedWorkspace; -import org.junit.jupiter.api.Assertions; - -public final class CefExternalSecuritySolutionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CefExternalSecuritySolution model = - BinaryData - .fromString( - "{\"kind\":\"CEF\",\"properties\":{\"hostname\":\"qacdmkxwxdcvjwcy\",\"agent\":\"akeciqchx\",\"lastEventReceived\":\"uicdsiwdfmmpzhzz\",\"deviceVendor\":\"ywrgyngydgr\",\"deviceType\":\"n\",\"workspace\":{\"id\":\"iqao\"},\"\":{\"lvlmfej\":\"datarkclamg\"}},\"location\":\"qey\",\"id\":\"gltygxhqfgq\",\"name\":\"ayejsxtlgflwfgz\",\"type\":\"iucijjcea\"}") - .toObject(CefExternalSecuritySolution.class); - Assertions.assertEquals("ywrgyngydgr", model.properties().deviceVendor()); - Assertions.assertEquals("n", model.properties().deviceType()); - Assertions.assertEquals("iqao", model.properties().workspace().id()); - Assertions.assertEquals("qacdmkxwxdcvjwcy", model.properties().hostname()); - Assertions.assertEquals("akeciqchx", model.properties().agent()); - Assertions.assertEquals("uicdsiwdfmmpzhzz", model.properties().lastEventReceived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CefExternalSecuritySolution model = - new CefExternalSecuritySolution() - .withProperties( - new CefSolutionProperties() - .withDeviceVendor("ywrgyngydgr") - .withDeviceType("n") - .withWorkspace(new ConnectedWorkspace().withId("iqao")) - .withHostname("qacdmkxwxdcvjwcy") - .withAgent("akeciqchx") - .withLastEventReceived("uicdsiwdfmmpzhzz")); - model = BinaryData.fromObject(model).toObject(CefExternalSecuritySolution.class); - Assertions.assertEquals("ywrgyngydgr", model.properties().deviceVendor()); - Assertions.assertEquals("n", model.properties().deviceType()); - Assertions.assertEquals("iqao", model.properties().workspace().id()); - Assertions.assertEquals("qacdmkxwxdcvjwcy", model.properties().hostname()); - Assertions.assertEquals("akeciqchx", model.properties().agent()); - Assertions.assertEquals("uicdsiwdfmmpzhzz", model.properties().lastEventReceived()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CefSolutionPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CefSolutionPropertiesTests.java deleted file mode 100644 index 5689d605f546..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CefSolutionPropertiesTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CefSolutionProperties; -import com.azure.resourcemanager.security.models.ConnectedWorkspace; -import org.junit.jupiter.api.Assertions; - -public final class CefSolutionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CefSolutionProperties model = - BinaryData - .fromString( - "{\"hostname\":\"ijjj\",\"agent\":\"va\",\"lastEventReceived\":\"a\",\"deviceVendor\":\"knxkvccxetyvkunm\",\"deviceType\":\"nohikkgq\",\"workspace\":{\"id\":\"wpin\"},\"\":{\"hmedeilbjywfcfxz\":\"datavabbx\",\"vjslczwcii\":\"datarzzihvwypus\",\"vxadqacfrgnawbab\":\"datajsllfryvd\",\"yq\":\"datafbktyjmfczlf\"}}") - .toObject(CefSolutionProperties.class); - Assertions.assertEquals("knxkvccxetyvkunm", model.deviceVendor()); - Assertions.assertEquals("nohikkgq", model.deviceType()); - Assertions.assertEquals("wpin", model.workspace().id()); - Assertions.assertEquals("ijjj", model.hostname()); - Assertions.assertEquals("va", model.agent()); - Assertions.assertEquals("a", model.lastEventReceived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CefSolutionProperties model = - new CefSolutionProperties() - .withDeviceVendor("knxkvccxetyvkunm") - .withDeviceType("nohikkgq") - .withWorkspace(new ConnectedWorkspace().withId("wpin")) - .withHostname("ijjj") - .withAgent("va") - .withLastEventReceived("a"); - model = BinaryData.fromObject(model).toObject(CefSolutionProperties.class); - Assertions.assertEquals("knxkvccxetyvkunm", model.deviceVendor()); - Assertions.assertEquals("nohikkgq", model.deviceType()); - Assertions.assertEquals("wpin", model.workspace().id()); - Assertions.assertEquals("ijjj", model.hostname()); - Assertions.assertEquals("va", model.agent()); - Assertions.assertEquals("a", model.lastEventReceived()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CloudOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CloudOfferingTests.java deleted file mode 100644 index b0a117bca27e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CloudOfferingTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CloudOffering; - -public final class CloudOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CloudOffering model = - BinaryData - .fromString("{\"offeringType\":\"CloudOffering\",\"description\":\"ivjreuyk\"}") - .toObject(CloudOffering.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CloudOffering model = new CloudOffering(); - model = BinaryData.fromObject(model).toObject(CloudOffering.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceInnerTests.java deleted file mode 100644 index 0543972aa28a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; - -public final class ComplianceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComplianceInner model = - BinaryData - .fromString( - "{\"properties\":{\"assessmentTimestampUtcDate\":\"2021-08-15T01:34:53Z\",\"resourceCount\":207967373,\"assessmentResult\":[{\"segmentType\":\"dpfrxtrthzvaytdw\",\"percentage\":34.16180582030333},{\"segmentType\":\"ubpaxhe\",\"percentage\":1.5196984611925868}]},\"id\":\"ivpdtiir\",\"name\":\"tdqoaxoruzfgsq\",\"type\":\"yfxrx\"}") - .toObject(ComplianceInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComplianceInner model = new ComplianceInner(); - model = BinaryData.fromObject(model).toObject(ComplianceInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceListTests.java deleted file mode 100644 index 0209720593c4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceListTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; -import com.azure.resourcemanager.security.models.ComplianceList; -import java.util.Arrays; - -public final class ComplianceListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComplianceList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"assessmentTimestampUtcDate\":\"2021-08-25T09:33:34Z\",\"resourceCount\":624778524,\"assessmentResult\":[]},\"id\":\"bqfatpxllrxcyjmo\",\"name\":\"dsuvarmywdmjsjqb\",\"type\":\"hhyxxrw\"},{\"properties\":{\"assessmentTimestampUtcDate\":\"2021-02-04T08:50:40Z\",\"resourceCount\":803302222,\"assessmentResult\":[]},\"id\":\"p\",\"name\":\"xkgymareqnajxqu\",\"type\":\"jhkycub\"},{\"properties\":{\"assessmentTimestampUtcDate\":\"2021-03-22T14:35:21Z\",\"resourceCount\":2056337569,\"assessmentResult\":[]},\"id\":\"fwqmzqalkrmn\",\"name\":\"i\",\"type\":\"pxacqqudfn\"},{\"properties\":{\"assessmentTimestampUtcDate\":\"2021-06-13T18:20:41Z\",\"resourceCount\":1365725065,\"assessmentResult\":[]},\"id\":\"bjyvay\",\"name\":\"fimrzrtuzqogse\",\"type\":\"nevfdnw\"}],\"nextLink\":\"mewzsyyc\"}") - .toObject(ComplianceList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComplianceList model = - new ComplianceList() - .withValue( - Arrays - .asList( - new ComplianceInner(), - new ComplianceInner(), - new ComplianceInner(), - new ComplianceInner())); - model = BinaryData.fromObject(model).toObject(ComplianceList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancePropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancePropertiesTests.java deleted file mode 100644 index 421d502a6a5c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancePropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ComplianceProperties; - -public final class CompliancePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComplianceProperties model = - BinaryData - .fromString( - "{\"assessmentTimestampUtcDate\":\"2021-11-22T21:44:45Z\",\"resourceCount\":2043686923,\"assessmentResult\":[{\"segmentType\":\"xje\",\"percentage\":84.10933716066732},{\"segmentType\":\"wxuqlcvydypatdoo\",\"percentage\":48.53263087805991},{\"segmentType\":\"iodkooebwnujhem\",\"percentage\":70.84255746706634}]}") - .toObject(ComplianceProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComplianceProperties model = new ComplianceProperties(); - model = BinaryData.fromObject(model).toObject(ComplianceProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultInnerTests.java deleted file mode 100644 index 16b9ae57355e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ComplianceResultInner; - -public final class ComplianceResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComplianceResultInner model = - BinaryData - .fromString( - "{\"properties\":{\"resourceStatus\":\"NotApplicable\"},\"id\":\"jdous\",\"name\":\"cqvkocrcjdkwtn\",\"type\":\"xbnjbiksq\"}") - .toObject(ComplianceResultInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComplianceResultInner model = new ComplianceResultInner(); - model = BinaryData.fromObject(model).toObject(ComplianceResultInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultListTests.java deleted file mode 100644 index a44d8e55a67e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultListTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ComplianceResultInner; -import com.azure.resourcemanager.security.models.ComplianceResultList; -import java.util.Arrays; - -public final class ComplianceResultListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComplianceResultList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"resourceStatus\":\"Healthy\"},\"id\":\"rnfygxgispem\",\"name\":\"tzfkufubl\",\"type\":\"ofx\"},{\"properties\":{\"resourceStatus\":\"NotApplicable\"},\"id\":\"jaeq\",\"name\":\"hqjbasvmsmj\",\"type\":\"ulngsntn\"}],\"nextLink\":\"bkzgcwrwclx\"}") - .toObject(ComplianceResultList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComplianceResultList model = - new ComplianceResultList() - .withValue(Arrays.asList(new ComplianceResultInner(), new ComplianceResultInner())); - model = BinaryData.fromObject(model).toObject(ComplianceResultList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultPropertiesTests.java deleted file mode 100644 index 2d0a41a99328..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultPropertiesTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ComplianceResultProperties; - -public final class ComplianceResultPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComplianceResultProperties model = - BinaryData.fromString("{\"resourceStatus\":\"NotApplicable\"}").toObject(ComplianceResultProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComplianceResultProperties model = new ComplianceResultProperties(); - model = BinaryData.fromObject(model).toObject(ComplianceResultProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultsGetWithResponseMockTests.java deleted file mode 100644 index f0c78f2efeb6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultsGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ComplianceResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComplianceResultsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"resourceStatus\":\"Healthy\"},\"id\":\"admskx\",\"name\":\"npd\",\"type\":\"zigjsugswhgsaodk\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ComplianceResult response = - manager.complianceResults().getWithResponse("bv", "ipbwxgooo", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultsListMockTests.java deleted file mode 100644 index 0584266705b7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultsListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ComplianceResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComplianceResultsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"resourceStatus\":\"NotHealthy\"},\"id\":\"jh\",\"name\":\"cl\",\"type\":\"iedfsbwcei\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.complianceResults().list("jdiq", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceSegmentTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceSegmentTests.java deleted file mode 100644 index d31b157d0059..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceSegmentTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ComplianceSegment; - -public final class ComplianceSegmentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComplianceSegment model = - BinaryData - .fromString("{\"segmentType\":\"kcrodtjinfw\",\"percentage\":48.601111864993506}") - .toObject(ComplianceSegment.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComplianceSegment model = new ComplianceSegment(); - model = BinaryData.fromObject(model).toObject(ComplianceSegment.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancesGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancesGetWithResponseMockTests.java deleted file mode 100644 index 5736ac319472..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancesGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Compliance; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CompliancesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"assessmentTimestampUtcDate\":\"2021-04-20T11:58:39Z\",\"resourceCount\":583631661,\"assessmentResult\":[]},\"id\":\"tesubzpvp\",\"name\":\"dylytcovq\",\"type\":\"eu\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Compliance response = - manager.compliances().getWithResponse("iswxspv", "koj", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancesListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancesListMockTests.java deleted file mode 100644 index da2afc0150a2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancesListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Compliance; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CompliancesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"assessmentTimestampUtcDate\":\"2021-01-17T17:15:03Z\",\"resourceCount\":563449519,\"assessmentResult\":[]},\"id\":\"ygysemtme\",\"name\":\"rf\",\"type\":\"vpinkzpatqt\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.compliances().list("axikhfjqebglcxk", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectableResourceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectableResourceTests.java deleted file mode 100644 index 2918460962da..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectableResourceTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ConnectableResource; - -public final class ConnectableResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectableResource model = - BinaryData - .fromString( - "{\"id\":\"lsismjqfrd\",\"inboundConnectedResources\":[{\"connectedResourceId\":\"quhiosrsjuivf\",\"tcpPorts\":\"is\",\"udpPorts\":\"rnxzh\"}],\"outboundConnectedResources\":[{\"connectedResourceId\":\"rxzbujr\",\"tcpPorts\":\"hqvwrevkhgnlnzon\",\"udpPorts\":\"rpiqywncv\"},{\"connectedResourceId\":\"szcofizeht\",\"tcpPorts\":\"gbjkvreljeamur\",\"udpPorts\":\"mlovuanashcxl\"},{\"connectedResourceId\":\"jerbdkelvidizozs\",\"tcpPorts\":\"ccxjm\",\"udpPorts\":\"fdgnwncypuuwwlt\"},{\"connectedResourceId\":\"qjctzenkeif\",\"tcpPorts\":\"hmkdasvfl\",\"udpPorts\":\"bxcudchx\"}]}") - .toObject(ConnectableResource.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectableResource model = new ConnectableResource(); - model = BinaryData.fromObject(model).toObject(ConnectableResource.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectedResourceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectedResourceTests.java deleted file mode 100644 index 01ee1f296ed7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectedResourceTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ConnectedResource; - -public final class ConnectedResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectedResource model = - BinaryData - .fromString("{\"connectedResourceId\":\"rb\",\"tcpPorts\":\"d\",\"udpPorts\":\"robwjlvizbfhf\"}") - .toObject(ConnectedResource.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectedResource model = new ConnectedResource(); - model = BinaryData.fromObject(model).toObject(ConnectedResource.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectedWorkspaceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectedWorkspaceTests.java deleted file mode 100644 index ccdd9758e538..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectedWorkspaceTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ConnectedWorkspace; -import org.junit.jupiter.api.Assertions; - -public final class ConnectedWorkspaceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectedWorkspace model = - BinaryData.fromString("{\"id\":\"jfqipubyznclkfk\"}").toObject(ConnectedWorkspace.class); - Assertions.assertEquals("jfqipubyznclkfk", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectedWorkspace model = new ConnectedWorkspace().withId("jfqipubyznclkfk"); - model = BinaryData.fromObject(model).toObject(ConnectedWorkspace.class); - Assertions.assertEquals("jfqipubyznclkfk", model.id()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionFromIpNotAllowedTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionFromIpNotAllowedTests.java deleted file mode 100644 index 9352ba73c99d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionFromIpNotAllowedTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ConnectionFromIpNotAllowed; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ConnectionFromIpNotAllowedTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectionFromIpNotAllowed model = - BinaryData - .fromString( - "{\"ruleType\":\"ConnectionFromIpNotAllowed\",\"allowlistValues\":[\"wreswmowegm\",\"uteyxeyguq\"],\"valueType\":\"IpCidr\",\"displayName\":\"ii\",\"description\":\"spxlzde\",\"isEnabled\":false}") - .toObject(ConnectionFromIpNotAllowed.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals("wreswmowegm", model.allowlistValues().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectionFromIpNotAllowed model = - new ConnectionFromIpNotAllowed() - .withIsEnabled(false) - .withAllowlistValues(Arrays.asList("wreswmowegm", "uteyxeyguq")); - model = BinaryData.fromObject(model).toObject(ConnectionFromIpNotAllowed.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals("wreswmowegm", model.allowlistValues().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionStringsInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionStringsInnerTests.java deleted file mode 100644 index 3ff0385b3852..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionStringsInnerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ConnectionStringsInner; -import com.azure.resourcemanager.security.models.IngestionConnectionString; -import java.util.Arrays; - -public final class ConnectionStringsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectionStringsInner model = - BinaryData - .fromString( - "{\"value\":[{\"location\":\"qd\",\"value\":\"jgwdtgukranbl\"},{\"location\":\"hqlkccuzgygqwaho\",\"value\":\"lwgniiprglvawu\"}]}") - .toObject(ConnectionStringsInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectionStringsInner model = - new ConnectionStringsInner() - .withValue(Arrays.asList(new IngestionConnectionString(), new IngestionConnectionString())); - model = BinaryData.fromObject(model).toObject(ConnectionStringsInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionToIpNotAllowedTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionToIpNotAllowedTests.java deleted file mode 100644 index 57660875cbd1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionToIpNotAllowedTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ConnectionToIpNotAllowed; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ConnectionToIpNotAllowedTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectionToIpNotAllowed model = - BinaryData - .fromString( - "{\"ruleType\":\"ConnectionToIpNotAllowed\",\"allowlistValues\":[\"qrkuor\",\"tssruqnmdvhazc\",\"jy\"],\"valueType\":\"String\",\"displayName\":\"wbqerzwxiytxtd\",\"description\":\"kvlbpktgdstyoua\",\"isEnabled\":true}") - .toObject(ConnectionToIpNotAllowed.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals("qrkuor", model.allowlistValues().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectionToIpNotAllowed model = - new ConnectionToIpNotAllowed() - .withIsEnabled(true) - .withAllowlistValues(Arrays.asList("qrkuor", "tssruqnmdvhazc", "jy")); - model = BinaryData.fromObject(model).toObject(ConnectionToIpNotAllowed.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals("qrkuor", model.allowlistValues().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorSettingInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorSettingInnerTests.java deleted file mode 100644 index fc22fd5efea8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorSettingInnerTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner; -import com.azure.resourcemanager.security.models.AuthenticationDetailsProperties; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties; -import org.junit.jupiter.api.Assertions; - -public final class ConnectorSettingInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectorSettingInner model = - BinaryData - .fromString( - "{\"properties\":{\"hybridComputeSettings\":{\"hybridComputeProvisioningState\":\"Invalid\",\"autoProvision\":\"Off\",\"resourceGroupName\":\"enl\",\"region\":\"htkln\"},\"authenticationDetails\":{\"authenticationType\":\"AuthenticationDetailsProperties\",\"authenticationProvisioningState\":\"IncorrectPolicy\",\"grantedPermissions\":[\"AWS::AWSSecurityHubReadOnlyAccess\",\"AWS::AWSSecurityHubReadOnlyAccess\",\"AWS::SecurityAudit\"]}},\"id\":\"ev\",\"name\":\"bo\",\"type\":\"lcqxypokk\"}") - .toObject(ConnectorSettingInner.class); - Assertions.assertEquals(AutoProvision.OFF, model.hybridComputeSettings().autoProvision()); - Assertions.assertEquals("enl", model.hybridComputeSettings().resourceGroupName()); - Assertions.assertEquals("htkln", model.hybridComputeSettings().region()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectorSettingInner model = - new ConnectorSettingInner() - .withHybridComputeSettings( - new HybridComputeSettingsProperties() - .withAutoProvision(AutoProvision.OFF) - .withResourceGroupName("enl") - .withRegion("htkln")) - .withAuthenticationDetails(new AuthenticationDetailsProperties()); - model = BinaryData.fromObject(model).toObject(ConnectorSettingInner.class); - Assertions.assertEquals(AutoProvision.OFF, model.hybridComputeSettings().autoProvision()); - Assertions.assertEquals("enl", model.hybridComputeSettings().resourceGroupName()); - Assertions.assertEquals("htkln", model.hybridComputeSettings().region()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorSettingListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorSettingListTests.java deleted file mode 100644 index 069f35ab6d3d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorSettingListTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner; -import com.azure.resourcemanager.security.models.ConnectorSettingList; -import java.util.Arrays; - -public final class ConnectorSettingListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectorSettingList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{},\"id\":\"kzmkwklsnoxaxmqe\",\"name\":\"alhhjnhgwydyynfs\",\"type\":\"khgb\"},{\"properties\":{},\"id\":\"narfdlpukhpyrn\",\"name\":\"izjcpeog\",\"type\":\"hnmgbroux\"},{\"properties\":{},\"id\":\"fhp\",\"name\":\"paz\",\"type\":\"zoyw\"},{\"properties\":{},\"id\":\"dulontacn\",\"name\":\"qwtehtuevr\",\"type\":\"rljyoogwxhnsdu\"}],\"nextLink\":\"wbsreur\"}") - .toObject(ConnectorSettingList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectorSettingList model = - new ConnectorSettingList() - .withValue( - Arrays - .asList( - new ConnectorSettingInner(), - new ConnectorSettingInner(), - new ConnectorSettingInner(), - new ConnectorSettingInner())); - model = BinaryData.fromObject(model).toObject(ConnectorSettingList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index a0d0fec01fca..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AuthenticationDetailsProperties; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.ConnectorSetting; -import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConnectorsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"hybridComputeSettings\":{\"hybridComputeProvisioningState\":\"Invalid\",\"autoProvision\":\"On\",\"resourceGroupName\":\"rwtrdgscnvqeonsg\",\"region\":\"xlw\"},\"authenticationDetails\":{\"authenticationType\":\"AuthenticationDetailsProperties\",\"authenticationProvisioningState\":\"Expired\",\"grantedPermissions\":[]}},\"id\":\"pthceopvkv\",\"name\":\"wfvesobpbok\",\"type\":\"mmlcdyarng\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ConnectorSetting response = - manager - .connectors() - .define("jermhzic") - .withHybridComputeSettings( - new HybridComputeSettingsProperties() - .withAutoProvision(AutoProvision.OFF) - .withResourceGroupName("aaknyukibxig") - .withRegion("phzwxqte")) - .withAuthenticationDetails(new AuthenticationDetailsProperties()) - .create(); - - Assertions.assertEquals(AutoProvision.ON, response.hybridComputeSettings().autoProvision()); - Assertions.assertEquals("rwtrdgscnvqeonsg", response.hybridComputeSettings().resourceGroupName()); - Assertions.assertEquals("xlw", response.hybridComputeSettings().region()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsDeleteWithResponseMockTests.java deleted file mode 100644 index 82fc4ab6f635..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConnectorsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.connectors().deleteWithResponse("dueurgmcdcpkshl", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsGetWithResponseMockTests.java deleted file mode 100644 index 8433202342fb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.ConnectorSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConnectorsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"hybridComputeSettings\":{\"hybridComputeProvisioningState\":\"Invalid\",\"autoProvision\":\"On\",\"resourceGroupName\":\"dh\",\"region\":\"ojvlirknucosaw\"},\"authenticationDetails\":{\"authenticationType\":\"AuthenticationDetailsProperties\",\"authenticationProvisioningState\":\"Expired\",\"grantedPermissions\":[]}},\"id\":\"lgpyaixihz\",\"name\":\"jjtsm\",\"type\":\"ydqfttkacy\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ConnectorSetting response = - manager.connectors().getWithResponse("d", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals(AutoProvision.ON, response.hybridComputeSettings().autoProvision()); - Assertions.assertEquals("dh", response.hybridComputeSettings().resourceGroupName()); - Assertions.assertEquals("ojvlirknucosaw", response.hybridComputeSettings().region()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsListMockTests.java deleted file mode 100644 index f2e3152f106a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsListMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.ConnectorSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConnectorsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"hybridComputeSettings\":{\"hybridComputeProvisioningState\":\"Invalid\",\"autoProvision\":\"Off\",\"resourceGroupName\":\"hwynct\",\"region\":\"zcnjfmbbfnvjxit\"},\"authenticationDetails\":{\"authenticationType\":\"AuthenticationDetailsProperties\",\"authenticationProvisioningState\":\"IncorrectPolicy\",\"grantedPermissions\":[]}},\"id\":\"iklsmni\",\"name\":\"qlcoqksyiibhyx\",\"type\":\"bgbudav\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.connectors().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AutoProvision.OFF, response.iterator().next().hybridComputeSettings().autoProvision()); - Assertions.assertEquals("hwynct", response.iterator().next().hybridComputeSettings().resourceGroupName()); - Assertions.assertEquals("zcnjfmbbfnvjxit", response.iterator().next().hybridComputeSettings().region()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ContainerRegistryVulnerabilityPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ContainerRegistryVulnerabilityPropertiesTests.java deleted file mode 100644 index f5cfff70aac5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ContainerRegistryVulnerabilityPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ContainerRegistryVulnerabilityProperties; - -public final class ContainerRegistryVulnerabilityPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ContainerRegistryVulnerabilityProperties model = - BinaryData - .fromString( - "{\"assessedResourceType\":\"ContainerRegistryVulnerability\",\"type\":\"x\",\"cvss\":{\"pcpahprzrvxhmtf\":{\"base\":17.635876},\"nxzcm\":{\"base\":39.96614},\"gxnoqrxtdis\":{\"base\":25.372917}},\"patchable\":true,\"cve\":[{\"title\":\"lmydidwhep\",\"link\":\"wtj\"},{\"title\":\"o\",\"link\":\"xxhmwcdbc\"},{\"title\":\"oikxkxhnegk\",\"link\":\"z\"}],\"publishedTime\":\"2021-11-05T00:07:59Z\",\"vendorReferences\":[{\"title\":\"plvukaobrlbpg\",\"link\":\"bagn\"}],\"repositoryName\":\"jhgem\",\"imageDigest\":\"wakywalhjymxcgq\"}") - .toObject(ContainerRegistryVulnerabilityProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ContainerRegistryVulnerabilityProperties model = new ContainerRegistryVulnerabilityProperties(); - model = BinaryData.fromObject(model).toObject(ContainerRegistryVulnerabilityProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAwsOfferingNativeCloudConnectionTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAwsOfferingNativeCloudConnectionTests.java deleted file mode 100644 index c514e225301b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAwsOfferingNativeCloudConnectionTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CspmMonitorAwsOfferingNativeCloudConnection; -import org.junit.jupiter.api.Assertions; - -public final class CspmMonitorAwsOfferingNativeCloudConnectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CspmMonitorAwsOfferingNativeCloudConnection model = - BinaryData - .fromString("{\"cloudRoleArn\":\"jhqxc\"}") - .toObject(CspmMonitorAwsOfferingNativeCloudConnection.class); - Assertions.assertEquals("jhqxc", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CspmMonitorAwsOfferingNativeCloudConnection model = - new CspmMonitorAwsOfferingNativeCloudConnection().withCloudRoleArn("jhqxc"); - model = BinaryData.fromObject(model).toObject(CspmMonitorAwsOfferingNativeCloudConnection.class); - Assertions.assertEquals("jhqxc", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAwsOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAwsOfferingTests.java deleted file mode 100644 index 3c899ba293db..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAwsOfferingTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CspmMonitorAwsOffering; -import com.azure.resourcemanager.security.models.CspmMonitorAwsOfferingNativeCloudConnection; -import org.junit.jupiter.api.Assertions; - -public final class CspmMonitorAwsOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CspmMonitorAwsOffering model = - BinaryData - .fromString( - "{\"offeringType\":\"CspmMonitorAws\",\"nativeCloudConnection\":{\"cloudRoleArn\":\"krmukmyjmkxett\"},\"description\":\"lojfkqidnqto\"}") - .toObject(CspmMonitorAwsOffering.class); - Assertions.assertEquals("krmukmyjmkxett", model.nativeCloudConnection().cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CspmMonitorAwsOffering model = - new CspmMonitorAwsOffering() - .withNativeCloudConnection( - new CspmMonitorAwsOfferingNativeCloudConnection().withCloudRoleArn("krmukmyjmkxett")); - model = BinaryData.fromObject(model).toObject(CspmMonitorAwsOffering.class); - Assertions.assertEquals("krmukmyjmkxett", model.nativeCloudConnection().cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAzureDevOpsOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAzureDevOpsOfferingTests.java deleted file mode 100644 index b42823f93d69..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAzureDevOpsOfferingTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CspmMonitorAzureDevOpsOffering; - -public final class CspmMonitorAzureDevOpsOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CspmMonitorAzureDevOpsOffering model = - BinaryData - .fromString("{\"offeringType\":\"CspmMonitorAzureDevOps\",\"description\":\"ytjlkesmmpath\"}") - .toObject(CspmMonitorAzureDevOpsOffering.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CspmMonitorAzureDevOpsOffering model = new CspmMonitorAzureDevOpsOffering(); - model = BinaryData.fromObject(model).toObject(CspmMonitorAzureDevOpsOffering.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGcpOfferingNativeCloudConnectionTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGcpOfferingNativeCloudConnectionTests.java deleted file mode 100644 index 77bb8cf1ca39..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGcpOfferingNativeCloudConnectionTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CspmMonitorGcpOfferingNativeCloudConnection; -import org.junit.jupiter.api.Assertions; - -public final class CspmMonitorGcpOfferingNativeCloudConnectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CspmMonitorGcpOfferingNativeCloudConnection model = - BinaryData - .fromString("{\"workloadIdentityProviderId\":\"wjrkb\",\"serviceAccountEmailAddress\":\"jhbtqq\"}") - .toObject(CspmMonitorGcpOfferingNativeCloudConnection.class); - Assertions.assertEquals("wjrkb", model.workloadIdentityProviderId()); - Assertions.assertEquals("jhbtqq", model.serviceAccountEmailAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CspmMonitorGcpOfferingNativeCloudConnection model = - new CspmMonitorGcpOfferingNativeCloudConnection() - .withWorkloadIdentityProviderId("wjrkb") - .withServiceAccountEmailAddress("jhbtqq"); - model = BinaryData.fromObject(model).toObject(CspmMonitorGcpOfferingNativeCloudConnection.class); - Assertions.assertEquals("wjrkb", model.workloadIdentityProviderId()); - Assertions.assertEquals("jhbtqq", model.serviceAccountEmailAddress()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGcpOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGcpOfferingTests.java deleted file mode 100644 index f6fad2a36ce2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGcpOfferingTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CspmMonitorGcpOffering; -import com.azure.resourcemanager.security.models.CspmMonitorGcpOfferingNativeCloudConnection; -import org.junit.jupiter.api.Assertions; - -public final class CspmMonitorGcpOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CspmMonitorGcpOffering model = - BinaryData - .fromString( - "{\"offeringType\":\"CspmMonitorGcp\",\"nativeCloudConnection\":{\"workloadIdentityProviderId\":\"nqimwbzxpdcldp\",\"serviceAccountEmailAddress\":\"wnsnlaimouxwks\"},\"description\":\"udmfcoibiczius\"}") - .toObject(CspmMonitorGcpOffering.class); - Assertions.assertEquals("nqimwbzxpdcldp", model.nativeCloudConnection().workloadIdentityProviderId()); - Assertions.assertEquals("wnsnlaimouxwks", model.nativeCloudConnection().serviceAccountEmailAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CspmMonitorGcpOffering model = - new CspmMonitorGcpOffering() - .withNativeCloudConnection( - new CspmMonitorGcpOfferingNativeCloudConnection() - .withWorkloadIdentityProviderId("nqimwbzxpdcldp") - .withServiceAccountEmailAddress("wnsnlaimouxwks")); - model = BinaryData.fromObject(model).toObject(CspmMonitorGcpOffering.class); - Assertions.assertEquals("nqimwbzxpdcldp", model.nativeCloudConnection().workloadIdentityProviderId()); - Assertions.assertEquals("wnsnlaimouxwks", model.nativeCloudConnection().serviceAccountEmailAddress()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGitLabOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGitLabOfferingTests.java deleted file mode 100644 index 823a7e3cd728..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGitLabOfferingTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CspmMonitorGitLabOffering; - -public final class CspmMonitorGitLabOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CspmMonitorGitLabOffering model = - BinaryData - .fromString("{\"offeringType\":\"CspmMonitorGitLab\",\"description\":\"vnmdyfoeboj\"}") - .toObject(CspmMonitorGitLabOffering.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CspmMonitorGitLabOffering model = new CspmMonitorGitLabOffering(); - model = BinaryData.fromObject(model).toObject(CspmMonitorGitLabOffering.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGithubOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGithubOfferingTests.java deleted file mode 100644 index 9f2583b961f0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGithubOfferingTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CspmMonitorGithubOffering; - -public final class CspmMonitorGithubOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CspmMonitorGithubOffering model = - BinaryData - .fromString("{\"offeringType\":\"CspmMonitorGithub\",\"description\":\"bdbfgrlp\"}") - .toObject(CspmMonitorGithubOffering.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CspmMonitorGithubOffering model = new CspmMonitorGithubOffering(); - model = BinaryData.fromObject(model).toObject(CspmMonitorGithubOffering.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAlertRuleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAlertRuleTests.java deleted file mode 100644 index 77399c4efa87..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAlertRuleTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CustomAlertRule; -import org.junit.jupiter.api.Assertions; - -public final class CustomAlertRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomAlertRule model = - BinaryData - .fromString( - "{\"ruleType\":\"CustomAlertRule\",\"displayName\":\"gqywgndrv\",\"description\":\"hzgpphrcgyncocpe\",\"isEnabled\":false}") - .toObject(CustomAlertRule.class); - Assertions.assertEquals(false, model.isEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomAlertRule model = new CustomAlertRule().withIsEnabled(false); - model = BinaryData.fromObject(model).toObject(CustomAlertRule.class); - Assertions.assertEquals(false, model.isEnabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationRequestPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationRequestPropertiesTests.java deleted file mode 100644 index aa455a49be3f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationRequestPropertiesTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationRequestProperties; -import com.azure.resourcemanager.security.models.SeverityEnum; -import com.azure.resourcemanager.security.models.SupportedCloudEnum; -import org.junit.jupiter.api.Assertions; - -public final class CustomAssessmentAutomationRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomAssessmentAutomationRequestProperties model = - BinaryData - .fromString( - "{\"compressedQuery\":\"cbjy\",\"supportedCloud\":\"AWS\",\"severity\":\"Low\",\"displayName\":\"xqhabi\",\"description\":\"ikxwc\",\"remediationDescription\":\"yscnpqxu\"}") - .toObject(CustomAssessmentAutomationRequestProperties.class); - Assertions.assertEquals("cbjy", model.compressedQuery()); - Assertions.assertEquals(SupportedCloudEnum.AWS, model.supportedCloud()); - Assertions.assertEquals(SeverityEnum.LOW, model.severity()); - Assertions.assertEquals("xqhabi", model.displayName()); - Assertions.assertEquals("ikxwc", model.description()); - Assertions.assertEquals("yscnpqxu", model.remediationDescription()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomAssessmentAutomationRequestProperties model = - new CustomAssessmentAutomationRequestProperties() - .withCompressedQuery("cbjy") - .withSupportedCloud(SupportedCloudEnum.AWS) - .withSeverity(SeverityEnum.LOW) - .withDisplayName("xqhabi") - .withDescription("ikxwc") - .withRemediationDescription("yscnpqxu"); - model = BinaryData.fromObject(model).toObject(CustomAssessmentAutomationRequestProperties.class); - Assertions.assertEquals("cbjy", model.compressedQuery()); - Assertions.assertEquals(SupportedCloudEnum.AWS, model.supportedCloud()); - Assertions.assertEquals(SeverityEnum.LOW, model.severity()); - Assertions.assertEquals("xqhabi", model.displayName()); - Assertions.assertEquals("ikxwc", model.description()); - Assertions.assertEquals("yscnpqxu", model.remediationDescription()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationRequestTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationRequestTests.java deleted file mode 100644 index 1ba48761ba0d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationRequestTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CustomAssessmentAutomationRequest; -import com.azure.resourcemanager.security.models.SeverityEnum; -import com.azure.resourcemanager.security.models.SupportedCloudEnum; -import org.junit.jupiter.api.Assertions; - -public final class CustomAssessmentAutomationRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomAssessmentAutomationRequest model = - BinaryData - .fromString( - "{\"properties\":{\"compressedQuery\":\"xhekuksjtxukcdm\",\"supportedCloud\":\"GCP\",\"severity\":\"Low\",\"displayName\":\"uanzwuxzdx\",\"description\":\"yrlhmwhfpmrqobm\",\"remediationDescription\":\"kknryrtihf\"},\"id\":\"tijbpzvgnwzsymgl\",\"name\":\"uf\",\"type\":\"yzkohdbihanuf\"}") - .toObject(CustomAssessmentAutomationRequest.class); - Assertions.assertEquals("xhekuksjtxukcdm", model.compressedQuery()); - Assertions.assertEquals(SupportedCloudEnum.GCP, model.supportedCloud()); - Assertions.assertEquals(SeverityEnum.LOW, model.severity()); - Assertions.assertEquals("uanzwuxzdx", model.displayName()); - Assertions.assertEquals("yrlhmwhfpmrqobm", model.description()); - Assertions.assertEquals("kknryrtihf", model.remediationDescription()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomAssessmentAutomationRequest model = - new CustomAssessmentAutomationRequest() - .withCompressedQuery("xhekuksjtxukcdm") - .withSupportedCloud(SupportedCloudEnum.GCP) - .withSeverity(SeverityEnum.LOW) - .withDisplayName("uanzwuxzdx") - .withDescription("yrlhmwhfpmrqobm") - .withRemediationDescription("kknryrtihf"); - model = BinaryData.fromObject(model).toObject(CustomAssessmentAutomationRequest.class); - Assertions.assertEquals("xhekuksjtxukcdm", model.compressedQuery()); - Assertions.assertEquals(SupportedCloudEnum.GCP, model.supportedCloud()); - Assertions.assertEquals(SeverityEnum.LOW, model.severity()); - Assertions.assertEquals("uanzwuxzdx", model.displayName()); - Assertions.assertEquals("yrlhmwhfpmrqobm", model.description()); - Assertions.assertEquals("kknryrtihf", model.remediationDescription()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsDeleteByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index e78ef4dc3729..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomAssessmentAutomationsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .customAssessmentAutomations() - .deleteByResourceGroupWithResponse("u", "lzladltxkpbqh", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentInnerTests.java deleted file mode 100644 index 7760b93bbfb5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentInnerTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentInner; -import org.junit.jupiter.api.Assertions; - -public final class CustomEntityStoreAssignmentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomEntityStoreAssignmentInner model = - BinaryData - .fromString( - "{\"properties\":{\"principal\":\"ipjoxzjnchgejs\",\"entityStoreDatabaseLink\":\"dmailzydehojw\"},\"id\":\"ahuxinpm\",\"name\":\"njaqwixjspro\",\"type\":\"vcputegj\"}") - .toObject(CustomEntityStoreAssignmentInner.class); - Assertions.assertEquals("ipjoxzjnchgejs", model.principal()); - Assertions.assertEquals("dmailzydehojw", model.entityStoreDatabaseLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomEntityStoreAssignmentInner model = - new CustomEntityStoreAssignmentInner() - .withPrincipal("ipjoxzjnchgejs") - .withEntityStoreDatabaseLink("dmailzydehojw"); - model = BinaryData.fromObject(model).toObject(CustomEntityStoreAssignmentInner.class); - Assertions.assertEquals("ipjoxzjnchgejs", model.principal()); - Assertions.assertEquals("dmailzydehojw", model.entityStoreDatabaseLink()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentPropertiesTests.java deleted file mode 100644 index 6109b55d00ce..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentPropertiesTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentProperties; -import org.junit.jupiter.api.Assertions; - -public final class CustomEntityStoreAssignmentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomEntityStoreAssignmentProperties model = - BinaryData - .fromString("{\"principal\":\"mfdatscmdvpj\",\"entityStoreDatabaseLink\":\"lsuuvmkjozkrwfnd\"}") - .toObject(CustomEntityStoreAssignmentProperties.class); - Assertions.assertEquals("mfdatscmdvpj", model.principal()); - Assertions.assertEquals("lsuuvmkjozkrwfnd", model.entityStoreDatabaseLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomEntityStoreAssignmentProperties model = - new CustomEntityStoreAssignmentProperties() - .withPrincipal("mfdatscmdvpj") - .withEntityStoreDatabaseLink("lsuuvmkjozkrwfnd"); - model = BinaryData.fromObject(model).toObject(CustomEntityStoreAssignmentProperties.class); - Assertions.assertEquals("mfdatscmdvpj", model.principal()); - Assertions.assertEquals("lsuuvmkjozkrwfnd", model.entityStoreDatabaseLink()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentRequestPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentRequestPropertiesTests.java deleted file mode 100644 index 70cd0dc9b2ad..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentRequestPropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentRequestProperties; -import org.junit.jupiter.api.Assertions; - -public final class CustomEntityStoreAssignmentRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomEntityStoreAssignmentRequestProperties model = - BinaryData - .fromString("{\"principal\":\"wryoqpsoacc\"}") - .toObject(CustomEntityStoreAssignmentRequestProperties.class); - Assertions.assertEquals("wryoqpsoacc", model.principal()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomEntityStoreAssignmentRequestProperties model = - new CustomEntityStoreAssignmentRequestProperties().withPrincipal("wryoqpsoacc"); - model = BinaryData.fromObject(model).toObject(CustomEntityStoreAssignmentRequestProperties.class); - Assertions.assertEquals("wryoqpsoacc", model.principal()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentRequestTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentRequestTests.java deleted file mode 100644 index 56bb9c135e80..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentRequestTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignmentRequest; -import org.junit.jupiter.api.Assertions; - -public final class CustomEntityStoreAssignmentRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomEntityStoreAssignmentRequest model = - BinaryData - .fromString("{\"properties\":{\"principal\":\"jpslwejd\"}}") - .toObject(CustomEntityStoreAssignmentRequest.class); - Assertions.assertEquals("jpslwejd", model.principal()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomEntityStoreAssignmentRequest model = new CustomEntityStoreAssignmentRequest().withPrincipal("jpslwejd"); - model = BinaryData.fromObject(model).toObject(CustomEntityStoreAssignmentRequest.class); - Assertions.assertEquals("jpslwejd", model.principal()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsCreateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsCreateWithResponseMockTests.java deleted file mode 100644 index 291bf119276b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsCreateWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomEntityStoreAssignmentsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"principal\":\"wzm\",\"entityStoreDatabaseLink\":\"lrixysfnimsq\"},\"id\":\"wwwmhkruwaedrym\",\"name\":\"mlqoinhzduew\",\"type\":\"hapfjiik\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CustomEntityStoreAssignment response = - manager - .customEntityStoreAssignments() - .define("qgsdr") - .withExistingResourceGroup("bh") - .withPrincipal("tjxophgerhsmv") - .create(); - - Assertions.assertEquals("wzm", response.principal()); - Assertions.assertEquals("lrixysfnimsq", response.entityStoreDatabaseLink()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsDeleteByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 3dd6a74d56be..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomEntityStoreAssignmentsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .customEntityStoreAssignments() - .deleteByResourceGroupWithResponse("jfowxwy", "vcxjsgbipcukdvek", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsGetByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 989cf9a63b52..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomEntityStoreAssignmentsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"principal\":\"sztekxby\",\"entityStoreDatabaseLink\":\"msfe\"},\"id\":\"x\",\"name\":\"ihpq\",\"type\":\"dagrhrdicxdw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CustomEntityStoreAssignment response = - manager - .customEntityStoreAssignments() - .getByResourceGroupWithResponse("kxpkzwaq", "ofqovchiqbplv", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("sztekxby", response.principal()); - Assertions.assertEquals("msfe", response.entityStoreDatabaseLink()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListByResourceGroupMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListByResourceGroupMockTests.java deleted file mode 100644 index d66bf1861c56..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListByResourceGroupMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomEntityStoreAssignmentsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"principal\":\"d\",\"entityStoreDatabaseLink\":\"bfdyjduss\"},\"id\":\"yszekbhwlka\",\"name\":\"ggkrehbf\",\"type\":\"n\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.customEntityStoreAssignments().listByResourceGroup("buhoduchv", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("d", response.iterator().next().principal()); - Assertions.assertEquals("bfdyjduss", response.iterator().next().entityStoreDatabaseLink()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListMockTests.java deleted file mode 100644 index 755f2ef03197..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomEntityStoreAssignmentsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"principal\":\"fljfiimreoagsqt\",\"entityStoreDatabaseLink\":\"dusr\"},\"id\":\"xxfavsqwudohzilf\",\"name\":\"nl\",\"type\":\"kpsimsfeypofqp\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.customEntityStoreAssignments().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fljfiimreoagsqt", response.iterator().next().principal()); - Assertions.assertEquals("dusr", response.iterator().next().entityStoreDatabaseLink()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListResultTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListResultTests.java deleted file mode 100644 index 8b522177114b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListResultTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignmentsListResult; -import org.junit.jupiter.api.Assertions; - -public final class CustomEntityStoreAssignmentsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomEntityStoreAssignmentsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"principal\":\"j\",\"entityStoreDatabaseLink\":\"hbcryffdfdosyge\"},\"id\":\"paojakhmsbzjh\",\"name\":\"rzevdphlxaol\",\"type\":\"hqtrgqjbpf\"},{\"properties\":{\"principal\":\"n\",\"entityStoreDatabaseLink\":\"v\"},\"id\":\"cjrwzoxxjtfellu\",\"name\":\"fziton\",\"type\":\"eqfpj\"},{\"properties\":{\"principal\":\"ofpdvh\",\"entityStoreDatabaseLink\":\"xxypininmay\"},\"id\":\"uybbkpodep\",\"name\":\"oginuvamiheognar\",\"type\":\"zxtheotusivyevcc\"}],\"nextLink\":\"ihnhun\"}") - .toObject(CustomEntityStoreAssignmentsListResult.class); - Assertions.assertEquals("ihnhun", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomEntityStoreAssignmentsListResult model = - new CustomEntityStoreAssignmentsListResult().withNextLink("ihnhun"); - model = BinaryData.fromObject(model).toObject(CustomEntityStoreAssignmentsListResult.class); - Assertions.assertEquals("ihnhun", model.nextLink()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CveTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CveTests.java deleted file mode 100644 index b0dfc5e6e389..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CveTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Cve; - -public final class CveTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Cve model = BinaryData.fromString("{\"title\":\"rclsso\",\"link\":\"omevtfycn\"}").toObject(Cve.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Cve model = new Cve(); - model = BinaryData.fromObject(model).toObject(Cve.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CvssTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CvssTests.java deleted file mode 100644 index ac89cf48db95..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CvssTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Cvss; - -public final class CvssTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Cvss model = BinaryData.fromString("{\"base\":57.412754}").toObject(Cvss.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Cvss model = new Cvss(); - model = BinaryData.fromObject(model).toObject(Cvss.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DataExportSettingPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DataExportSettingPropertiesTests.java deleted file mode 100644 index 1ef43dbd37e6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DataExportSettingPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.DataExportSettingProperties; -import org.junit.jupiter.api.Assertions; - -public final class DataExportSettingPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataExportSettingProperties model = - BinaryData.fromString("{\"enabled\":true}").toObject(DataExportSettingProperties.class); - Assertions.assertEquals(true, model.enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataExportSettingProperties model = new DataExportSettingProperties().withEnabled(true); - model = BinaryData.fromObject(model).toObject(DataExportSettingProperties.class); - Assertions.assertEquals(true, model.enabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DataExportSettingsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DataExportSettingsTests.java deleted file mode 100644 index cfaa562cfc7c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DataExportSettingsTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DataExportSettings; -import org.junit.jupiter.api.Assertions; - -public final class DataExportSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataExportSettings model = - BinaryData - .fromString( - "{\"kind\":\"DataExportSettings\",\"properties\":{\"enabled\":true},\"id\":\"mptyrilkfbnrqqxv\",\"name\":\"tpbnfnqtxjtoma\",\"type\":\"swbnfddepldwqjns\"}") - .toObject(DataExportSettings.class); - Assertions.assertEquals(true, model.enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataExportSettings model = new DataExportSettings().withEnabled(true); - model = BinaryData.fromObject(model).toObject(DataExportSettings.class); - Assertions.assertEquals(true, model.enabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingDataSensitivityDiscoveryTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingDataSensitivityDiscoveryTests.java deleted file mode 100644 index 2307bf7a6b36..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingDataSensitivityDiscoveryTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingDataSensitivityDiscovery; -import org.junit.jupiter.api.Assertions; - -public final class DefenderCspmAwsOfferingDataSensitivityDiscoveryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderCspmAwsOfferingDataSensitivityDiscovery model = - BinaryData - .fromString("{\"enabled\":true,\"cloudRoleArn\":\"ythqkkwhbgxvel\"}") - .toObject(DefenderCspmAwsOfferingDataSensitivityDiscovery.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("ythqkkwhbgxvel", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderCspmAwsOfferingDataSensitivityDiscovery model = - new DefenderCspmAwsOfferingDataSensitivityDiscovery().withEnabled(true).withCloudRoleArn("ythqkkwhbgxvel"); - model = BinaryData.fromObject(model).toObject(DefenderCspmAwsOfferingDataSensitivityDiscovery.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("ythqkkwhbgxvel", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingDatabasesDspmTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingDatabasesDspmTests.java deleted file mode 100644 index c5377f6faf43..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingDatabasesDspmTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingDatabasesDspm; -import org.junit.jupiter.api.Assertions; - -public final class DefenderCspmAwsOfferingDatabasesDspmTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderCspmAwsOfferingDatabasesDspm model = - BinaryData - .fromString("{\"enabled\":true,\"cloudRoleArn\":\"nxdmnitmujdtv\"}") - .toObject(DefenderCspmAwsOfferingDatabasesDspm.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("nxdmnitmujdtv", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderCspmAwsOfferingDatabasesDspm model = - new DefenderCspmAwsOfferingDatabasesDspm().withEnabled(true).withCloudRoleArn("nxdmnitmujdtv"); - model = BinaryData.fromObject(model).toObject(DefenderCspmAwsOfferingDatabasesDspm.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("nxdmnitmujdtv", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingTests.java deleted file mode 100644 index 5f48fb7b2733..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderCspmAwsOffering; -import com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingDataSensitivityDiscovery; -import com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingDatabasesDspm; -import com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingVmScanners; -import com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingVmScannersConfiguration; -import com.azure.resourcemanager.security.models.ScanningMode; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DefenderCspmAwsOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderCspmAwsOffering model = - BinaryData - .fromString( - "{\"offeringType\":\"DefenderCspmAws\",\"vmScanners\":{\"enabled\":false,\"configuration\":{\"cloudRoleArn\":\"e\",\"scanningMode\":\"Default\",\"exclusionTags\":{\"ktjtgra\":\"llbvgwzsfftedous\",\"fkbebauzl\":\"aqo\"}}},\"dataSensitivityDiscovery\":{\"enabled\":false,\"cloudRoleArn\":\"wpfhnjzudrtpzkgm\"},\"databasesDspm\":{\"enabled\":false,\"cloudRoleArn\":\"hczzqrhm\"},\"description\":\"qbedygisrzwn\"}") - .toObject(DefenderCspmAwsOffering.class); - Assertions.assertEquals(false, model.vmScanners().enabled()); - Assertions.assertEquals("e", model.vmScanners().configuration().cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.vmScanners().configuration().scanningMode()); - Assertions.assertEquals("llbvgwzsfftedous", model.vmScanners().configuration().exclusionTags().get("ktjtgra")); - Assertions.assertEquals(false, model.dataSensitivityDiscovery().enabled()); - Assertions.assertEquals("wpfhnjzudrtpzkgm", model.dataSensitivityDiscovery().cloudRoleArn()); - Assertions.assertEquals(false, model.databasesDspm().enabled()); - Assertions.assertEquals("hczzqrhm", model.databasesDspm().cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderCspmAwsOffering model = - new DefenderCspmAwsOffering() - .withVmScanners( - new DefenderCspmAwsOfferingVmScanners() - .withEnabled(false) - .withConfiguration( - new DefenderCspmAwsOfferingVmScannersConfiguration() - .withCloudRoleArn("e") - .withScanningMode(ScanningMode.DEFAULT) - .withExclusionTags(mapOf("ktjtgra", "llbvgwzsfftedous", "fkbebauzl", "aqo")))) - .withDataSensitivityDiscovery( - new DefenderCspmAwsOfferingDataSensitivityDiscovery() - .withEnabled(false) - .withCloudRoleArn("wpfhnjzudrtpzkgm")) - .withDatabasesDspm( - new DefenderCspmAwsOfferingDatabasesDspm().withEnabled(false).withCloudRoleArn("hczzqrhm")); - model = BinaryData.fromObject(model).toObject(DefenderCspmAwsOffering.class); - Assertions.assertEquals(false, model.vmScanners().enabled()); - Assertions.assertEquals("e", model.vmScanners().configuration().cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.vmScanners().configuration().scanningMode()); - Assertions.assertEquals("llbvgwzsfftedous", model.vmScanners().configuration().exclusionTags().get("ktjtgra")); - Assertions.assertEquals(false, model.dataSensitivityDiscovery().enabled()); - Assertions.assertEquals("wpfhnjzudrtpzkgm", model.dataSensitivityDiscovery().cloudRoleArn()); - Assertions.assertEquals(false, model.databasesDspm().enabled()); - Assertions.assertEquals("hczzqrhm", model.databasesDspm().cloudRoleArn()); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingVmScannersConfigurationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingVmScannersConfigurationTests.java deleted file mode 100644 index b0f6261d8640..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingVmScannersConfigurationTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingVmScannersConfiguration; -import com.azure.resourcemanager.security.models.ScanningMode; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DefenderCspmAwsOfferingVmScannersConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderCspmAwsOfferingVmScannersConfiguration model = - BinaryData - .fromString( - "{\"cloudRoleArn\":\"sqrggvrbnyruko\",\"scanningMode\":\"Default\",\"exclusionTags\":{\"p\":\"duwjleipjlhwy\"}}") - .toObject(DefenderCspmAwsOfferingVmScannersConfiguration.class); - Assertions.assertEquals("sqrggvrbnyruko", model.cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.scanningMode()); - Assertions.assertEquals("duwjleipjlhwy", model.exclusionTags().get("p")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderCspmAwsOfferingVmScannersConfiguration model = - new DefenderCspmAwsOfferingVmScannersConfiguration() - .withCloudRoleArn("sqrggvrbnyruko") - .withScanningMode(ScanningMode.DEFAULT) - .withExclusionTags(mapOf("p", "duwjleipjlhwy")); - model = BinaryData.fromObject(model).toObject(DefenderCspmAwsOfferingVmScannersConfiguration.class); - Assertions.assertEquals("sqrggvrbnyruko", model.cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.scanningMode()); - Assertions.assertEquals("duwjleipjlhwy", model.exclusionTags().get("p")); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingVmScannersTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingVmScannersTests.java deleted file mode 100644 index a99b23fb56e1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingVmScannersTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingVmScanners; -import com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingVmScannersConfiguration; -import com.azure.resourcemanager.security.models.ScanningMode; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DefenderCspmAwsOfferingVmScannersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderCspmAwsOfferingVmScanners model = - BinaryData - .fromString( - "{\"enabled\":false,\"configuration\":{\"cloudRoleArn\":\"jch\",\"scanningMode\":\"Default\",\"exclusionTags\":{\"rfgdrwj\":\"ctofldseacdhztxk\",\"xet\":\"yewhfjsrwq\",\"thvmaxgnuyeamcmh\":\"gcwvrrmdqntycna\",\"wcpqtwl\":\"dfjeceho\"}}}") - .toObject(DefenderCspmAwsOfferingVmScanners.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("jch", model.configuration().cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.configuration().scanningMode()); - Assertions.assertEquals("ctofldseacdhztxk", model.configuration().exclusionTags().get("rfgdrwj")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderCspmAwsOfferingVmScanners model = - new DefenderCspmAwsOfferingVmScanners() - .withEnabled(false) - .withConfiguration( - new DefenderCspmAwsOfferingVmScannersConfiguration() - .withCloudRoleArn("jch") - .withScanningMode(ScanningMode.DEFAULT) - .withExclusionTags( - mapOf( - "rfgdrwj", - "ctofldseacdhztxk", - "xet", - "yewhfjsrwq", - "thvmaxgnuyeamcmh", - "gcwvrrmdqntycna", - "wcpqtwl", - "dfjeceho"))); - model = BinaryData.fromObject(model).toObject(DefenderCspmAwsOfferingVmScanners.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("jch", model.configuration().cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.configuration().scanningMode()); - Assertions.assertEquals("ctofldseacdhztxk", model.configuration().exclusionTags().get("rfgdrwj")); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmGcpOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmGcpOfferingTests.java deleted file mode 100644 index e92e258df870..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmGcpOfferingTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderCspmGcpOffering; - -public final class DefenderCspmGcpOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderCspmGcpOffering model = - BinaryData - .fromString("{\"offeringType\":\"DefenderCspmGcp\",\"description\":\"lyymffhmjpddny\"}") - .toObject(DefenderCspmGcpOffering.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderCspmGcpOffering model = new DefenderCspmGcpOffering(); - model = BinaryData.fromObject(model).toObject(DefenderCspmGcpOffering.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfigurationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfigurationTests.java deleted file mode 100644 index 62f7fbd72b7a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfigurationTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration model = - BinaryData - .fromString("{\"proxy\":\"qbmfuvqarwz\",\"privateLinkScope\":\"qreblui\"}") - .toObject(DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration.class); - Assertions.assertEquals("qbmfuvqarwz", model.proxy()); - Assertions.assertEquals("qreblui", model.privateLinkScope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration model = - new DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration() - .withProxy("qbmfuvqarwz") - .withPrivateLinkScope("qreblui"); - model = - BinaryData.fromObject(model).toObject(DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration.class); - Assertions.assertEquals("qbmfuvqarwz", model.proxy()); - Assertions.assertEquals("qreblui", model.privateLinkScope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingArcAutoProvisioningTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingArcAutoProvisioningTests.java deleted file mode 100644 index 038e6c234ae7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingArcAutoProvisioningTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingArcAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DefenderFoDatabasesAwsOfferingArcAutoProvisioningTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderFoDatabasesAwsOfferingArcAutoProvisioning model = - BinaryData - .fromString( - "{\"enabled\":true,\"cloudRoleArn\":\"kt\",\"configuration\":{\"proxy\":\"jwzzoslpk\",\"privateLinkScope\":\"tglwkzpgajsqjc\"}}") - .toObject(DefenderFoDatabasesAwsOfferingArcAutoProvisioning.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("kt", model.cloudRoleArn()); - Assertions.assertEquals("jwzzoslpk", model.configuration().proxy()); - Assertions.assertEquals("tglwkzpgajsqjc", model.configuration().privateLinkScope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderFoDatabasesAwsOfferingArcAutoProvisioning model = - new DefenderFoDatabasesAwsOfferingArcAutoProvisioning() - .withEnabled(true) - .withCloudRoleArn("kt") - .withConfiguration( - new DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration() - .withProxy("jwzzoslpk") - .withPrivateLinkScope("tglwkzpgajsqjc")); - model = BinaryData.fromObject(model).toObject(DefenderFoDatabasesAwsOfferingArcAutoProvisioning.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("kt", model.cloudRoleArn()); - Assertions.assertEquals("jwzzoslpk", model.configuration().proxy()); - Assertions.assertEquals("tglwkzpgajsqjc", model.configuration().privateLinkScope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingDatabasesDspmTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingDatabasesDspmTests.java deleted file mode 100644 index 73dd794694c0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingDatabasesDspmTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingDatabasesDspm; -import org.junit.jupiter.api.Assertions; - -public final class DefenderFoDatabasesAwsOfferingDatabasesDspmTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderFoDatabasesAwsOfferingDatabasesDspm model = - BinaryData - .fromString("{\"enabled\":false,\"cloudRoleArn\":\"kbudbtwaokb\"}") - .toObject(DefenderFoDatabasesAwsOfferingDatabasesDspm.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("kbudbtwaokb", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderFoDatabasesAwsOfferingDatabasesDspm model = - new DefenderFoDatabasesAwsOfferingDatabasesDspm().withEnabled(false).withCloudRoleArn("kbudbtwaokb"); - model = BinaryData.fromObject(model).toObject(DefenderFoDatabasesAwsOfferingDatabasesDspm.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("kbudbtwaokb", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingRdsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingRdsTests.java deleted file mode 100644 index 7b4235a71a2b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingRdsTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingRds; -import org.junit.jupiter.api.Assertions; - -public final class DefenderFoDatabasesAwsOfferingRdsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderFoDatabasesAwsOfferingRds model = - BinaryData - .fromString("{\"enabled\":true,\"cloudRoleArn\":\"xsfgtdmbvxekr\"}") - .toObject(DefenderFoDatabasesAwsOfferingRds.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("xsfgtdmbvxekr", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderFoDatabasesAwsOfferingRds model = - new DefenderFoDatabasesAwsOfferingRds().withEnabled(true).withCloudRoleArn("xsfgtdmbvxekr"); - model = BinaryData.fromObject(model).toObject(DefenderFoDatabasesAwsOfferingRds.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("xsfgtdmbvxekr", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingTests.java deleted file mode 100644 index aacdd14349c8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOffering; -import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingArcAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration; -import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingDatabasesDspm; -import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingRds; -import org.junit.jupiter.api.Assertions; - -public final class DefenderFoDatabasesAwsOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderFoDatabasesAwsOffering model = - BinaryData - .fromString( - "{\"offeringType\":\"DefenderForDatabasesAws\",\"arcAutoProvisioning\":{\"enabled\":true,\"cloudRoleArn\":\"mbqdabzfivfo\",\"configuration\":{\"proxy\":\"sthhzagjfwy\",\"privateLinkScope\":\"lhgenuzejgvkv\"}},\"rds\":{\"enabled\":false,\"cloudRoleArn\":\"zllrz\"},\"databasesDspm\":{\"enabled\":true,\"cloudRoleArn\":\"qgmihzpimcqrhnxt\"},\"description\":\"nklogxsvtzarhzv\"}") - .toObject(DefenderFoDatabasesAwsOffering.class); - Assertions.assertEquals(true, model.arcAutoProvisioning().enabled()); - Assertions.assertEquals("mbqdabzfivfo", model.arcAutoProvisioning().cloudRoleArn()); - Assertions.assertEquals("sthhzagjfwy", model.arcAutoProvisioning().configuration().proxy()); - Assertions.assertEquals("lhgenuzejgvkv", model.arcAutoProvisioning().configuration().privateLinkScope()); - Assertions.assertEquals(false, model.rds().enabled()); - Assertions.assertEquals("zllrz", model.rds().cloudRoleArn()); - Assertions.assertEquals(true, model.databasesDspm().enabled()); - Assertions.assertEquals("qgmihzpimcqrhnxt", model.databasesDspm().cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderFoDatabasesAwsOffering model = - new DefenderFoDatabasesAwsOffering() - .withArcAutoProvisioning( - new DefenderFoDatabasesAwsOfferingArcAutoProvisioning() - .withEnabled(true) - .withCloudRoleArn("mbqdabzfivfo") - .withConfiguration( - new DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration() - .withProxy("sthhzagjfwy") - .withPrivateLinkScope("lhgenuzejgvkv"))) - .withRds(new DefenderFoDatabasesAwsOfferingRds().withEnabled(false).withCloudRoleArn("zllrz")) - .withDatabasesDspm( - new DefenderFoDatabasesAwsOfferingDatabasesDspm() - .withEnabled(true) - .withCloudRoleArn("qgmihzpimcqrhnxt")); - model = BinaryData.fromObject(model).toObject(DefenderFoDatabasesAwsOffering.class); - Assertions.assertEquals(true, model.arcAutoProvisioning().enabled()); - Assertions.assertEquals("mbqdabzfivfo", model.arcAutoProvisioning().cloudRoleArn()); - Assertions.assertEquals("sthhzagjfwy", model.arcAutoProvisioning().configuration().proxy()); - Assertions.assertEquals("lhgenuzejgvkv", model.arcAutoProvisioning().configuration().privateLinkScope()); - Assertions.assertEquals(false, model.rds().enabled()); - Assertions.assertEquals("zllrz", model.rds().cloudRoleArn()); - Assertions.assertEquals(true, model.databasesDspm().enabled()); - Assertions.assertEquals("qgmihzpimcqrhnxt", model.databasesDspm().cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingCloudWatchToKinesisTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingCloudWatchToKinesisTests.java deleted file mode 100644 index d876386ab209..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingCloudWatchToKinesisTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingCloudWatchToKinesis; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForContainersAwsOfferingCloudWatchToKinesisTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForContainersAwsOfferingCloudWatchToKinesis model = - BinaryData - .fromString("{\"cloudRoleArn\":\"zuodacpun\"}") - .toObject(DefenderForContainersAwsOfferingCloudWatchToKinesis.class); - Assertions.assertEquals("zuodacpun", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForContainersAwsOfferingCloudWatchToKinesis model = - new DefenderForContainersAwsOfferingCloudWatchToKinesis().withCloudRoleArn("zuodacpun"); - model = BinaryData.fromObject(model).toObject(DefenderForContainersAwsOfferingCloudWatchToKinesis.class); - Assertions.assertEquals("zuodacpun", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTaskTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTaskTests.java deleted file mode 100644 index cc6b0ec2a746..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTaskTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTaskTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask model = - BinaryData - .fromString("{\"cloudRoleArn\":\"lpckaewsedves\"}") - .toObject(DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask.class); - Assertions.assertEquals("lpckaewsedves", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask model = - new DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask() - .withCloudRoleArn("lpckaewsedves"); - model = - BinaryData - .fromObject(model) - .toObject(DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask.class); - Assertions.assertEquals("lpckaewsedves", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTests.java deleted file mode 100644 index 1b83dea1aa12..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingContainerVulnerabilityAssessment; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForContainersAwsOfferingContainerVulnerabilityAssessment model = - BinaryData - .fromString("{\"cloudRoleArn\":\"ynu\"}") - .toObject(DefenderForContainersAwsOfferingContainerVulnerabilityAssessment.class); - Assertions.assertEquals("ynu", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForContainersAwsOfferingContainerVulnerabilityAssessment model = - new DefenderForContainersAwsOfferingContainerVulnerabilityAssessment().withCloudRoleArn("ynu"); - model = - BinaryData - .fromObject(model) - .toObject(DefenderForContainersAwsOfferingContainerVulnerabilityAssessment.class); - Assertions.assertEquals("ynu", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKinesisToS3Tests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKinesisToS3Tests.java deleted file mode 100644 index 87796576427d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKinesisToS3Tests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingKinesisToS3; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForContainersAwsOfferingKinesisToS3Tests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForContainersAwsOfferingKinesisToS3 model = - BinaryData - .fromString("{\"cloudRoleArn\":\"tepdjxqes\"}") - .toObject(DefenderForContainersAwsOfferingKinesisToS3.class); - Assertions.assertEquals("tepdjxqes", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForContainersAwsOfferingKinesisToS3 model = - new DefenderForContainersAwsOfferingKinesisToS3().withCloudRoleArn("tepdjxqes"); - model = BinaryData.fromObject(model).toObject(DefenderForContainersAwsOfferingKinesisToS3.class); - Assertions.assertEquals("tepdjxqes", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKubernetesScubaReaderTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKubernetesScubaReaderTests.java deleted file mode 100644 index 167d0150f9a5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKubernetesScubaReaderTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingKubernetesScubaReader; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForContainersAwsOfferingKubernetesScubaReaderTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForContainersAwsOfferingKubernetesScubaReader model = - BinaryData - .fromString("{\"cloudRoleArn\":\"gxvrpjl\"}") - .toObject(DefenderForContainersAwsOfferingKubernetesScubaReader.class); - Assertions.assertEquals("gxvrpjl", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForContainersAwsOfferingKubernetesScubaReader model = - new DefenderForContainersAwsOfferingKubernetesScubaReader().withCloudRoleArn("gxvrpjl"); - model = BinaryData.fromObject(model).toObject(DefenderForContainersAwsOfferingKubernetesScubaReader.class); - Assertions.assertEquals("gxvrpjl", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKubernetesServiceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKubernetesServiceTests.java deleted file mode 100644 index b499ff38d9a0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKubernetesServiceTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingKubernetesService; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForContainersAwsOfferingKubernetesServiceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForContainersAwsOfferingKubernetesService model = - BinaryData - .fromString("{\"cloudRoleArn\":\"cly\"}") - .toObject(DefenderForContainersAwsOfferingKubernetesService.class); - Assertions.assertEquals("cly", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForContainersAwsOfferingKubernetesService model = - new DefenderForContainersAwsOfferingKubernetesService().withCloudRoleArn("cly"); - model = BinaryData.fromObject(model).toObject(DefenderForContainersAwsOfferingKubernetesService.class); - Assertions.assertEquals("cly", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingTests.java deleted file mode 100644 index abf62d2ec1d7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOffering; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingCloudWatchToKinesis; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingContainerVulnerabilityAssessment; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingKinesisToS3; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingKubernetesScubaReader; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingKubernetesService; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForContainersAwsOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForContainersAwsOffering model = - BinaryData - .fromString( - "{\"offeringType\":\"DefenderForContainersAws\",\"kubernetesService\":{\"cloudRoleArn\":\"tkbtnqlrngl\"},\"kubernetesScubaReader\":{\"cloudRoleArn\":\"iipsnawwlqkz\"},\"cloudWatchToKinesis\":{\"cloudRoleArn\":\"hllxricctkw\"},\"kinesisToS3\":{\"cloudRoleArn\":\"qoajxeiyglesrwva\"},\"containerVulnerabilityAssessment\":{\"cloudRoleArn\":\"dctrceqnkbrupobe\"},\"containerVulnerabilityAssessmentTask\":{\"cloudRoleArn\":\"lj\"},\"enableContainerVulnerabilityAssessment\":true,\"autoProvisioning\":true,\"kubeAuditRetentionTime\":2313519110456203073,\"scubaExternalId\":\"pbibn\",\"description\":\"phepifexleqirc\"}") - .toObject(DefenderForContainersAwsOffering.class); - Assertions.assertEquals("tkbtnqlrngl", model.kubernetesService().cloudRoleArn()); - Assertions.assertEquals("iipsnawwlqkz", model.kubernetesScubaReader().cloudRoleArn()); - Assertions.assertEquals("hllxricctkw", model.cloudWatchToKinesis().cloudRoleArn()); - Assertions.assertEquals("qoajxeiyglesrwva", model.kinesisToS3().cloudRoleArn()); - Assertions.assertEquals("dctrceqnkbrupobe", model.containerVulnerabilityAssessment().cloudRoleArn()); - Assertions.assertEquals("lj", model.containerVulnerabilityAssessmentTask().cloudRoleArn()); - Assertions.assertEquals(true, model.enableContainerVulnerabilityAssessment()); - Assertions.assertEquals(true, model.autoProvisioning()); - Assertions.assertEquals(2313519110456203073L, model.kubeAuditRetentionTime()); - Assertions.assertEquals("pbibn", model.scubaExternalId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForContainersAwsOffering model = - new DefenderForContainersAwsOffering() - .withKubernetesService( - new DefenderForContainersAwsOfferingKubernetesService().withCloudRoleArn("tkbtnqlrngl")) - .withKubernetesScubaReader( - new DefenderForContainersAwsOfferingKubernetesScubaReader().withCloudRoleArn("iipsnawwlqkz")) - .withCloudWatchToKinesis( - new DefenderForContainersAwsOfferingCloudWatchToKinesis().withCloudRoleArn("hllxricctkw")) - .withKinesisToS3(new DefenderForContainersAwsOfferingKinesisToS3().withCloudRoleArn("qoajxeiyglesrwva")) - .withContainerVulnerabilityAssessment( - new DefenderForContainersAwsOfferingContainerVulnerabilityAssessment() - .withCloudRoleArn("dctrceqnkbrupobe")) - .withContainerVulnerabilityAssessmentTask( - new DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask().withCloudRoleArn("lj")) - .withEnableContainerVulnerabilityAssessment(true) - .withAutoProvisioning(true) - .withKubeAuditRetentionTime(2313519110456203073L) - .withScubaExternalId("pbibn"); - model = BinaryData.fromObject(model).toObject(DefenderForContainersAwsOffering.class); - Assertions.assertEquals("tkbtnqlrngl", model.kubernetesService().cloudRoleArn()); - Assertions.assertEquals("iipsnawwlqkz", model.kubernetesScubaReader().cloudRoleArn()); - Assertions.assertEquals("hllxricctkw", model.cloudWatchToKinesis().cloudRoleArn()); - Assertions.assertEquals("qoajxeiyglesrwva", model.kinesisToS3().cloudRoleArn()); - Assertions.assertEquals("dctrceqnkbrupobe", model.containerVulnerabilityAssessment().cloudRoleArn()); - Assertions.assertEquals("lj", model.containerVulnerabilityAssessmentTask().cloudRoleArn()); - Assertions.assertEquals(true, model.enableContainerVulnerabilityAssessment()); - Assertions.assertEquals(true, model.autoProvisioning()); - Assertions.assertEquals(2313519110456203073L, model.kubeAuditRetentionTime()); - Assertions.assertEquals("pbibn", model.scubaExternalId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnectionTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnectionTests.java deleted file mode 100644 index 73efe1466c4e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnectionTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForContainersGcpOfferingDataPipelineNativeCloudConnectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection model = - BinaryData - .fromString( - "{\"serviceAccountEmailAddress\":\"iklhsyekrdrenx\",\"workloadIdentityProviderId\":\"riyehqbeivdlhy\"}") - .toObject(DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.class); - Assertions.assertEquals("iklhsyekrdrenx", model.serviceAccountEmailAddress()); - Assertions.assertEquals("riyehqbeivdlhy", model.workloadIdentityProviderId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection model = - new DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection() - .withServiceAccountEmailAddress("iklhsyekrdrenx") - .withWorkloadIdentityProviderId("riyehqbeivdlhy"); - model = - BinaryData - .fromObject(model) - .toObject(DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.class); - Assertions.assertEquals("iklhsyekrdrenx", model.serviceAccountEmailAddress()); - Assertions.assertEquals("riyehqbeivdlhy", model.workloadIdentityProviderId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingNativeCloudConnectionTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingNativeCloudConnectionTests.java deleted file mode 100644 index 5e5cd5096c94..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingNativeCloudConnectionTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForContainersGcpOfferingNativeCloudConnection; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForContainersGcpOfferingNativeCloudConnectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForContainersGcpOfferingNativeCloudConnection model = - BinaryData - .fromString( - "{\"serviceAccountEmailAddress\":\"jgazl\",\"workloadIdentityProviderId\":\"bzfcpuoeedwj\"}") - .toObject(DefenderForContainersGcpOfferingNativeCloudConnection.class); - Assertions.assertEquals("jgazl", model.serviceAccountEmailAddress()); - Assertions.assertEquals("bzfcpuoeedwj", model.workloadIdentityProviderId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForContainersGcpOfferingNativeCloudConnection model = - new DefenderForContainersGcpOfferingNativeCloudConnection() - .withServiceAccountEmailAddress("jgazl") - .withWorkloadIdentityProviderId("bzfcpuoeedwj"); - model = BinaryData.fromObject(model).toObject(DefenderForContainersGcpOfferingNativeCloudConnection.class); - Assertions.assertEquals("jgazl", model.serviceAccountEmailAddress()); - Assertions.assertEquals("bzfcpuoeedwj", model.workloadIdentityProviderId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingTests.java deleted file mode 100644 index 10c38f178313..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForContainersGcpOffering; -import com.azure.resourcemanager.security.models.DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection; -import com.azure.resourcemanager.security.models.DefenderForContainersGcpOfferingNativeCloudConnection; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForContainersGcpOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForContainersGcpOffering model = - BinaryData - .fromString( - "{\"offeringType\":\"DefenderForContainersGcp\",\"nativeCloudConnection\":{\"serviceAccountEmailAddress\":\"anfbc\",\"workloadIdentityProviderId\":\"qagywvtxig\"},\"dataPipelineNativeCloudConnection\":{\"serviceAccountEmailAddress\":\"ktpgaeukyawohp\",\"workloadIdentityProviderId\":\"hqnucs\"},\"auditLogsAutoProvisioningFlag\":true,\"defenderAgentAutoProvisioningFlag\":false,\"policyAgentAutoProvisioningFlag\":false,\"description\":\"tdlpbn\"}") - .toObject(DefenderForContainersGcpOffering.class); - Assertions.assertEquals("anfbc", model.nativeCloudConnection().serviceAccountEmailAddress()); - Assertions.assertEquals("qagywvtxig", model.nativeCloudConnection().workloadIdentityProviderId()); - Assertions - .assertEquals("ktpgaeukyawohp", model.dataPipelineNativeCloudConnection().serviceAccountEmailAddress()); - Assertions.assertEquals("hqnucs", model.dataPipelineNativeCloudConnection().workloadIdentityProviderId()); - Assertions.assertEquals(true, model.auditLogsAutoProvisioningFlag()); - Assertions.assertEquals(false, model.defenderAgentAutoProvisioningFlag()); - Assertions.assertEquals(false, model.policyAgentAutoProvisioningFlag()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForContainersGcpOffering model = - new DefenderForContainersGcpOffering() - .withNativeCloudConnection( - new DefenderForContainersGcpOfferingNativeCloudConnection() - .withServiceAccountEmailAddress("anfbc") - .withWorkloadIdentityProviderId("qagywvtxig")) - .withDataPipelineNativeCloudConnection( - new DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection() - .withServiceAccountEmailAddress("ktpgaeukyawohp") - .withWorkloadIdentityProviderId("hqnucs")) - .withAuditLogsAutoProvisioningFlag(true) - .withDefenderAgentAutoProvisioningFlag(false) - .withPolicyAgentAutoProvisioningFlag(false); - model = BinaryData.fromObject(model).toObject(DefenderForContainersGcpOffering.class); - Assertions.assertEquals("anfbc", model.nativeCloudConnection().serviceAccountEmailAddress()); - Assertions.assertEquals("qagywvtxig", model.nativeCloudConnection().workloadIdentityProviderId()); - Assertions - .assertEquals("ktpgaeukyawohp", model.dataPipelineNativeCloudConnection().serviceAccountEmailAddress()); - Assertions.assertEquals("hqnucs", model.dataPipelineNativeCloudConnection().workloadIdentityProviderId()); - Assertions.assertEquals(true, model.auditLogsAutoProvisioningFlag()); - Assertions.assertEquals(false, model.defenderAgentAutoProvisioningFlag()); - Assertions.assertEquals(false, model.policyAgentAutoProvisioningFlag()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingArcAutoProvisioningConfigurationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingArcAutoProvisioningConfigurationTests.java deleted file mode 100644 index 517b09fad11b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingArcAutoProvisioningConfigurationTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForDatabasesGcpOfferingArcAutoProvisioningConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration model = - BinaryData - .fromString("{\"proxy\":\"ecleqioulndhzyo\",\"privateLinkScope\":\"jhtollh\"}") - .toObject(DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration.class); - Assertions.assertEquals("ecleqioulndhzyo", model.proxy()); - Assertions.assertEquals("jhtollh", model.privateLinkScope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration model = - new DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration() - .withProxy("ecleqioulndhzyo") - .withPrivateLinkScope("jhtollh"); - model = - BinaryData - .fromObject(model) - .toObject(DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration.class); - Assertions.assertEquals("ecleqioulndhzyo", model.proxy()); - Assertions.assertEquals("jhtollh", model.privateLinkScope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingArcAutoProvisioningTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingArcAutoProvisioningTests.java deleted file mode 100644 index 2d4fc50f362b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingArcAutoProvisioningTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForDatabasesGcpOfferingArcAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForDatabasesGcpOfferingArcAutoProvisioningTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForDatabasesGcpOfferingArcAutoProvisioning model = - BinaryData - .fromString( - "{\"enabled\":false,\"configuration\":{\"proxy\":\"ztv\",\"privateLinkScope\":\"mwwmjswenaww\"}}") - .toObject(DefenderForDatabasesGcpOfferingArcAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("ztv", model.configuration().proxy()); - Assertions.assertEquals("mwwmjswenaww", model.configuration().privateLinkScope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForDatabasesGcpOfferingArcAutoProvisioning model = - new DefenderForDatabasesGcpOfferingArcAutoProvisioning() - .withEnabled(false) - .withConfiguration( - new DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration() - .withProxy("ztv") - .withPrivateLinkScope("mwwmjswenaww")); - model = BinaryData.fromObject(model).toObject(DefenderForDatabasesGcpOfferingArcAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("ztv", model.configuration().proxy()); - Assertions.assertEquals("mwwmjswenaww", model.configuration().privateLinkScope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioningTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioningTests.java deleted file mode 100644 index a6153764e374..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioningTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioningTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning model = - BinaryData - .fromString("{\"serviceAccountEmailAddress\":\"idmytzln\",\"workloadIdentityProviderId\":\"xpno\"}") - .toObject(DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning.class); - Assertions.assertEquals("idmytzln", model.serviceAccountEmailAddress()); - Assertions.assertEquals("xpno", model.workloadIdentityProviderId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning model = - new DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning() - .withServiceAccountEmailAddress("idmytzln") - .withWorkloadIdentityProviderId("xpno"); - model = - BinaryData - .fromObject(model) - .toObject(DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning.class); - Assertions.assertEquals("idmytzln", model.serviceAccountEmailAddress()); - Assertions.assertEquals("xpno", model.workloadIdentityProviderId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingTests.java deleted file mode 100644 index 5f7b8fcfbce6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForDatabasesGcpOffering; -import com.azure.resourcemanager.security.models.DefenderForDatabasesGcpOfferingArcAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration; -import com.azure.resourcemanager.security.models.DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForDatabasesGcpOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForDatabasesGcpOffering model = - BinaryData - .fromString( - "{\"offeringType\":\"DefenderForDatabasesGcp\",\"arcAutoProvisioning\":{\"enabled\":true,\"configuration\":{\"proxy\":\"fv\",\"privateLinkScope\":\"vqkxiuxqggvq\"}},\"defenderForDatabasesArcAutoProvisioning\":{\"serviceAccountEmailAddress\":\"yhlwcjsqg\",\"workloadIdentityProviderId\":\"hffbxrq\"},\"description\":\"ijpeuql\"}") - .toObject(DefenderForDatabasesGcpOffering.class); - Assertions.assertEquals(true, model.arcAutoProvisioning().enabled()); - Assertions.assertEquals("fv", model.arcAutoProvisioning().configuration().proxy()); - Assertions.assertEquals("vqkxiuxqggvq", model.arcAutoProvisioning().configuration().privateLinkScope()); - Assertions - .assertEquals("yhlwcjsqg", model.defenderForDatabasesArcAutoProvisioning().serviceAccountEmailAddress()); - Assertions - .assertEquals("hffbxrq", model.defenderForDatabasesArcAutoProvisioning().workloadIdentityProviderId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForDatabasesGcpOffering model = - new DefenderForDatabasesGcpOffering() - .withArcAutoProvisioning( - new DefenderForDatabasesGcpOfferingArcAutoProvisioning() - .withEnabled(true) - .withConfiguration( - new DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration() - .withProxy("fv") - .withPrivateLinkScope("vqkxiuxqggvq"))) - .withDefenderForDatabasesArcAutoProvisioning( - new DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning() - .withServiceAccountEmailAddress("yhlwcjsqg") - .withWorkloadIdentityProviderId("hffbxrq")); - model = BinaryData.fromObject(model).toObject(DefenderForDatabasesGcpOffering.class); - Assertions.assertEquals(true, model.arcAutoProvisioning().enabled()); - Assertions.assertEquals("fv", model.arcAutoProvisioning().configuration().proxy()); - Assertions.assertEquals("vqkxiuxqggvq", model.arcAutoProvisioning().configuration().privateLinkScope()); - Assertions - .assertEquals("yhlwcjsqg", model.defenderForDatabasesArcAutoProvisioning().serviceAccountEmailAddress()); - Assertions - .assertEquals("hffbxrq", model.defenderForDatabasesArcAutoProvisioning().workloadIdentityProviderId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsAzureDevOpsOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsAzureDevOpsOfferingTests.java deleted file mode 100644 index c41f2a47b23b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsAzureDevOpsOfferingTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForDevOpsAzureDevOpsOffering; - -public final class DefenderForDevOpsAzureDevOpsOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForDevOpsAzureDevOpsOffering model = - BinaryData - .fromString("{\"offeringType\":\"DefenderForDevOpsAzureDevOps\",\"description\":\"rb\"}") - .toObject(DefenderForDevOpsAzureDevOpsOffering.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForDevOpsAzureDevOpsOffering model = new DefenderForDevOpsAzureDevOpsOffering(); - model = BinaryData.fromObject(model).toObject(DefenderForDevOpsAzureDevOpsOffering.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsGitLabOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsGitLabOfferingTests.java deleted file mode 100644 index 8452e440f36e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsGitLabOfferingTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForDevOpsGitLabOffering; - -public final class DefenderForDevOpsGitLabOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForDevOpsGitLabOffering model = - BinaryData - .fromString("{\"offeringType\":\"DefenderForDevOpsGitLab\",\"description\":\"pp\"}") - .toObject(DefenderForDevOpsGitLabOffering.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForDevOpsGitLabOffering model = new DefenderForDevOpsGitLabOffering(); - model = BinaryData.fromObject(model).toObject(DefenderForDevOpsGitLabOffering.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsGithubOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsGithubOfferingTests.java deleted file mode 100644 index 3ff70d8d6e6b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsGithubOfferingTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForDevOpsGithubOffering; - -public final class DefenderForDevOpsGithubOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForDevOpsGithubOffering model = - BinaryData - .fromString("{\"offeringType\":\"DefenderForDevOpsGithub\",\"description\":\"zuvrzmzqmz\"}") - .toObject(DefenderForDevOpsGithubOffering.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForDevOpsGithubOffering model = new DefenderForDevOpsGithubOffering(); - model = BinaryData.fromObject(model).toObject(DefenderForDevOpsGithubOffering.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingArcAutoProvisioningConfigurationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingArcAutoProvisioningConfigurationTests.java deleted file mode 100644 index d934b0e7aff0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingArcAutoProvisioningConfigurationTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingArcAutoProvisioningConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersAwsOfferingArcAutoProvisioningConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersAwsOfferingArcAutoProvisioningConfiguration model = - BinaryData - .fromString("{\"proxy\":\"loozrvt\",\"privateLinkScope\":\"cmufunlcpxxv\"}") - .toObject(DefenderForServersAwsOfferingArcAutoProvisioningConfiguration.class); - Assertions.assertEquals("loozrvt", model.proxy()); - Assertions.assertEquals("cmufunlcpxxv", model.privateLinkScope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersAwsOfferingArcAutoProvisioningConfiguration model = - new DefenderForServersAwsOfferingArcAutoProvisioningConfiguration() - .withProxy("loozrvt") - .withPrivateLinkScope("cmufunlcpxxv"); - model = - BinaryData.fromObject(model).toObject(DefenderForServersAwsOfferingArcAutoProvisioningConfiguration.class); - Assertions.assertEquals("loozrvt", model.proxy()); - Assertions.assertEquals("cmufunlcpxxv", model.privateLinkScope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingArcAutoProvisioningTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingArcAutoProvisioningTests.java deleted file mode 100644 index 47bc889f42d5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingArcAutoProvisioningTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingArcAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingArcAutoProvisioningConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersAwsOfferingArcAutoProvisioningTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersAwsOfferingArcAutoProvisioning model = - BinaryData - .fromString( - "{\"enabled\":true,\"cloudRoleArn\":\"cmkrftsjcwjj\",\"configuration\":{\"proxy\":\"mb\",\"privateLinkScope\":\"vifdxkecifhocjx\"}}") - .toObject(DefenderForServersAwsOfferingArcAutoProvisioning.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("cmkrftsjcwjj", model.cloudRoleArn()); - Assertions.assertEquals("mb", model.configuration().proxy()); - Assertions.assertEquals("vifdxkecifhocjx", model.configuration().privateLinkScope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersAwsOfferingArcAutoProvisioning model = - new DefenderForServersAwsOfferingArcAutoProvisioning() - .withEnabled(true) - .withCloudRoleArn("cmkrftsjcwjj") - .withConfiguration( - new DefenderForServersAwsOfferingArcAutoProvisioningConfiguration() - .withProxy("mb") - .withPrivateLinkScope("vifdxkecifhocjx")); - model = BinaryData.fromObject(model).toObject(DefenderForServersAwsOfferingArcAutoProvisioning.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("cmkrftsjcwjj", model.cloudRoleArn()); - Assertions.assertEquals("mb", model.configuration().proxy()); - Assertions.assertEquals("vifdxkecifhocjx", model.configuration().privateLinkScope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingDefenderForServersTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingDefenderForServersTests.java deleted file mode 100644 index a2c683a44bf4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingDefenderForServersTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingDefenderForServers; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersAwsOfferingDefenderForServersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersAwsOfferingDefenderForServers model = - BinaryData - .fromString("{\"cloudRoleArn\":\"bcyksivmfogd\"}") - .toObject(DefenderForServersAwsOfferingDefenderForServers.class); - Assertions.assertEquals("bcyksivmfogd", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersAwsOfferingDefenderForServers model = - new DefenderForServersAwsOfferingDefenderForServers().withCloudRoleArn("bcyksivmfogd"); - model = BinaryData.fromObject(model).toObject(DefenderForServersAwsOfferingDefenderForServers.class); - Assertions.assertEquals("bcyksivmfogd", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingMdeAutoProvisioningTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingMdeAutoProvisioningTests.java deleted file mode 100644 index fdb7380ae412..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingMdeAutoProvisioningTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingMdeAutoProvisioning; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersAwsOfferingMdeAutoProvisioningTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersAwsOfferingMdeAutoProvisioning model = - BinaryData - .fromString("{\"enabled\":false,\"configuration\":\"dataquv\"}") - .toObject(DefenderForServersAwsOfferingMdeAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersAwsOfferingMdeAutoProvisioning model = - new DefenderForServersAwsOfferingMdeAutoProvisioning().withEnabled(false).withConfiguration("dataquv"); - model = BinaryData.fromObject(model).toObject(DefenderForServersAwsOfferingMdeAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingSubPlanTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingSubPlanTests.java deleted file mode 100644 index 5e77a7807241..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingSubPlanTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingSubPlan; -import com.azure.resourcemanager.security.models.SubPlan; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersAwsOfferingSubPlanTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersAwsOfferingSubPlan model = - BinaryData.fromString("{\"type\":\"P2\"}").toObject(DefenderForServersAwsOfferingSubPlan.class); - Assertions.assertEquals(SubPlan.P2, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersAwsOfferingSubPlan model = new DefenderForServersAwsOfferingSubPlan().withType(SubPlan.P2); - model = BinaryData.fromObject(model).toObject(DefenderForServersAwsOfferingSubPlan.class); - Assertions.assertEquals(SubPlan.P2, model.type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingTests.java deleted file mode 100644 index 462e3ef6422d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingTests.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOffering; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingArcAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingArcAutoProvisioningConfiguration; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingDefenderForServers; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingMdeAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingSubPlan; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVaAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVaAutoProvisioningConfiguration; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVmScanners; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVmScannersConfiguration; -import com.azure.resourcemanager.security.models.ScanningMode; -import com.azure.resourcemanager.security.models.SubPlan; -import com.azure.resourcemanager.security.models.Type; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersAwsOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersAwsOffering model = - BinaryData - .fromString( - "{\"offeringType\":\"DefenderForServersAws\",\"defenderForServers\":{\"cloudRoleArn\":\"egqphrgfnzhctm\"},\"arcAutoProvisioning\":{\"enabled\":true,\"cloudRoleArn\":\"pbcbcpzar\",\"configuration\":{\"proxy\":\"qacdldtzm\",\"privateLinkScope\":\"pefcpcz\"}},\"vaAutoProvisioning\":{\"enabled\":true,\"configuration\":{\"type\":\"Qualys\"}},\"mdeAutoProvisioning\":{\"enabled\":true,\"configuration\":\"datapfkhuytuszxhmt\"},\"subPlan\":{\"type\":\"P1\"},\"vmScanners\":{\"enabled\":true,\"configuration\":{\"cloudRoleArn\":\"kvzwydw\",\"scanningMode\":\"Default\",\"exclusionTags\":{\"fukpeexpgeu\":\"kgkskjivbsshaj\",\"hwu\":\"i\",\"dbzsx\":\"trdexyionofnin\"}}},\"description\":\"qqrsmpcbbprtugav\"}") - .toObject(DefenderForServersAwsOffering.class); - Assertions.assertEquals("egqphrgfnzhctm", model.defenderForServers().cloudRoleArn()); - Assertions.assertEquals(true, model.arcAutoProvisioning().enabled()); - Assertions.assertEquals("pbcbcpzar", model.arcAutoProvisioning().cloudRoleArn()); - Assertions.assertEquals("qacdldtzm", model.arcAutoProvisioning().configuration().proxy()); - Assertions.assertEquals("pefcpcz", model.arcAutoProvisioning().configuration().privateLinkScope()); - Assertions.assertEquals(true, model.vaAutoProvisioning().enabled()); - Assertions.assertEquals(Type.QUALYS, model.vaAutoProvisioning().configuration().type()); - Assertions.assertEquals(true, model.mdeAutoProvisioning().enabled()); - Assertions.assertEquals(SubPlan.P1, model.subPlan().type()); - Assertions.assertEquals(true, model.vmScanners().enabled()); - Assertions.assertEquals("kvzwydw", model.vmScanners().configuration().cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.vmScanners().configuration().scanningMode()); - Assertions - .assertEquals("kgkskjivbsshaj", model.vmScanners().configuration().exclusionTags().get("fukpeexpgeu")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersAwsOffering model = - new DefenderForServersAwsOffering() - .withDefenderForServers( - new DefenderForServersAwsOfferingDefenderForServers().withCloudRoleArn("egqphrgfnzhctm")) - .withArcAutoProvisioning( - new DefenderForServersAwsOfferingArcAutoProvisioning() - .withEnabled(true) - .withCloudRoleArn("pbcbcpzar") - .withConfiguration( - new DefenderForServersAwsOfferingArcAutoProvisioningConfiguration() - .withProxy("qacdldtzm") - .withPrivateLinkScope("pefcpcz"))) - .withVaAutoProvisioning( - new DefenderForServersAwsOfferingVaAutoProvisioning() - .withEnabled(true) - .withConfiguration( - new DefenderForServersAwsOfferingVaAutoProvisioningConfiguration().withType(Type.QUALYS))) - .withMdeAutoProvisioning( - new DefenderForServersAwsOfferingMdeAutoProvisioning() - .withEnabled(true) - .withConfiguration("datapfkhuytuszxhmt")) - .withSubPlan(new DefenderForServersAwsOfferingSubPlan().withType(SubPlan.P1)) - .withVmScanners( - new DefenderForServersAwsOfferingVmScanners() - .withEnabled(true) - .withConfiguration( - new DefenderForServersAwsOfferingVmScannersConfiguration() - .withCloudRoleArn("kvzwydw") - .withScanningMode(ScanningMode.DEFAULT) - .withExclusionTags( - mapOf("fukpeexpgeu", "kgkskjivbsshaj", "hwu", "i", "dbzsx", "trdexyionofnin")))); - model = BinaryData.fromObject(model).toObject(DefenderForServersAwsOffering.class); - Assertions.assertEquals("egqphrgfnzhctm", model.defenderForServers().cloudRoleArn()); - Assertions.assertEquals(true, model.arcAutoProvisioning().enabled()); - Assertions.assertEquals("pbcbcpzar", model.arcAutoProvisioning().cloudRoleArn()); - Assertions.assertEquals("qacdldtzm", model.arcAutoProvisioning().configuration().proxy()); - Assertions.assertEquals("pefcpcz", model.arcAutoProvisioning().configuration().privateLinkScope()); - Assertions.assertEquals(true, model.vaAutoProvisioning().enabled()); - Assertions.assertEquals(Type.QUALYS, model.vaAutoProvisioning().configuration().type()); - Assertions.assertEquals(true, model.mdeAutoProvisioning().enabled()); - Assertions.assertEquals(SubPlan.P1, model.subPlan().type()); - Assertions.assertEquals(true, model.vmScanners().enabled()); - Assertions.assertEquals("kvzwydw", model.vmScanners().configuration().cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.vmScanners().configuration().scanningMode()); - Assertions - .assertEquals("kgkskjivbsshaj", model.vmScanners().configuration().exclusionTags().get("fukpeexpgeu")); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVaAutoProvisioningConfigurationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVaAutoProvisioningConfigurationTests.java deleted file mode 100644 index bf806864b8be..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVaAutoProvisioningConfigurationTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVaAutoProvisioningConfiguration; -import com.azure.resourcemanager.security.models.Type; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersAwsOfferingVaAutoProvisioningConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersAwsOfferingVaAutoProvisioningConfiguration model = - BinaryData - .fromString("{\"type\":\"TVM\"}") - .toObject(DefenderForServersAwsOfferingVaAutoProvisioningConfiguration.class); - Assertions.assertEquals(Type.TVM, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersAwsOfferingVaAutoProvisioningConfiguration model = - new DefenderForServersAwsOfferingVaAutoProvisioningConfiguration().withType(Type.TVM); - model = - BinaryData.fromObject(model).toObject(DefenderForServersAwsOfferingVaAutoProvisioningConfiguration.class); - Assertions.assertEquals(Type.TVM, model.type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVaAutoProvisioningTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVaAutoProvisioningTests.java deleted file mode 100644 index 25e6d925c65e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVaAutoProvisioningTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVaAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVaAutoProvisioningConfiguration; -import com.azure.resourcemanager.security.models.Type; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersAwsOfferingVaAutoProvisioningTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersAwsOfferingVaAutoProvisioning model = - BinaryData - .fromString("{\"enabled\":false,\"configuration\":{\"type\":\"TVM\"}}") - .toObject(DefenderForServersAwsOfferingVaAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals(Type.TVM, model.configuration().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersAwsOfferingVaAutoProvisioning model = - new DefenderForServersAwsOfferingVaAutoProvisioning() - .withEnabled(false) - .withConfiguration( - new DefenderForServersAwsOfferingVaAutoProvisioningConfiguration().withType(Type.TVM)); - model = BinaryData.fromObject(model).toObject(DefenderForServersAwsOfferingVaAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals(Type.TVM, model.configuration().type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVmScannersConfigurationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVmScannersConfigurationTests.java deleted file mode 100644 index faa1d1f67067..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVmScannersConfigurationTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVmScannersConfiguration; -import com.azure.resourcemanager.security.models.ScanningMode; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersAwsOfferingVmScannersConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersAwsOfferingVmScannersConfiguration model = - BinaryData - .fromString( - "{\"cloudRoleArn\":\"vjcteoedlrslsk\",\"scanningMode\":\"Default\",\"exclusionTags\":{\"xzfsnggytexvzilm\":\"jnzdpvocojhpcna\",\"kwwwnckn\":\"iv\",\"weucyrth\":\"zdajlskzptjxu\",\"hokamvfej\":\"qlehmcgcjeinu\"}}") - .toObject(DefenderForServersAwsOfferingVmScannersConfiguration.class); - Assertions.assertEquals("vjcteoedlrslsk", model.cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.scanningMode()); - Assertions.assertEquals("jnzdpvocojhpcna", model.exclusionTags().get("xzfsnggytexvzilm")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersAwsOfferingVmScannersConfiguration model = - new DefenderForServersAwsOfferingVmScannersConfiguration() - .withCloudRoleArn("vjcteoedlrslsk") - .withScanningMode(ScanningMode.DEFAULT) - .withExclusionTags( - mapOf( - "xzfsnggytexvzilm", - "jnzdpvocojhpcna", - "kwwwnckn", - "iv", - "weucyrth", - "zdajlskzptjxu", - "hokamvfej", - "qlehmcgcjeinu")); - model = BinaryData.fromObject(model).toObject(DefenderForServersAwsOfferingVmScannersConfiguration.class); - Assertions.assertEquals("vjcteoedlrslsk", model.cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.scanningMode()); - Assertions.assertEquals("jnzdpvocojhpcna", model.exclusionTags().get("xzfsnggytexvzilm")); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVmScannersTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVmScannersTests.java deleted file mode 100644 index 08809353e841..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVmScannersTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVmScanners; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVmScannersConfiguration; -import com.azure.resourcemanager.security.models.ScanningMode; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersAwsOfferingVmScannersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersAwsOfferingVmScanners model = - BinaryData - .fromString( - "{\"enabled\":false,\"configuration\":{\"cloudRoleArn\":\"crdcueljti\",\"scanningMode\":\"Default\",\"exclusionTags\":{\"yarvsxzqbglcjk\":\"q\",\"btl\":\"yspthzod\",\"kfmkmfdjxyxgbk\":\"jtgblios\"}}}") - .toObject(DefenderForServersAwsOfferingVmScanners.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("crdcueljti", model.configuration().cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.configuration().scanningMode()); - Assertions.assertEquals("q", model.configuration().exclusionTags().get("yarvsxzqbglcjk")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersAwsOfferingVmScanners model = - new DefenderForServersAwsOfferingVmScanners() - .withEnabled(false) - .withConfiguration( - new DefenderForServersAwsOfferingVmScannersConfiguration() - .withCloudRoleArn("crdcueljti") - .withScanningMode(ScanningMode.DEFAULT) - .withExclusionTags( - mapOf("yarvsxzqbglcjk", "q", "btl", "yspthzod", "kfmkmfdjxyxgbk", "jtgblios"))); - model = BinaryData.fromObject(model).toObject(DefenderForServersAwsOfferingVmScanners.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("crdcueljti", model.configuration().cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.configuration().scanningMode()); - Assertions.assertEquals("q", model.configuration().exclusionTags().get("yarvsxzqbglcjk")); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingArcAutoProvisioningConfigurationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingArcAutoProvisioningConfigurationTests.java deleted file mode 100644 index a207a915aac6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingArcAutoProvisioningConfigurationTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingArcAutoProvisioningConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersGcpOfferingArcAutoProvisioningConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersGcpOfferingArcAutoProvisioningConfiguration model = - BinaryData - .fromString("{\"proxy\":\"n\",\"privateLinkScope\":\"ali\"}") - .toObject(DefenderForServersGcpOfferingArcAutoProvisioningConfiguration.class); - Assertions.assertEquals("n", model.proxy()); - Assertions.assertEquals("ali", model.privateLinkScope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersGcpOfferingArcAutoProvisioningConfiguration model = - new DefenderForServersGcpOfferingArcAutoProvisioningConfiguration() - .withProxy("n") - .withPrivateLinkScope("ali"); - model = - BinaryData.fromObject(model).toObject(DefenderForServersGcpOfferingArcAutoProvisioningConfiguration.class); - Assertions.assertEquals("n", model.proxy()); - Assertions.assertEquals("ali", model.privateLinkScope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingArcAutoProvisioningTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingArcAutoProvisioningTests.java deleted file mode 100644 index a1274e27291b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingArcAutoProvisioningTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingArcAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingArcAutoProvisioningConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersGcpOfferingArcAutoProvisioningTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersGcpOfferingArcAutoProvisioning model = - BinaryData - .fromString( - "{\"enabled\":false,\"configuration\":{\"proxy\":\"gfb\",\"privateLinkScope\":\"tlpqagynoi\"}}") - .toObject(DefenderForServersGcpOfferingArcAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("gfb", model.configuration().proxy()); - Assertions.assertEquals("tlpqagynoi", model.configuration().privateLinkScope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersGcpOfferingArcAutoProvisioning model = - new DefenderForServersGcpOfferingArcAutoProvisioning() - .withEnabled(false) - .withConfiguration( - new DefenderForServersGcpOfferingArcAutoProvisioningConfiguration() - .withProxy("gfb") - .withPrivateLinkScope("tlpqagynoi")); - model = BinaryData.fromObject(model).toObject(DefenderForServersGcpOfferingArcAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("gfb", model.configuration().proxy()); - Assertions.assertEquals("tlpqagynoi", model.configuration().privateLinkScope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingDefenderForServersTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingDefenderForServersTests.java deleted file mode 100644 index 6731bb112f43..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingDefenderForServersTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingDefenderForServers; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersGcpOfferingDefenderForServersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersGcpOfferingDefenderForServers model = - BinaryData - .fromString("{\"workloadIdentityProviderId\":\"jajqmatxjt\",\"serviceAccountEmailAddress\":\"ln\"}") - .toObject(DefenderForServersGcpOfferingDefenderForServers.class); - Assertions.assertEquals("jajqmatxjt", model.workloadIdentityProviderId()); - Assertions.assertEquals("ln", model.serviceAccountEmailAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersGcpOfferingDefenderForServers model = - new DefenderForServersGcpOfferingDefenderForServers() - .withWorkloadIdentityProviderId("jajqmatxjt") - .withServiceAccountEmailAddress("ln"); - model = BinaryData.fromObject(model).toObject(DefenderForServersGcpOfferingDefenderForServers.class); - Assertions.assertEquals("jajqmatxjt", model.workloadIdentityProviderId()); - Assertions.assertEquals("ln", model.serviceAccountEmailAddress()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingMdeAutoProvisioningTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingMdeAutoProvisioningTests.java deleted file mode 100644 index d37fda7f56da..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingMdeAutoProvisioningTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingMdeAutoProvisioning; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersGcpOfferingMdeAutoProvisioningTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersGcpOfferingMdeAutoProvisioning model = - BinaryData - .fromString("{\"enabled\":false,\"configuration\":\"dataibmq\"}") - .toObject(DefenderForServersGcpOfferingMdeAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersGcpOfferingMdeAutoProvisioning model = - new DefenderForServersGcpOfferingMdeAutoProvisioning().withEnabled(false).withConfiguration("dataibmq"); - model = BinaryData.fromObject(model).toObject(DefenderForServersGcpOfferingMdeAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingSubPlanTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingSubPlanTests.java deleted file mode 100644 index f70acd19405e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingSubPlanTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingSubPlan; -import com.azure.resourcemanager.security.models.SubPlan; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersGcpOfferingSubPlanTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersGcpOfferingSubPlan model = - BinaryData.fromString("{\"type\":\"P1\"}").toObject(DefenderForServersGcpOfferingSubPlan.class); - Assertions.assertEquals(SubPlan.P1, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersGcpOfferingSubPlan model = new DefenderForServersGcpOfferingSubPlan().withType(SubPlan.P1); - model = BinaryData.fromObject(model).toObject(DefenderForServersGcpOfferingSubPlan.class); - Assertions.assertEquals(SubPlan.P1, model.type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingTests.java deleted file mode 100644 index 4b05b375060c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingTests.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOffering; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingArcAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingArcAutoProvisioningConfiguration; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingDefenderForServers; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingMdeAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingSubPlan; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVaAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVaAutoProvisioningConfiguration; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVmScanners; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVmScannersConfiguration; -import com.azure.resourcemanager.security.models.ScanningMode; -import com.azure.resourcemanager.security.models.SubPlan; -import com.azure.resourcemanager.security.models.Type; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersGcpOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersGcpOffering model = - BinaryData - .fromString( - "{\"offeringType\":\"DefenderForServersGcp\",\"defenderForServers\":{\"workloadIdentityProviderId\":\"scyrfwbivqv\",\"serviceAccountEmailAddress\":\"fuy\"},\"arcAutoProvisioning\":{\"enabled\":false,\"configuration\":{\"proxy\":\"imbyqe\",\"privateLinkScope\":\"ood\"}},\"vaAutoProvisioning\":{\"enabled\":true,\"configuration\":{\"type\":\"Qualys\"}},\"mdeAutoProvisioning\":{\"enabled\":false,\"configuration\":\"dataxxobsmfkwiy\"},\"subPlan\":{\"type\":\"P1\"},\"vmScanners\":{\"enabled\":true,\"configuration\":{\"scanningMode\":\"Default\",\"exclusionTags\":{\"abjqqaxuyvymcnud\":\"vzmlnkoywsxv\",\"wxqweuipmpvksmi\":\"doabhj\",\"krdpqgfhyrfr\":\"nsqxtltc\"}}},\"description\":\"kldgrcwfcmfc\"}") - .toObject(DefenderForServersGcpOffering.class); - Assertions.assertEquals("scyrfwbivqv", model.defenderForServers().workloadIdentityProviderId()); - Assertions.assertEquals("fuy", model.defenderForServers().serviceAccountEmailAddress()); - Assertions.assertEquals(false, model.arcAutoProvisioning().enabled()); - Assertions.assertEquals("imbyqe", model.arcAutoProvisioning().configuration().proxy()); - Assertions.assertEquals("ood", model.arcAutoProvisioning().configuration().privateLinkScope()); - Assertions.assertEquals(true, model.vaAutoProvisioning().enabled()); - Assertions.assertEquals(Type.QUALYS, model.vaAutoProvisioning().configuration().type()); - Assertions.assertEquals(false, model.mdeAutoProvisioning().enabled()); - Assertions.assertEquals(SubPlan.P1, model.subPlan().type()); - Assertions.assertEquals(true, model.vmScanners().enabled()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.vmScanners().configuration().scanningMode()); - Assertions - .assertEquals("vzmlnkoywsxv", model.vmScanners().configuration().exclusionTags().get("abjqqaxuyvymcnud")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersGcpOffering model = - new DefenderForServersGcpOffering() - .withDefenderForServers( - new DefenderForServersGcpOfferingDefenderForServers() - .withWorkloadIdentityProviderId("scyrfwbivqv") - .withServiceAccountEmailAddress("fuy")) - .withArcAutoProvisioning( - new DefenderForServersGcpOfferingArcAutoProvisioning() - .withEnabled(false) - .withConfiguration( - new DefenderForServersGcpOfferingArcAutoProvisioningConfiguration() - .withProxy("imbyqe") - .withPrivateLinkScope("ood"))) - .withVaAutoProvisioning( - new DefenderForServersGcpOfferingVaAutoProvisioning() - .withEnabled(true) - .withConfiguration( - new DefenderForServersGcpOfferingVaAutoProvisioningConfiguration().withType(Type.QUALYS))) - .withMdeAutoProvisioning( - new DefenderForServersGcpOfferingMdeAutoProvisioning() - .withEnabled(false) - .withConfiguration("dataxxobsmfkwiy")) - .withSubPlan(new DefenderForServersGcpOfferingSubPlan().withType(SubPlan.P1)) - .withVmScanners( - new DefenderForServersGcpOfferingVmScanners() - .withEnabled(true) - .withConfiguration( - new DefenderForServersGcpOfferingVmScannersConfiguration() - .withScanningMode(ScanningMode.DEFAULT) - .withExclusionTags( - mapOf( - "abjqqaxuyvymcnud", - "vzmlnkoywsxv", - "wxqweuipmpvksmi", - "doabhj", - "krdpqgfhyrfr", - "nsqxtltc")))); - model = BinaryData.fromObject(model).toObject(DefenderForServersGcpOffering.class); - Assertions.assertEquals("scyrfwbivqv", model.defenderForServers().workloadIdentityProviderId()); - Assertions.assertEquals("fuy", model.defenderForServers().serviceAccountEmailAddress()); - Assertions.assertEquals(false, model.arcAutoProvisioning().enabled()); - Assertions.assertEquals("imbyqe", model.arcAutoProvisioning().configuration().proxy()); - Assertions.assertEquals("ood", model.arcAutoProvisioning().configuration().privateLinkScope()); - Assertions.assertEquals(true, model.vaAutoProvisioning().enabled()); - Assertions.assertEquals(Type.QUALYS, model.vaAutoProvisioning().configuration().type()); - Assertions.assertEquals(false, model.mdeAutoProvisioning().enabled()); - Assertions.assertEquals(SubPlan.P1, model.subPlan().type()); - Assertions.assertEquals(true, model.vmScanners().enabled()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.vmScanners().configuration().scanningMode()); - Assertions - .assertEquals("vzmlnkoywsxv", model.vmScanners().configuration().exclusionTags().get("abjqqaxuyvymcnud")); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVaAutoProvisioningConfigurationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVaAutoProvisioningConfigurationTests.java deleted file mode 100644 index 54168f20ecfd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVaAutoProvisioningConfigurationTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVaAutoProvisioningConfiguration; -import com.azure.resourcemanager.security.models.Type; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersGcpOfferingVaAutoProvisioningConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersGcpOfferingVaAutoProvisioningConfiguration model = - BinaryData - .fromString("{\"type\":\"Qualys\"}") - .toObject(DefenderForServersGcpOfferingVaAutoProvisioningConfiguration.class); - Assertions.assertEquals(Type.QUALYS, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersGcpOfferingVaAutoProvisioningConfiguration model = - new DefenderForServersGcpOfferingVaAutoProvisioningConfiguration().withType(Type.QUALYS); - model = - BinaryData.fromObject(model).toObject(DefenderForServersGcpOfferingVaAutoProvisioningConfiguration.class); - Assertions.assertEquals(Type.QUALYS, model.type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVaAutoProvisioningTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVaAutoProvisioningTests.java deleted file mode 100644 index 367ac0c2b753..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVaAutoProvisioningTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVaAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVaAutoProvisioningConfiguration; -import com.azure.resourcemanager.security.models.Type; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersGcpOfferingVaAutoProvisioningTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersGcpOfferingVaAutoProvisioning model = - BinaryData - .fromString("{\"enabled\":false,\"configuration\":{\"type\":\"TVM\"}}") - .toObject(DefenderForServersGcpOfferingVaAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals(Type.TVM, model.configuration().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersGcpOfferingVaAutoProvisioning model = - new DefenderForServersGcpOfferingVaAutoProvisioning() - .withEnabled(false) - .withConfiguration( - new DefenderForServersGcpOfferingVaAutoProvisioningConfiguration().withType(Type.TVM)); - model = BinaryData.fromObject(model).toObject(DefenderForServersGcpOfferingVaAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals(Type.TVM, model.configuration().type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVmScannersConfigurationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVmScannersConfigurationTests.java deleted file mode 100644 index 84ad466eb654..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVmScannersConfigurationTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVmScannersConfiguration; -import com.azure.resourcemanager.security.models.ScanningMode; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersGcpOfferingVmScannersConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersGcpOfferingVmScannersConfiguration model = - BinaryData - .fromString( - "{\"scanningMode\":\"Default\",\"exclusionTags\":{\"io\":\"puohdkcprgukxrz\",\"f\":\"hlutixmqrudjizc\",\"fbcpaqktkrumzu\":\"mcrunfhiucn\"}}") - .toObject(DefenderForServersGcpOfferingVmScannersConfiguration.class); - Assertions.assertEquals(ScanningMode.DEFAULT, model.scanningMode()); - Assertions.assertEquals("puohdkcprgukxrz", model.exclusionTags().get("io")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersGcpOfferingVmScannersConfiguration model = - new DefenderForServersGcpOfferingVmScannersConfiguration() - .withScanningMode(ScanningMode.DEFAULT) - .withExclusionTags( - mapOf("io", "puohdkcprgukxrz", "f", "hlutixmqrudjizc", "fbcpaqktkrumzu", "mcrunfhiucn")); - model = BinaryData.fromObject(model).toObject(DefenderForServersGcpOfferingVmScannersConfiguration.class); - Assertions.assertEquals(ScanningMode.DEFAULT, model.scanningMode()); - Assertions.assertEquals("puohdkcprgukxrz", model.exclusionTags().get("io")); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVmScannersTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVmScannersTests.java deleted file mode 100644 index 9e611d93fc4a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVmScannersTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVmScanners; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVmScannersConfiguration; -import com.azure.resourcemanager.security.models.ScanningMode; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersGcpOfferingVmScannersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersGcpOfferingVmScanners model = - BinaryData - .fromString( - "{\"enabled\":true,\"configuration\":{\"scanningMode\":\"Default\",\"exclusionTags\":{\"fupetasvv\":\"u\",\"flanfkgxsyao\":\"qsbp\"}}}") - .toObject(DefenderForServersGcpOfferingVmScanners.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.configuration().scanningMode()); - Assertions.assertEquals("u", model.configuration().exclusionTags().get("fupetasvv")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersGcpOfferingVmScanners model = - new DefenderForServersGcpOfferingVmScanners() - .withEnabled(true) - .withConfiguration( - new DefenderForServersGcpOfferingVmScannersConfiguration() - .withScanningMode(ScanningMode.DEFAULT) - .withExclusionTags(mapOf("fupetasvv", "u", "flanfkgxsyao", "qsbp"))); - model = BinaryData.fromObject(model).toObject(DefenderForServersGcpOfferingVmScanners.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.configuration().scanningMode()); - Assertions.assertEquals("u", model.configuration().exclusionTags().get("fupetasvv")); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DenylistCustomAlertRuleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DenylistCustomAlertRuleTests.java deleted file mode 100644 index 05ff07e7bd38..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DenylistCustomAlertRuleTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DenylistCustomAlertRule; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DenylistCustomAlertRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DenylistCustomAlertRule model = - BinaryData - .fromString( - "{\"ruleType\":\"DenylistCustomAlertRule\",\"denylistValues\":[\"okeyyienj\",\"dlwtgrhpdj\"],\"valueType\":\"String\",\"displayName\":\"asxazjpqyegualhb\",\"description\":\"hejjz\",\"isEnabled\":false}") - .toObject(DenylistCustomAlertRule.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals("okeyyienj", model.denylistValues().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DenylistCustomAlertRule model = - new DenylistCustomAlertRule() - .withIsEnabled(false) - .withDenylistValues(Arrays.asList("okeyyienj", "dlwtgrhpdj")); - model = BinaryData.fromObject(model).toObject(DenylistCustomAlertRule.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals("okeyyienj", model.denylistValues().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupInnerTests.java deleted file mode 100644 index a5985d229eb6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupInnerTests.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupInner; -import com.azure.resourcemanager.security.models.AllowlistCustomAlertRule; -import com.azure.resourcemanager.security.models.DenylistCustomAlertRule; -import com.azure.resourcemanager.security.models.ThresholdCustomAlertRule; -import com.azure.resourcemanager.security.models.TimeWindowCustomAlertRule; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DeviceSecurityGroupInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeviceSecurityGroupInner model = - BinaryData - .fromString( - "{\"properties\":{\"thresholdRules\":[{\"ruleType\":\"ThresholdCustomAlertRule\",\"minThreshold\":1273702243,\"maxThreshold\":541162578,\"displayName\":\"rsoodqxhcrmnoh\",\"description\":\"ckwhds\",\"isEnabled\":true},{\"ruleType\":\"ThresholdCustomAlertRule\",\"minThreshold\":1580515344,\"maxThreshold\":491677014,\"displayName\":\"i\",\"description\":\"xsqwpgrjbznorc\",\"isEnabled\":false},{\"ruleType\":\"ThresholdCustomAlertRule\",\"minThreshold\":1016211190,\"maxThreshold\":745592995,\"displayName\":\"byxqabn\",\"description\":\"cpc\",\"isEnabled\":true}],\"timeWindowRules\":[{\"ruleType\":\"TimeWindowCustomAlertRule\",\"timeWindowSize\":\"PT138H20M56S\",\"minThreshold\":818060655,\"maxThreshold\":2023442123,\"displayName\":\"bl\",\"description\":\"gpbtoqcjmklj\",\"isEnabled\":false},{\"ruleType\":\"TimeWindowCustomAlertRule\",\"timeWindowSize\":\"PT31H50M7S\",\"minThreshold\":300306842,\"maxThreshold\":62975440,\"displayName\":\"tqajzyulpkudjkrl\",\"description\":\"bzhfepgzgqexz\",\"isEnabled\":true}],\"allowlistRules\":[{\"ruleType\":\"AllowlistCustomAlertRule\",\"allowlistValues\":[],\"valueType\":\"IpCidr\",\"displayName\":\"aierhhb\",\"description\":\"glu\",\"isEnabled\":false},{\"ruleType\":\"AllowlistCustomAlertRule\",\"allowlistValues\":[],\"valueType\":\"String\",\"displayName\":\"j\",\"description\":\"dxob\",\"isEnabled\":true},{\"ruleType\":\"AllowlistCustomAlertRule\",\"allowlistValues\":[],\"valueType\":\"IpCidr\",\"displayName\":\"qp\",\"description\":\"kajionpim\",\"isEnabled\":false}],\"denylistRules\":[{\"ruleType\":\"DenylistCustomAlertRule\",\"denylistValues\":[],\"valueType\":\"IpCidr\",\"displayName\":\"cp\",\"description\":\"gmaajrm\",\"isEnabled\":false},{\"ruleType\":\"DenylistCustomAlertRule\",\"denylistValues\":[],\"valueType\":\"String\",\"displayName\":\"rlovmclwhijcoej\",\"description\":\"bzaqsqsycbkbfk\",\"isEnabled\":true}]},\"id\":\"kdkexxp\",\"name\":\"ofmx\",\"type\":\"x\"}") - .toObject(DeviceSecurityGroupInner.class); - Assertions.assertEquals(true, model.thresholdRules().get(0).isEnabled()); - Assertions.assertEquals(1273702243, model.thresholdRules().get(0).minThreshold()); - Assertions.assertEquals(541162578, model.thresholdRules().get(0).maxThreshold()); - Assertions.assertEquals(false, model.timeWindowRules().get(0).isEnabled()); - Assertions.assertEquals(818060655, model.timeWindowRules().get(0).minThreshold()); - Assertions.assertEquals(2023442123, model.timeWindowRules().get(0).maxThreshold()); - Assertions.assertEquals(Duration.parse("PT138H20M56S"), model.timeWindowRules().get(0).timeWindowSize()); - Assertions.assertEquals(false, model.allowlistRules().get(0).isEnabled()); - Assertions.assertEquals(false, model.denylistRules().get(0).isEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceSecurityGroupInner model = - new DeviceSecurityGroupInner() - .withThresholdRules( - Arrays - .asList( - new ThresholdCustomAlertRule() - .withIsEnabled(true) - .withMinThreshold(1273702243) - .withMaxThreshold(541162578), - new ThresholdCustomAlertRule() - .withIsEnabled(false) - .withMinThreshold(1580515344) - .withMaxThreshold(491677014), - new ThresholdCustomAlertRule() - .withIsEnabled(true) - .withMinThreshold(1016211190) - .withMaxThreshold(745592995))) - .withTimeWindowRules( - Arrays - .asList( - new TimeWindowCustomAlertRule() - .withIsEnabled(false) - .withMinThreshold(818060655) - .withMaxThreshold(2023442123) - .withTimeWindowSize(Duration.parse("PT138H20M56S")), - new TimeWindowCustomAlertRule() - .withIsEnabled(true) - .withMinThreshold(300306842) - .withMaxThreshold(62975440) - .withTimeWindowSize(Duration.parse("PT31H50M7S")))) - .withAllowlistRules( - Arrays - .asList( - new AllowlistCustomAlertRule().withIsEnabled(false).withAllowlistValues(Arrays.asList()), - new AllowlistCustomAlertRule().withIsEnabled(true).withAllowlistValues(Arrays.asList()), - new AllowlistCustomAlertRule().withIsEnabled(false).withAllowlistValues(Arrays.asList()))) - .withDenylistRules( - Arrays - .asList( - new DenylistCustomAlertRule().withIsEnabled(false).withDenylistValues(Arrays.asList()), - new DenylistCustomAlertRule().withIsEnabled(true).withDenylistValues(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(DeviceSecurityGroupInner.class); - Assertions.assertEquals(true, model.thresholdRules().get(0).isEnabled()); - Assertions.assertEquals(1273702243, model.thresholdRules().get(0).minThreshold()); - Assertions.assertEquals(541162578, model.thresholdRules().get(0).maxThreshold()); - Assertions.assertEquals(false, model.timeWindowRules().get(0).isEnabled()); - Assertions.assertEquals(818060655, model.timeWindowRules().get(0).minThreshold()); - Assertions.assertEquals(2023442123, model.timeWindowRules().get(0).maxThreshold()); - Assertions.assertEquals(Duration.parse("PT138H20M56S"), model.timeWindowRules().get(0).timeWindowSize()); - Assertions.assertEquals(false, model.allowlistRules().get(0).isEnabled()); - Assertions.assertEquals(false, model.denylistRules().get(0).isEnabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupListTests.java deleted file mode 100644 index b2a23f808484..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupListTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupInner; -import com.azure.resourcemanager.security.models.DeviceSecurityGroupList; -import java.util.Arrays; - -public final class DeviceSecurityGroupListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeviceSecurityGroupList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"thresholdRules\":[],\"timeWindowRules\":[],\"allowlistRules\":[],\"denylistRules\":[]},\"id\":\"dwzjeiach\",\"name\":\"oosflnr\",\"type\":\"sfqpteehz\"}],\"nextLink\":\"ypyqrimzinp\"}") - .toObject(DeviceSecurityGroupList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceSecurityGroupList model = - new DeviceSecurityGroupList() - .withValue( - Arrays - .asList( - new DeviceSecurityGroupInner() - .withThresholdRules(Arrays.asList()) - .withTimeWindowRules(Arrays.asList()) - .withAllowlistRules(Arrays.asList()) - .withDenylistRules(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(DeviceSecurityGroupList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupPropertiesTests.java deleted file mode 100644 index 47dc2d1aac55..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupPropertiesTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupProperties; -import com.azure.resourcemanager.security.models.AllowlistCustomAlertRule; -import com.azure.resourcemanager.security.models.DenylistCustomAlertRule; -import com.azure.resourcemanager.security.models.ThresholdCustomAlertRule; -import com.azure.resourcemanager.security.models.TimeWindowCustomAlertRule; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DeviceSecurityGroupPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeviceSecurityGroupProperties model = - BinaryData - .fromString( - "{\"thresholdRules\":[{\"ruleType\":\"ThresholdCustomAlertRule\",\"minThreshold\":396023335,\"maxThreshold\":1635783635,\"displayName\":\"dtocj\",\"description\":\"hvpmoue\",\"isEnabled\":false}],\"timeWindowRules\":[{\"ruleType\":\"TimeWindowCustomAlertRule\",\"timeWindowSize\":\"PT62H8M23S\",\"minThreshold\":229644058,\"maxThreshold\":738311617,\"displayName\":\"eojnxqbzvddn\",\"description\":\"ndei\",\"isEnabled\":true},{\"ruleType\":\"TimeWindowCustomAlertRule\",\"timeWindowSize\":\"PT35H10M37S\",\"minThreshold\":206399167,\"maxThreshold\":1604770276,\"displayName\":\"zao\",\"description\":\"uhrhcffcyddgl\",\"isEnabled\":true}],\"allowlistRules\":[{\"ruleType\":\"AllowlistCustomAlertRule\",\"allowlistValues\":[\"qkwpyeicxmqc\",\"wqvhkhixuigdt\",\"pbobjo\"],\"valueType\":\"IpCidr\",\"displayName\":\"w\",\"description\":\"m\",\"isEnabled\":true}],\"denylistRules\":[{\"ruleType\":\"DenylistCustomAlertRule\",\"denylistValues\":[\"ayvvtpgvdf\"],\"valueType\":\"String\",\"displayName\":\"kftutqxlngxlefg\",\"description\":\"nxkrx\",\"isEnabled\":false},{\"ruleType\":\"DenylistCustomAlertRule\",\"denylistValues\":[\"i\"],\"valueType\":\"IpCidr\",\"displayName\":\"zrvqdr\",\"description\":\"hjybigehoqfbo\",\"isEnabled\":false}]}") - .toObject(DeviceSecurityGroupProperties.class); - Assertions.assertEquals(false, model.thresholdRules().get(0).isEnabled()); - Assertions.assertEquals(396023335, model.thresholdRules().get(0).minThreshold()); - Assertions.assertEquals(1635783635, model.thresholdRules().get(0).maxThreshold()); - Assertions.assertEquals(true, model.timeWindowRules().get(0).isEnabled()); - Assertions.assertEquals(229644058, model.timeWindowRules().get(0).minThreshold()); - Assertions.assertEquals(738311617, model.timeWindowRules().get(0).maxThreshold()); - Assertions.assertEquals(Duration.parse("PT62H8M23S"), model.timeWindowRules().get(0).timeWindowSize()); - Assertions.assertEquals(true, model.allowlistRules().get(0).isEnabled()); - Assertions.assertEquals("qkwpyeicxmqc", model.allowlistRules().get(0).allowlistValues().get(0)); - Assertions.assertEquals(false, model.denylistRules().get(0).isEnabled()); - Assertions.assertEquals("ayvvtpgvdf", model.denylistRules().get(0).denylistValues().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceSecurityGroupProperties model = - new DeviceSecurityGroupProperties() - .withThresholdRules( - Arrays - .asList( - new ThresholdCustomAlertRule() - .withIsEnabled(false) - .withMinThreshold(396023335) - .withMaxThreshold(1635783635))) - .withTimeWindowRules( - Arrays - .asList( - new TimeWindowCustomAlertRule() - .withIsEnabled(true) - .withMinThreshold(229644058) - .withMaxThreshold(738311617) - .withTimeWindowSize(Duration.parse("PT62H8M23S")), - new TimeWindowCustomAlertRule() - .withIsEnabled(true) - .withMinThreshold(206399167) - .withMaxThreshold(1604770276) - .withTimeWindowSize(Duration.parse("PT35H10M37S")))) - .withAllowlistRules( - Arrays - .asList( - new AllowlistCustomAlertRule() - .withIsEnabled(true) - .withAllowlistValues(Arrays.asList("qkwpyeicxmqc", "wqvhkhixuigdt", "pbobjo")))) - .withDenylistRules( - Arrays - .asList( - new DenylistCustomAlertRule() - .withIsEnabled(false) - .withDenylistValues(Arrays.asList("ayvvtpgvdf")), - new DenylistCustomAlertRule().withIsEnabled(false).withDenylistValues(Arrays.asList("i")))); - model = BinaryData.fromObject(model).toObject(DeviceSecurityGroupProperties.class); - Assertions.assertEquals(false, model.thresholdRules().get(0).isEnabled()); - Assertions.assertEquals(396023335, model.thresholdRules().get(0).minThreshold()); - Assertions.assertEquals(1635783635, model.thresholdRules().get(0).maxThreshold()); - Assertions.assertEquals(true, model.timeWindowRules().get(0).isEnabled()); - Assertions.assertEquals(229644058, model.timeWindowRules().get(0).minThreshold()); - Assertions.assertEquals(738311617, model.timeWindowRules().get(0).maxThreshold()); - Assertions.assertEquals(Duration.parse("PT62H8M23S"), model.timeWindowRules().get(0).timeWindowSize()); - Assertions.assertEquals(true, model.allowlistRules().get(0).isEnabled()); - Assertions.assertEquals("qkwpyeicxmqc", model.allowlistRules().get(0).allowlistValues().get(0)); - Assertions.assertEquals(false, model.denylistRules().get(0).isEnabled()); - Assertions.assertEquals("ayvvtpgvdf", model.denylistRules().get(0).denylistValues().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index c7fd3563d617..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.DeviceSecurityGroup; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DeviceSecurityGroupsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"thresholdRules\":[],\"timeWindowRules\":[],\"allowlistRules\":[],\"denylistRules\":[]},\"id\":\"stewfop\",\"name\":\"z\",\"type\":\"azgbsqgpe\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DeviceSecurityGroup response = - manager - .deviceSecurityGroups() - .define("ylt") - .withExistingResourceId("nquktrfnslnlrxs") - .withThresholdRules(Arrays.asList()) - .withTimeWindowRules(Arrays.asList()) - .withAllowlistRules(Arrays.asList()) - .withDenylistRules(Arrays.asList()) - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsDeleteByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 73bd48834292..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DeviceSecurityGroupsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .deviceSecurityGroups() - .deleteByResourceGroupWithResponse("suenyg", "xcgjtf", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsGetWithResponseMockTests.java deleted file mode 100644 index 8c94dddd61d8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.DeviceSecurityGroup; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DeviceSecurityGroupsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"thresholdRules\":[],\"timeWindowRules\":[],\"allowlistRules\":[],\"denylistRules\":[]},\"id\":\"hsoymhpvtyqf\",\"name\":\"tehdpboujs\",\"type\":\"kfvvdshxcde\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DeviceSecurityGroup response = - manager - .deviceSecurityGroups() - .getWithResponse("aiossscyvaifp", "uacvfy", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsListMockTests.java deleted file mode 100644 index 83dbf8c17a89..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.DeviceSecurityGroup; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DeviceSecurityGroupsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"thresholdRules\":[],\"timeWindowRules\":[],\"allowlistRules\":[],\"denylistRules\":[]},\"id\":\"xqceazfpxgn\",\"name\":\"qvzvlu\",\"type\":\"q\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.deviceSecurityGroups().list("gfii", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DirectMethodInvokesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DirectMethodInvokesNotInAllowedRangeTests.java deleted file mode 100644 index 2b4f41c6f6c5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DirectMethodInvokesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DirectMethodInvokesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class DirectMethodInvokesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DirectMethodInvokesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"DirectMethodInvokesNotInAllowedRange\",\"timeWindowSize\":\"PT14H59M6S\",\"minThreshold\":2142539902,\"maxThreshold\":629230880,\"displayName\":\"isczskoswo\",\"description\":\"qazu\",\"isEnabled\":false}") - .toObject(DirectMethodInvokesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(2142539902, model.minThreshold()); - Assertions.assertEquals(629230880, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT14H59M6S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DirectMethodInvokesNotInAllowedRange model = - new DirectMethodInvokesNotInAllowedRange() - .withIsEnabled(false) - .withMinThreshold(2142539902) - .withMaxThreshold(629230880) - .withTimeWindowSize(Duration.parse("PT14H59M6S")); - model = BinaryData.fromObject(model).toObject(DirectMethodInvokesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(2142539902, model.minThreshold()); - Assertions.assertEquals(629230880, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT14H59M6S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionInnerTests.java deleted file mode 100644 index cb5568d6247e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionInnerTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner; -import com.azure.resourcemanager.security.models.SecurityFamily; -import org.junit.jupiter.api.Assertions; - -public final class DiscoveredSecuritySolutionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiscoveredSecuritySolutionInner model = - BinaryData - .fromString( - "{\"properties\":{\"securityFamily\":\"Waf\",\"offer\":\"pbswvefloccsrm\",\"publisher\":\"zihmipgawtxxpky\",\"sku\":\"cxcjxgry\"},\"location\":\"mpcycilrmcaykgg\",\"id\":\"oxuztrksx\",\"name\":\"pndfcpfnznt\",\"type\":\"jtwkjaos\"}") - .toObject(DiscoveredSecuritySolutionInner.class); - Assertions.assertEquals(SecurityFamily.WAF, model.securityFamily()); - Assertions.assertEquals("pbswvefloccsrm", model.offer()); - Assertions.assertEquals("zihmipgawtxxpky", model.publisher()); - Assertions.assertEquals("cxcjxgry", model.sku()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiscoveredSecuritySolutionInner model = - new DiscoveredSecuritySolutionInner() - .withSecurityFamily(SecurityFamily.WAF) - .withOffer("pbswvefloccsrm") - .withPublisher("zihmipgawtxxpky") - .withSku("cxcjxgry"); - model = BinaryData.fromObject(model).toObject(DiscoveredSecuritySolutionInner.class); - Assertions.assertEquals(SecurityFamily.WAF, model.securityFamily()); - Assertions.assertEquals("pbswvefloccsrm", model.offer()); - Assertions.assertEquals("zihmipgawtxxpky", model.publisher()); - Assertions.assertEquals("cxcjxgry", model.sku()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionListTests.java deleted file mode 100644 index 6014a76ff0f3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionListTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner; -import com.azure.resourcemanager.security.models.DiscoveredSecuritySolutionList; -import com.azure.resourcemanager.security.models.SecurityFamily; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DiscoveredSecuritySolutionListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiscoveredSecuritySolutionList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"securityFamily\":\"Ngfw\",\"offer\":\"ptfujgicgaaoept\",\"publisher\":\"aqutdewemxswvruu\",\"sku\":\"zzjgehkfki\"},\"location\":\"tixo\",\"id\":\"ffqyinlj\",\"name\":\"epqw\",\"type\":\"ixmonstshiyxg\"},{\"properties\":{\"securityFamily\":\"SaasWaf\",\"offer\":\"lfcldu\",\"publisher\":\"cb\",\"sku\":\"rds\"},\"location\":\"wcobie\",\"id\":\"stmninwjizcilng\",\"name\":\"gshejjtbxqmulux\",\"type\":\"xqzv\"},{\"properties\":{\"securityFamily\":\"Waf\",\"offer\":\"rsbycucrwn\",\"publisher\":\"mikzeb\",\"sku\":\"qbsms\"},\"location\":\"iqg\",\"id\":\"uhok\",\"name\":\"ruswhv\",\"type\":\"czznvfbycjsxj\"},{\"properties\":{\"securityFamily\":\"Waf\",\"offer\":\"i\",\"publisher\":\"z\",\"sku\":\"umwmxqhnd\"},\"location\":\"oamld\",\"id\":\"ehaohdjhh\",\"name\":\"lzok\",\"type\":\"coxpelnjeta\"}],\"nextLink\":\"tsxoatftgz\"}") - .toObject(DiscoveredSecuritySolutionList.class); - Assertions.assertEquals(SecurityFamily.NGFW, model.value().get(0).securityFamily()); - Assertions.assertEquals("ptfujgicgaaoept", model.value().get(0).offer()); - Assertions.assertEquals("aqutdewemxswvruu", model.value().get(0).publisher()); - Assertions.assertEquals("zzjgehkfki", model.value().get(0).sku()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiscoveredSecuritySolutionList model = - new DiscoveredSecuritySolutionList() - .withValue( - Arrays - .asList( - new DiscoveredSecuritySolutionInner() - .withSecurityFamily(SecurityFamily.NGFW) - .withOffer("ptfujgicgaaoept") - .withPublisher("aqutdewemxswvruu") - .withSku("zzjgehkfki"), - new DiscoveredSecuritySolutionInner() - .withSecurityFamily(SecurityFamily.SAAS_WAF) - .withOffer("lfcldu") - .withPublisher("cb") - .withSku("rds"), - new DiscoveredSecuritySolutionInner() - .withSecurityFamily(SecurityFamily.WAF) - .withOffer("rsbycucrwn") - .withPublisher("mikzeb") - .withSku("qbsms"), - new DiscoveredSecuritySolutionInner() - .withSecurityFamily(SecurityFamily.WAF) - .withOffer("i") - .withPublisher("z") - .withSku("umwmxqhnd"))); - model = BinaryData.fromObject(model).toObject(DiscoveredSecuritySolutionList.class); - Assertions.assertEquals(SecurityFamily.NGFW, model.value().get(0).securityFamily()); - Assertions.assertEquals("ptfujgicgaaoept", model.value().get(0).offer()); - Assertions.assertEquals("aqutdewemxswvruu", model.value().get(0).publisher()); - Assertions.assertEquals("zzjgehkfki", model.value().get(0).sku()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionPropertiesTests.java deleted file mode 100644 index 0c9f26a3f1b1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionPropertiesTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionProperties; -import com.azure.resourcemanager.security.models.SecurityFamily; -import org.junit.jupiter.api.Assertions; - -public final class DiscoveredSecuritySolutionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiscoveredSecuritySolutionProperties model = - BinaryData - .fromString( - "{\"securityFamily\":\"SaasWaf\",\"offer\":\"uzvoamktcqiosm\",\"publisher\":\"bzahgxqd\",\"sku\":\"yrtltlaprltzkat\"}") - .toObject(DiscoveredSecuritySolutionProperties.class); - Assertions.assertEquals(SecurityFamily.SAAS_WAF, model.securityFamily()); - Assertions.assertEquals("uzvoamktcqiosm", model.offer()); - Assertions.assertEquals("bzahgxqd", model.publisher()); - Assertions.assertEquals("yrtltlaprltzkat", model.sku()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiscoveredSecuritySolutionProperties model = - new DiscoveredSecuritySolutionProperties() - .withSecurityFamily(SecurityFamily.SAAS_WAF) - .withOffer("uzvoamktcqiosm") - .withPublisher("bzahgxqd") - .withSku("yrtltlaprltzkat"); - model = BinaryData.fromObject(model).toObject(DiscoveredSecuritySolutionProperties.class); - Assertions.assertEquals(SecurityFamily.SAAS_WAF, model.securityFamily()); - Assertions.assertEquals("uzvoamktcqiosm", model.offer()); - Assertions.assertEquals("bzahgxqd", model.publisher()); - Assertions.assertEquals("yrtltlaprltzkat", model.sku()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetWithResponseMockTests.java deleted file mode 100644 index bba3ec5377fd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetWithResponseMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.DiscoveredSecuritySolution; -import com.azure.resourcemanager.security.models.SecurityFamily; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DiscoveredSecuritySolutionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"securityFamily\":\"Va\",\"offer\":\"wushlcxpbl\",\"publisher\":\"lhh\",\"sku\":\"zpfkis\"},\"location\":\"idqzsaaoqdsgpto\",\"id\":\"xjqfiafcnlrtbfi\",\"name\":\"zzcaoijolbuauk\",\"type\":\"wieopexelxqdw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DiscoveredSecuritySolution response = - manager - .discoveredSecuritySolutions() - .getWithResponse("biwksde", "yxsbfpz", "oikvntwcz", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(SecurityFamily.VA, response.securityFamily()); - Assertions.assertEquals("wushlcxpbl", response.offer()); - Assertions.assertEquals("lhh", response.publisher()); - Assertions.assertEquals("zpfkis", response.sku()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListByHomeRegionMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListByHomeRegionMockTests.java deleted file mode 100644 index 81c3536a9870..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListByHomeRegionMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.DiscoveredSecuritySolution; -import com.azure.resourcemanager.security.models.SecurityFamily; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DiscoveredSecuritySolutionsListByHomeRegionMockTests { - @Test - public void testListByHomeRegion() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"securityFamily\":\"Va\",\"offer\":\"kll\",\"publisher\":\"ynqanhkigglc\",\"sku\":\"walhvubh\"},\"location\":\"phetxdqc\",\"id\":\"yctajqz\",\"name\":\"vale\",\"type\":\"xb\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.discoveredSecuritySolutions().listByHomeRegion("tpzcr", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(SecurityFamily.VA, response.iterator().next().securityFamily()); - Assertions.assertEquals("kll", response.iterator().next().offer()); - Assertions.assertEquals("ynqanhkigglc", response.iterator().next().publisher()); - Assertions.assertEquals("walhvubh", response.iterator().next().sku()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListMockTests.java deleted file mode 100644 index 56bea0638685..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.DiscoveredSecuritySolution; -import com.azure.resourcemanager.security.models.SecurityFamily; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DiscoveredSecuritySolutionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"securityFamily\":\"Waf\",\"offer\":\"qpzfzxsoxin\",\"publisher\":\"nj\",\"sku\":\"zkdrocqsxy\"},\"location\":\"qtcmiwdwisv\",\"id\":\"mey\",\"name\":\"ajamc\",\"type\":\"jyh\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.discoveredSecuritySolutions().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals(SecurityFamily.WAF, response.iterator().next().securityFamily()); - Assertions.assertEquals("qpzfzxsoxin", response.iterator().next().offer()); - Assertions.assertEquals("nj", response.iterator().next().publisher()); - Assertions.assertEquals("zkdrocqsxy", response.iterator().next().sku()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EffectiveNetworkSecurityGroupsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EffectiveNetworkSecurityGroupsTests.java deleted file mode 100644 index 27e2fa27461e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EffectiveNetworkSecurityGroupsTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.EffectiveNetworkSecurityGroups; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EffectiveNetworkSecurityGroupsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EffectiveNetworkSecurityGroups model = - BinaryData - .fromString( - "{\"networkInterface\":\"aeranokqgukkjqnv\",\"networkSecurityGroups\":[\"ylaxxulcdi\",\"dosfjbjsvgjrw\"]}") - .toObject(EffectiveNetworkSecurityGroups.class); - Assertions.assertEquals("aeranokqgukkjqnv", model.networkInterface()); - Assertions.assertEquals("ylaxxulcdi", model.networkSecurityGroups().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EffectiveNetworkSecurityGroups model = - new EffectiveNetworkSecurityGroups() - .withNetworkInterface("aeranokqgukkjqnv") - .withNetworkSecurityGroups(Arrays.asList("ylaxxulcdi", "dosfjbjsvgjrw")); - model = BinaryData.fromObject(model).toObject(EffectiveNetworkSecurityGroups.class); - Assertions.assertEquals("aeranokqgukkjqnv", model.networkInterface()); - Assertions.assertEquals("ylaxxulcdi", model.networkSecurityGroups().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EnvironmentDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EnvironmentDataTests.java deleted file mode 100644 index b86d82d1f6e7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EnvironmentDataTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.EnvironmentData; - -public final class EnvironmentDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentData model = - BinaryData.fromString("{\"environmentType\":\"EnvironmentData\"}").toObject(EnvironmentData.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentData model = new EnvironmentData(); - model = BinaryData.fromObject(model).toObject(EnvironmentData.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EnvironmentDetailsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EnvironmentDetailsTests.java deleted file mode 100644 index c3dc5e78c780..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EnvironmentDetailsTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.EnvironmentDetails; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentDetails model = - BinaryData - .fromString( - "{\"nativeResourceId\":\"lohap\",\"environmentHierarchyId\":\"nfszpyglqdhmrjz\",\"organizationalHierarchyId\":\"l\",\"subscriptionId\":\"pjby\",\"tenantId\":\"sjoqcjenkyhfqzvs\"}") - .toObject(EnvironmentDetails.class); - Assertions.assertEquals("lohap", model.nativeResourceId()); - Assertions.assertEquals("nfszpyglqdhmrjz", model.environmentHierarchyId()); - Assertions.assertEquals("l", model.organizationalHierarchyId()); - Assertions.assertEquals("pjby", model.subscriptionId()); - Assertions.assertEquals("sjoqcjenkyhfqzvs", model.tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentDetails model = - new EnvironmentDetails() - .withNativeResourceId("lohap") - .withEnvironmentHierarchyId("nfszpyglqdhmrjz") - .withOrganizationalHierarchyId("l") - .withSubscriptionId("pjby") - .withTenantId("sjoqcjenkyhfqzvs"); - model = BinaryData.fromObject(model).toObject(EnvironmentDetails.class); - Assertions.assertEquals("lohap", model.nativeResourceId()); - Assertions.assertEquals("nfszpyglqdhmrjz", model.environmentHierarchyId()); - Assertions.assertEquals("l", model.organizationalHierarchyId()); - Assertions.assertEquals("pjby", model.subscriptionId()); - Assertions.assertEquals("sjoqcjenkyhfqzvs", model.tenantId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EtagTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EtagTests.java deleted file mode 100644 index f338b94dfa01..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EtagTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Etag; -import org.junit.jupiter.api.Assertions; - -public final class EtagTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Etag model = BinaryData.fromString("{\"etag\":\"jw\"}").toObject(Etag.class); - Assertions.assertEquals("jw", model.etag()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Etag model = new Etag().withEtag("jw"); - model = BinaryData.fromObject(model).toObject(Etag.class); - Assertions.assertEquals("jw", model.etag()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExecuteGovernanceRuleParamsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExecuteGovernanceRuleParamsTests.java deleted file mode 100644 index 629bc806b651..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExecuteGovernanceRuleParamsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; -import org.junit.jupiter.api.Assertions; - -public final class ExecuteGovernanceRuleParamsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExecuteGovernanceRuleParams model = - BinaryData.fromString("{\"override\":true}").toObject(ExecuteGovernanceRuleParams.class); - Assertions.assertEquals(true, model.override()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExecuteGovernanceRuleParams model = new ExecuteGovernanceRuleParams().withOverride(true); - model = BinaryData.fromObject(model).toObject(ExecuteGovernanceRuleParams.class); - Assertions.assertEquals(true, model.override()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionInnerTests.java deleted file mode 100644 index c7243563ce05..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; - -public final class ExternalSecuritySolutionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExternalSecuritySolutionInner model = - BinaryData - .fromString( - "{\"kind\":\"ExternalSecuritySolution\",\"location\":\"ddoui\",\"id\":\"amowaziynknlqwzd\",\"name\":\"piwhxqs\",\"type\":\"dtmaa\"}") - .toObject(ExternalSecuritySolutionInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExternalSecuritySolutionInner model = new ExternalSecuritySolutionInner(); - model = BinaryData.fromObject(model).toObject(ExternalSecuritySolutionInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionListTests.java deleted file mode 100644 index 2df85c8b0656..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionListTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; -import com.azure.resourcemanager.security.models.ExternalSecuritySolutionList; -import java.util.Arrays; - -public final class ExternalSecuritySolutionListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExternalSecuritySolutionList model = - BinaryData - .fromString( - "{\"value\":[{\"kind\":\"ExternalSecuritySolution\",\"location\":\"ozxwopd\",\"id\":\"yd\",\"name\":\"izqaclnapxbiyg\",\"type\":\"ugjknf\"},{\"kind\":\"ExternalSecuritySolution\",\"location\":\"fcttuxuuyilfl\",\"id\":\"oiquvrehmrnjhvs\",\"name\":\"jztczytqj\",\"type\":\"w\"}],\"nextLink\":\"uunfprnjletlxsm\"}") - .toObject(ExternalSecuritySolutionList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExternalSecuritySolutionList model = - new ExternalSecuritySolutionList() - .withValue(Arrays.asList(new ExternalSecuritySolutionInner(), new ExternalSecuritySolutionInner())); - model = BinaryData.fromObject(model).toObject(ExternalSecuritySolutionList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionPropertiesTests.java deleted file mode 100644 index f6debc2322d6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionPropertiesTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ConnectedWorkspace; -import com.azure.resourcemanager.security.models.ExternalSecuritySolutionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ExternalSecuritySolutionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExternalSecuritySolutionProperties model = - BinaryData - .fromString( - "{\"deviceVendor\":\"rbzg\",\"deviceType\":\"oxqmjeajc\",\"workspace\":{\"id\":\"qg\"},\"\":{\"simjceagbjqvlsu\":\"datausrvx\",\"gon\":\"dataywzash\"}}") - .toObject(ExternalSecuritySolutionProperties.class); - Assertions.assertEquals("rbzg", model.deviceVendor()); - Assertions.assertEquals("oxqmjeajc", model.deviceType()); - Assertions.assertEquals("qg", model.workspace().id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExternalSecuritySolutionProperties model = - new ExternalSecuritySolutionProperties() - .withDeviceVendor("rbzg") - .withDeviceType("oxqmjeajc") - .withWorkspace(new ConnectedWorkspace().withId("qg")) - .withAdditionalProperties(mapOf()); - model = BinaryData.fromObject(model).toObject(ExternalSecuritySolutionProperties.class); - Assertions.assertEquals("rbzg", model.deviceVendor()); - Assertions.assertEquals("oxqmjeajc", model.deviceType()); - Assertions.assertEquals("qg", model.workspace().id()); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsGetWithResponseMockTests.java deleted file mode 100644 index 4ef34cd40f2a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ExternalSecuritySolution; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ExternalSecuritySolutionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"kind\":\"ExternalSecuritySolution\",\"location\":\"jfccylhtrht\",\"id\":\"vazjpwexcd\",\"name\":\"zp\",\"type\":\"o\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ExternalSecuritySolution response = - manager - .externalSecuritySolutions() - .getWithResponse("atpf", "saebwfwhxorpwal", "zwuge", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListByHomeRegionMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListByHomeRegionMockTests.java deleted file mode 100644 index 5d91ab8dbdc5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListByHomeRegionMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ExternalSecuritySolution; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ExternalSecuritySolutionsListByHomeRegionMockTests { - @Test - public void testListByHomeRegion() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"kind\":\"ExternalSecuritySolution\",\"location\":\"i\",\"id\":\"moxrezsvavlrxi\",\"name\":\"jmoywlunpipcwybs\",\"type\":\"fncn\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.externalSecuritySolutions().listByHomeRegion("ujx", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListMockTests.java deleted file mode 100644 index 8072f7d85223..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ExternalSecuritySolution; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ExternalSecuritySolutionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"kind\":\"ExternalSecuritySolution\",\"location\":\"we\",\"id\":\"yjshcyb\",\"name\":\"fuppoxprc\",\"type\":\"vo\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.externalSecuritySolutions().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/FailedLocalLoginsNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/FailedLocalLoginsNotInAllowedRangeTests.java deleted file mode 100644 index 877d8b1952ce..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/FailedLocalLoginsNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.FailedLocalLoginsNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class FailedLocalLoginsNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FailedLocalLoginsNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"FailedLocalLoginsNotInAllowedRange\",\"timeWindowSize\":\"PT78H46M30S\",\"minThreshold\":1982738288,\"maxThreshold\":589538374,\"displayName\":\"rrcoi\",\"description\":\"bamnppcc\",\"isEnabled\":true}") - .toObject(FailedLocalLoginsNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1982738288, model.minThreshold()); - Assertions.assertEquals(589538374, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT78H46M30S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FailedLocalLoginsNotInAllowedRange model = - new FailedLocalLoginsNotInAllowedRange() - .withIsEnabled(true) - .withMinThreshold(1982738288) - .withMaxThreshold(589538374) - .withTimeWindowSize(Duration.parse("PT78H46M30S")); - model = BinaryData.fromObject(model).toObject(FailedLocalLoginsNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1982738288, model.minThreshold()); - Assertions.assertEquals(589538374, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT78H46M30S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/FileUploadsNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/FileUploadsNotInAllowedRangeTests.java deleted file mode 100644 index 3acdccdb7ac3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/FileUploadsNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.FileUploadsNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class FileUploadsNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FileUploadsNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"FileUploadsNotInAllowedRange\",\"timeWindowSize\":\"PT179H50M54S\",\"minThreshold\":2061950840,\"maxThreshold\":2123887167,\"displayName\":\"sbezaxyfukzxuizh\",\"description\":\"nepk\",\"isEnabled\":true}") - .toObject(FileUploadsNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(2061950840, model.minThreshold()); - Assertions.assertEquals(2123887167, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT179H50M54S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FileUploadsNotInAllowedRange model = - new FileUploadsNotInAllowedRange() - .withIsEnabled(true) - .withMinThreshold(2061950840) - .withMaxThreshold(2123887167) - .withTimeWindowSize(Duration.parse("PT179H50M54S")); - model = BinaryData.fromObject(model).toObject(FileUploadsNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(2061950840, model.minThreshold()); - Assertions.assertEquals(2123887167, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT179H50M54S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataMemberTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataMemberTests.java deleted file mode 100644 index c31950361d1f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataMemberTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GcpOrganizationalDataMember; -import org.junit.jupiter.api.Assertions; - -public final class GcpOrganizationalDataMemberTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GcpOrganizationalDataMember model = - BinaryData - .fromString( - "{\"organizationMembershipType\":\"Member\",\"parentHierarchyId\":\"atxtjrrlkmdskjhh\",\"managementProjectNumber\":\"lajfoxcxscvslxlh\"}") - .toObject(GcpOrganizationalDataMember.class); - Assertions.assertEquals("atxtjrrlkmdskjhh", model.parentHierarchyId()); - Assertions.assertEquals("lajfoxcxscvslxlh", model.managementProjectNumber()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GcpOrganizationalDataMember model = - new GcpOrganizationalDataMember() - .withParentHierarchyId("atxtjrrlkmdskjhh") - .withManagementProjectNumber("lajfoxcxscvslxlh"); - model = BinaryData.fromObject(model).toObject(GcpOrganizationalDataMember.class); - Assertions.assertEquals("atxtjrrlkmdskjhh", model.parentHierarchyId()); - Assertions.assertEquals("lajfoxcxscvslxlh", model.managementProjectNumber()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataOrganizationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataOrganizationTests.java deleted file mode 100644 index da7ac224d1dc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataOrganizationTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GcpOrganizationalDataOrganization; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class GcpOrganizationalDataOrganizationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GcpOrganizationalDataOrganization model = - BinaryData - .fromString( - "{\"organizationMembershipType\":\"Organization\",\"excludedProjectNumbers\":[\"rlefgnaavu\",\"gnteta\",\"utnpdctuhspfefyi\",\"duyeuyl\"],\"serviceAccountEmailAddress\":\"hmtybkcgsuthhll\",\"workloadIdentityProviderId\":\"wynefx\",\"organizationName\":\"lf\"}") - .toObject(GcpOrganizationalDataOrganization.class); - Assertions.assertEquals("rlefgnaavu", model.excludedProjectNumbers().get(0)); - Assertions.assertEquals("hmtybkcgsuthhll", model.serviceAccountEmailAddress()); - Assertions.assertEquals("wynefx", model.workloadIdentityProviderId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GcpOrganizationalDataOrganization model = - new GcpOrganizationalDataOrganization() - .withExcludedProjectNumbers(Arrays.asList("rlefgnaavu", "gnteta", "utnpdctuhspfefyi", "duyeuyl")) - .withServiceAccountEmailAddress("hmtybkcgsuthhll") - .withWorkloadIdentityProviderId("wynefx"); - model = BinaryData.fromObject(model).toObject(GcpOrganizationalDataOrganization.class); - Assertions.assertEquals("rlefgnaavu", model.excludedProjectNumbers().get(0)); - Assertions.assertEquals("hmtybkcgsuthhll", model.serviceAccountEmailAddress()); - Assertions.assertEquals("wynefx", model.workloadIdentityProviderId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataTests.java deleted file mode 100644 index 0249f77d9859..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GcpOrganizationalData; - -public final class GcpOrganizationalDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GcpOrganizationalData model = - BinaryData - .fromString("{\"organizationMembershipType\":\"GcpOrganizationalData\"}") - .toObject(GcpOrganizationalData.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GcpOrganizationalData model = new GcpOrganizationalData(); - model = BinaryData.fromObject(model).toObject(GcpOrganizationalData.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpProjectDetailsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpProjectDetailsTests.java deleted file mode 100644 index 5aafb2dce0c0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpProjectDetailsTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GcpProjectDetails; -import org.junit.jupiter.api.Assertions; - -public final class GcpProjectDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GcpProjectDetails model = - BinaryData - .fromString( - "{\"projectNumber\":\"rsidqpxlbtpakf\",\"projectId\":\"gatwmykyu\",\"workloadIdentityPoolId\":\"ym\",\"projectName\":\"mfjhpycvjqdvdwkq\"}") - .toObject(GcpProjectDetails.class); - Assertions.assertEquals("rsidqpxlbtpakf", model.projectNumber()); - Assertions.assertEquals("gatwmykyu", model.projectId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GcpProjectDetails model = - new GcpProjectDetails().withProjectNumber("rsidqpxlbtpakf").withProjectId("gatwmykyu"); - model = BinaryData.fromObject(model).toObject(GcpProjectDetails.class); - Assertions.assertEquals("rsidqpxlbtpakf", model.projectNumber()); - Assertions.assertEquals("gatwmykyu", model.projectId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpProjectEnvironmentDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpProjectEnvironmentDataTests.java deleted file mode 100644 index b9609d7436ab..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpProjectEnvironmentDataTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GcpOrganizationalData; -import com.azure.resourcemanager.security.models.GcpProjectDetails; -import com.azure.resourcemanager.security.models.GcpProjectEnvironmentData; -import org.junit.jupiter.api.Assertions; - -public final class GcpProjectEnvironmentDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GcpProjectEnvironmentData model = - BinaryData - .fromString( - "{\"environmentType\":\"GcpProject\",\"organizationalData\":{\"organizationMembershipType\":\"GcpOrganizationalData\"},\"projectDetails\":{\"projectNumber\":\"dfpdqwtygevg\",\"projectId\":\"sehar\",\"workloadIdentityPoolId\":\"fv\",\"projectName\":\"rxtmbpjptnvw\"}}") - .toObject(GcpProjectEnvironmentData.class); - Assertions.assertEquals("dfpdqwtygevg", model.projectDetails().projectNumber()); - Assertions.assertEquals("sehar", model.projectDetails().projectId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GcpProjectEnvironmentData model = - new GcpProjectEnvironmentData() - .withOrganizationalData(new GcpOrganizationalData()) - .withProjectDetails(new GcpProjectDetails().withProjectNumber("dfpdqwtygevg").withProjectId("sehar")); - model = BinaryData.fromObject(model).toObject(GcpProjectEnvironmentData.class); - Assertions.assertEquals("dfpdqwtygevg", model.projectDetails().projectNumber()); - Assertions.assertEquals("sehar", model.projectDetails().projectId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GithubScopeEnvironmentDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GithubScopeEnvironmentDataTests.java deleted file mode 100644 index 417e9df0ab9e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GithubScopeEnvironmentDataTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GithubScopeEnvironmentData; - -public final class GithubScopeEnvironmentDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GithubScopeEnvironmentData model = - BinaryData.fromString("{\"environmentType\":\"GithubScope\"}").toObject(GithubScopeEnvironmentData.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GithubScopeEnvironmentData model = new GithubScopeEnvironmentData(); - model = BinaryData.fromObject(model).toObject(GithubScopeEnvironmentData.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitlabScopeEnvironmentDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitlabScopeEnvironmentDataTests.java deleted file mode 100644 index 4d3f168d78d2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitlabScopeEnvironmentDataTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GitlabScopeEnvironmentData; - -public final class GitlabScopeEnvironmentDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GitlabScopeEnvironmentData model = - BinaryData.fromString("{\"environmentType\":\"GitlabScope\"}").toObject(GitlabScopeEnvironmentData.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GitlabScopeEnvironmentData model = new GitlabScopeEnvironmentData(); - model = BinaryData.fromObject(model).toObject(GitlabScopeEnvironmentData.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentAdditionalDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentAdditionalDataTests.java deleted file mode 100644 index 136043399b91..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentAdditionalDataTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GovernanceAssignmentAdditionalData; -import org.junit.jupiter.api.Assertions; - -public final class GovernanceAssignmentAdditionalDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceAssignmentAdditionalData model = - BinaryData - .fromString("{\"ticketNumber\":885021040,\"ticketLink\":\"njuhpsprkzya\",\"ticketStatus\":\"ia\"}") - .toObject(GovernanceAssignmentAdditionalData.class); - Assertions.assertEquals(885021040, model.ticketNumber()); - Assertions.assertEquals("njuhpsprkzya", model.ticketLink()); - Assertions.assertEquals("ia", model.ticketStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceAssignmentAdditionalData model = - new GovernanceAssignmentAdditionalData() - .withTicketNumber(885021040) - .withTicketLink("njuhpsprkzya") - .withTicketStatus("ia"); - model = BinaryData.fromObject(model).toObject(GovernanceAssignmentAdditionalData.class); - Assertions.assertEquals(885021040, model.ticketNumber()); - Assertions.assertEquals("njuhpsprkzya", model.ticketLink()); - Assertions.assertEquals("ia", model.ticketStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentInnerTests.java deleted file mode 100644 index c48520226212..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentInnerTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.GovernanceAssignmentInner; -import com.azure.resourcemanager.security.models.GovernanceAssignmentAdditionalData; -import com.azure.resourcemanager.security.models.GovernanceEmailNotification; -import com.azure.resourcemanager.security.models.RemediationEta; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class GovernanceAssignmentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceAssignmentInner model = - BinaryData - .fromString( - "{\"properties\":{\"owner\":\"wzfgbrttuiaclkie\",\"remediationDueDate\":\"2021-01-24T04:29:25Z\",\"remediationEta\":{\"eta\":\"2021-03-15T08:06:52Z\",\"justification\":\"lfnthiqfyut\"},\"isGracePeriod\":false,\"governanceEmailNotification\":{\"disableManagerEmailNotification\":false,\"disableOwnerEmailNotification\":false},\"additionalData\":{\"ticketNumber\":1375874232,\"ticketLink\":\"mtx\",\"ticketStatus\":\"ctwwgzw\"}},\"id\":\"jlmec\",\"name\":\"og\",\"type\":\"gzyvnee\"}") - .toObject(GovernanceAssignmentInner.class); - Assertions.assertEquals("wzfgbrttuiaclkie", model.owner()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-24T04:29:25Z"), model.remediationDueDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-15T08:06:52Z"), model.remediationEta().eta()); - Assertions.assertEquals("lfnthiqfyut", model.remediationEta().justification()); - Assertions.assertEquals(false, model.isGracePeriod()); - Assertions.assertEquals(false, model.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(false, model.governanceEmailNotification().disableOwnerEmailNotification()); - Assertions.assertEquals(1375874232, model.additionalData().ticketNumber()); - Assertions.assertEquals("mtx", model.additionalData().ticketLink()); - Assertions.assertEquals("ctwwgzw", model.additionalData().ticketStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceAssignmentInner model = - new GovernanceAssignmentInner() - .withOwner("wzfgbrttuiaclkie") - .withRemediationDueDate(OffsetDateTime.parse("2021-01-24T04:29:25Z")) - .withRemediationEta( - new RemediationEta() - .withEta(OffsetDateTime.parse("2021-03-15T08:06:52Z")) - .withJustification("lfnthiqfyut")) - .withIsGracePeriod(false) - .withGovernanceEmailNotification( - new GovernanceEmailNotification() - .withDisableManagerEmailNotification(false) - .withDisableOwnerEmailNotification(false)) - .withAdditionalData( - new GovernanceAssignmentAdditionalData() - .withTicketNumber(1375874232) - .withTicketLink("mtx") - .withTicketStatus("ctwwgzw")); - model = BinaryData.fromObject(model).toObject(GovernanceAssignmentInner.class); - Assertions.assertEquals("wzfgbrttuiaclkie", model.owner()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-24T04:29:25Z"), model.remediationDueDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-15T08:06:52Z"), model.remediationEta().eta()); - Assertions.assertEquals("lfnthiqfyut", model.remediationEta().justification()); - Assertions.assertEquals(false, model.isGracePeriod()); - Assertions.assertEquals(false, model.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(false, model.governanceEmailNotification().disableOwnerEmailNotification()); - Assertions.assertEquals(1375874232, model.additionalData().ticketNumber()); - Assertions.assertEquals("mtx", model.additionalData().ticketLink()); - Assertions.assertEquals("ctwwgzw", model.additionalData().ticketStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentPropertiesTests.java deleted file mode 100644 index f39d10fb18c4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentPropertiesTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.GovernanceAssignmentProperties; -import com.azure.resourcemanager.security.models.GovernanceAssignmentAdditionalData; -import com.azure.resourcemanager.security.models.GovernanceEmailNotification; -import com.azure.resourcemanager.security.models.RemediationEta; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class GovernanceAssignmentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceAssignmentProperties model = - BinaryData - .fromString( - "{\"owner\":\"ifgh\",\"remediationDueDate\":\"2021-06-10T17:08:41Z\",\"remediationEta\":{\"eta\":\"2021-08-19T14:37:02Z\",\"justification\":\"qtlffhzbk\"},\"isGracePeriod\":true,\"governanceEmailNotification\":{\"disableManagerEmailNotification\":true,\"disableOwnerEmailNotification\":true},\"additionalData\":{\"ticketNumber\":1233073634,\"ticketLink\":\"nq\",\"ticketStatus\":\"wdogiyetesyp\"}}") - .toObject(GovernanceAssignmentProperties.class); - Assertions.assertEquals("ifgh", model.owner()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T17:08:41Z"), model.remediationDueDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-19T14:37:02Z"), model.remediationEta().eta()); - Assertions.assertEquals("qtlffhzbk", model.remediationEta().justification()); - Assertions.assertEquals(true, model.isGracePeriod()); - Assertions.assertEquals(true, model.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(true, model.governanceEmailNotification().disableOwnerEmailNotification()); - Assertions.assertEquals(1233073634, model.additionalData().ticketNumber()); - Assertions.assertEquals("nq", model.additionalData().ticketLink()); - Assertions.assertEquals("wdogiyetesyp", model.additionalData().ticketStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceAssignmentProperties model = - new GovernanceAssignmentProperties() - .withOwner("ifgh") - .withRemediationDueDate(OffsetDateTime.parse("2021-06-10T17:08:41Z")) - .withRemediationEta( - new RemediationEta() - .withEta(OffsetDateTime.parse("2021-08-19T14:37:02Z")) - .withJustification("qtlffhzbk")) - .withIsGracePeriod(true) - .withGovernanceEmailNotification( - new GovernanceEmailNotification() - .withDisableManagerEmailNotification(true) - .withDisableOwnerEmailNotification(true)) - .withAdditionalData( - new GovernanceAssignmentAdditionalData() - .withTicketNumber(1233073634) - .withTicketLink("nq") - .withTicketStatus("wdogiyetesyp")); - model = BinaryData.fromObject(model).toObject(GovernanceAssignmentProperties.class); - Assertions.assertEquals("ifgh", model.owner()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T17:08:41Z"), model.remediationDueDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-19T14:37:02Z"), model.remediationEta().eta()); - Assertions.assertEquals("qtlffhzbk", model.remediationEta().justification()); - Assertions.assertEquals(true, model.isGracePeriod()); - Assertions.assertEquals(true, model.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(true, model.governanceEmailNotification().disableOwnerEmailNotification()); - Assertions.assertEquals(1233073634, model.additionalData().ticketNumber()); - Assertions.assertEquals("nq", model.additionalData().ticketLink()); - Assertions.assertEquals("wdogiyetesyp", model.additionalData().ticketStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index ff420b6923fc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.GovernanceAssignment; -import com.azure.resourcemanager.security.models.GovernanceAssignmentAdditionalData; -import com.azure.resourcemanager.security.models.GovernanceEmailNotification; -import com.azure.resourcemanager.security.models.RemediationEta; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GovernanceAssignmentsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"owner\":\"jjzgxqgqw\",\"remediationDueDate\":\"2021-06-27T22:34:45Z\",\"remediationEta\":{\"eta\":\"2021-09-27T23:54:35Z\",\"justification\":\"gtvh\"},\"isGracePeriod\":false,\"governanceEmailNotification\":{\"disableManagerEmailNotification\":true,\"disableOwnerEmailNotification\":false},\"additionalData\":{\"ticketNumber\":1254338347,\"ticketLink\":\"zejogmkorvvmvm\",\"ticketStatus\":\"fnqh\"}},\"id\":\"bsn\",\"name\":\"snqliwkmzojfe\",\"type\":\"yalhtgm\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - GovernanceAssignment response = - manager - .governanceAssignments() - .define("canzb") - .withExistingAssessment("kgdet", "z") - .withOwner("wu") - .withRemediationDueDate(OffsetDateTime.parse("2021-04-13T16:18:12Z")) - .withRemediationEta( - new RemediationEta() - .withEta(OffsetDateTime.parse("2021-10-14T16:12:54Z")) - .withJustification("vnensmuffiw")) - .withIsGracePeriod(true) - .withGovernanceEmailNotification( - new GovernanceEmailNotification() - .withDisableManagerEmailNotification(true) - .withDisableOwnerEmailNotification(true)) - .withAdditionalData( - new GovernanceAssignmentAdditionalData() - .withTicketNumber(844736587) - .withTicketLink("totdxposcslh") - .withTicketStatus("usiecktybhjuxid")) - .create(); - - Assertions.assertEquals("jjzgxqgqw", response.owner()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-27T22:34:45Z"), response.remediationDueDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T23:54:35Z"), response.remediationEta().eta()); - Assertions.assertEquals("gtvh", response.remediationEta().justification()); - Assertions.assertEquals(false, response.isGracePeriod()); - Assertions.assertEquals(true, response.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(false, response.governanceEmailNotification().disableOwnerEmailNotification()); - Assertions.assertEquals(1254338347, response.additionalData().ticketNumber()); - Assertions.assertEquals("zejogmkorvvmvm", response.additionalData().ticketLink()); - Assertions.assertEquals("fnqh", response.additionalData().ticketStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsDeleteWithResponseMockTests.java deleted file mode 100644 index d70eb2bae786..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GovernanceAssignmentsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.governanceAssignments().deleteWithResponse("iqegm", "db", "ohcwhpyv", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsGetWithResponseMockTests.java deleted file mode 100644 index 1ca23309416b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsGetWithResponseMockTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.GovernanceAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GovernanceAssignmentsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"owner\":\"w\",\"remediationDueDate\":\"2021-05-03T11:44:34Z\",\"remediationEta\":{\"eta\":\"2021-04-13T20:47Z\",\"justification\":\"ioctqk\"},\"isGracePeriod\":false,\"governanceEmailNotification\":{\"disableManagerEmailNotification\":true,\"disableOwnerEmailNotification\":true},\"additionalData\":{\"ticketNumber\":27888858,\"ticketLink\":\"tj\",\"ticketStatus\":\"oss\"}},\"id\":\"fjxtvlxxzqfc\",\"name\":\"rr\",\"type\":\"omxeezwyhjmb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - GovernanceAssignment response = - manager - .governanceAssignments() - .getWithResponse("wgsoriobijeiydy", "uynhbokayrgwybr", "opdweoft", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("w", response.owner()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-03T11:44:34Z"), response.remediationDueDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-13T20:47Z"), response.remediationEta().eta()); - Assertions.assertEquals("ioctqk", response.remediationEta().justification()); - Assertions.assertEquals(false, response.isGracePeriod()); - Assertions.assertEquals(true, response.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(true, response.governanceEmailNotification().disableOwnerEmailNotification()); - Assertions.assertEquals(27888858, response.additionalData().ticketNumber()); - Assertions.assertEquals("tj", response.additionalData().ticketLink()); - Assertions.assertEquals("oss", response.additionalData().ticketStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListMockTests.java deleted file mode 100644 index 82014d8dfbe5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListMockTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.GovernanceAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GovernanceAssignmentsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"owner\":\"npxraqawbmpspf\",\"remediationDueDate\":\"2021-02-16T15:05:28Z\",\"remediationEta\":{\"eta\":\"2021-05-30T23:09:04Z\",\"justification\":\"ocvvujexayglxrk\"},\"isGracePeriod\":false,\"governanceEmailNotification\":{\"disableManagerEmailNotification\":true,\"disableOwnerEmailNotification\":true},\"additionalData\":{\"ticketNumber\":1922725665,\"ticketLink\":\"jfiuofpi\",\"ticketStatus\":\"dzlvssqywj\"}},\"id\":\"packyh\",\"name\":\"dvikm\",\"type\":\"ngpmillxgjsci\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.governanceAssignments().list("khowgomvvhxow", "c", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("npxraqawbmpspf", response.iterator().next().owner()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-02-16T15:05:28Z"), response.iterator().next().remediationDueDate()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-05-30T23:09:04Z"), response.iterator().next().remediationEta().eta()); - Assertions.assertEquals("ocvvujexayglxrk", response.iterator().next().remediationEta().justification()); - Assertions.assertEquals(false, response.iterator().next().isGracePeriod()); - Assertions - .assertEquals( - true, response.iterator().next().governanceEmailNotification().disableManagerEmailNotification()); - Assertions - .assertEquals( - true, response.iterator().next().governanceEmailNotification().disableOwnerEmailNotification()); - Assertions.assertEquals(1922725665, response.iterator().next().additionalData().ticketNumber()); - Assertions.assertEquals("jfiuofpi", response.iterator().next().additionalData().ticketLink()); - Assertions.assertEquals("dzlvssqywj", response.iterator().next().additionalData().ticketStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListTests.java deleted file mode 100644 index a52e9b7b2cbd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GovernanceAssignmentsList; - -public final class GovernanceAssignmentsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceAssignmentsList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"owner\":\"ny\",\"remediationDueDate\":\"2021-07-02T15:24:24Z\",\"isGracePeriod\":true},\"id\":\"nsrpmeyy\",\"name\":\"pkpatlbijpzgsks\",\"type\":\"fhfv\"}],\"nextLink\":\"mknbnxwcdommpv\"}") - .toObject(GovernanceAssignmentsList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceAssignmentsList model = new GovernanceAssignmentsList(); - model = BinaryData.fromObject(model).toObject(GovernanceAssignmentsList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceEmailNotificationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceEmailNotificationTests.java deleted file mode 100644 index c4a0f5b47213..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceEmailNotificationTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GovernanceEmailNotification; -import org.junit.jupiter.api.Assertions; - -public final class GovernanceEmailNotificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceEmailNotification model = - BinaryData - .fromString("{\"disableManagerEmailNotification\":false,\"disableOwnerEmailNotification\":true}") - .toObject(GovernanceEmailNotification.class); - Assertions.assertEquals(false, model.disableManagerEmailNotification()); - Assertions.assertEquals(true, model.disableOwnerEmailNotification()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceEmailNotification model = - new GovernanceEmailNotification() - .withDisableManagerEmailNotification(false) - .withDisableOwnerEmailNotification(true); - model = BinaryData.fromObject(model).toObject(GovernanceEmailNotification.class); - Assertions.assertEquals(false, model.disableManagerEmailNotification()); - Assertions.assertEquals(true, model.disableOwnerEmailNotification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleEmailNotificationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleEmailNotificationTests.java deleted file mode 100644 index a83db39ccb7a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleEmailNotificationTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; -import org.junit.jupiter.api.Assertions; - -public final class GovernanceRuleEmailNotificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceRuleEmailNotification model = - BinaryData - .fromString("{\"disableManagerEmailNotification\":false,\"disableOwnerEmailNotification\":true}") - .toObject(GovernanceRuleEmailNotification.class); - Assertions.assertEquals(false, model.disableManagerEmailNotification()); - Assertions.assertEquals(true, model.disableOwnerEmailNotification()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceRuleEmailNotification model = - new GovernanceRuleEmailNotification() - .withDisableManagerEmailNotification(false) - .withDisableOwnerEmailNotification(true); - model = BinaryData.fromObject(model).toObject(GovernanceRuleEmailNotification.class); - Assertions.assertEquals(false, model.disableManagerEmailNotification()); - Assertions.assertEquals(true, model.disableOwnerEmailNotification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleInnerTests.java deleted file mode 100644 index c6715cea6442..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleInnerTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; -import com.azure.resourcemanager.security.models.GovernanceRuleMetadata; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class GovernanceRuleInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceRuleInner model = - BinaryData - .fromString( - "{\"properties\":{\"tenantId\":\"liufiqwoyxq\",\"displayName\":\"apcohhouc\",\"description\":\"q\",\"remediationTimeframe\":\"xcxzrzdcgdzben\",\"isGracePeriod\":false,\"rulePriority\":314467274,\"isDisabled\":true,\"ruleType\":\"Integrated\",\"sourceResourceType\":\"Assessments\",\"excludedScopes\":[\"ddtjwfljhznam\"],\"conditionSets\":[\"dataatmzw\",\"datajj\",\"datacqtjzmi\",\"datavgbgatzuuvbxng\"],\"includeMemberScopes\":false,\"ownerSource\":{\"type\":\"ByTag\",\"value\":\"ahttzlswvajqfut\"},\"governanceEmailNotification\":{\"disableManagerEmailNotification\":false,\"disableOwnerEmailNotification\":true},\"metadata\":{\"createdBy\":\"unwqr\",\"createdOn\":\"2021-01-05T19:17:25Z\",\"updatedBy\":\"gqhaohcmbuocn\",\"updatedOn\":\"2021-05-14T07:13:07Z\"}},\"id\":\"hmbpyryxamebly\",\"name\":\"yvk\",\"type\":\"kmrocxne\"}") - .toObject(GovernanceRuleInner.class); - Assertions.assertEquals("apcohhouc", model.displayName()); - Assertions.assertEquals("q", model.description()); - Assertions.assertEquals("xcxzrzdcgdzben", model.remediationTimeframe()); - Assertions.assertEquals(false, model.isGracePeriod()); - Assertions.assertEquals(314467274, model.rulePriority()); - Assertions.assertEquals(true, model.isDisabled()); - Assertions.assertEquals(GovernanceRuleType.INTEGRATED, model.ruleType()); - Assertions.assertEquals(GovernanceRuleSourceResourceType.ASSESSMENTS, model.sourceResourceType()); - Assertions.assertEquals("ddtjwfljhznam", model.excludedScopes().get(0)); - Assertions.assertEquals(false, model.includeMemberScopes()); - Assertions.assertEquals(GovernanceRuleOwnerSourceType.BY_TAG, model.ownerSource().type()); - Assertions.assertEquals("ahttzlswvajqfut", model.ownerSource().value()); - Assertions.assertEquals(false, model.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(true, model.governanceEmailNotification().disableOwnerEmailNotification()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceRuleInner model = - new GovernanceRuleInner() - .withDisplayName("apcohhouc") - .withDescription("q") - .withRemediationTimeframe("xcxzrzdcgdzben") - .withIsGracePeriod(false) - .withRulePriority(314467274) - .withIsDisabled(true) - .withRuleType(GovernanceRuleType.INTEGRATED) - .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) - .withExcludedScopes(Arrays.asList("ddtjwfljhznam")) - .withConditionSets(Arrays.asList("dataatmzw", "datajj", "datacqtjzmi", "datavgbgatzuuvbxng")) - .withIncludeMemberScopes(false) - .withOwnerSource( - new GovernanceRuleOwnerSource() - .withType(GovernanceRuleOwnerSourceType.BY_TAG) - .withValue("ahttzlswvajqfut")) - .withGovernanceEmailNotification( - new GovernanceRuleEmailNotification() - .withDisableManagerEmailNotification(false) - .withDisableOwnerEmailNotification(true)) - .withMetadata(new GovernanceRuleMetadata()); - model = BinaryData.fromObject(model).toObject(GovernanceRuleInner.class); - Assertions.assertEquals("apcohhouc", model.displayName()); - Assertions.assertEquals("q", model.description()); - Assertions.assertEquals("xcxzrzdcgdzben", model.remediationTimeframe()); - Assertions.assertEquals(false, model.isGracePeriod()); - Assertions.assertEquals(314467274, model.rulePriority()); - Assertions.assertEquals(true, model.isDisabled()); - Assertions.assertEquals(GovernanceRuleType.INTEGRATED, model.ruleType()); - Assertions.assertEquals(GovernanceRuleSourceResourceType.ASSESSMENTS, model.sourceResourceType()); - Assertions.assertEquals("ddtjwfljhznam", model.excludedScopes().get(0)); - Assertions.assertEquals(false, model.includeMemberScopes()); - Assertions.assertEquals(GovernanceRuleOwnerSourceType.BY_TAG, model.ownerSource().type()); - Assertions.assertEquals("ahttzlswvajqfut", model.ownerSource().value()); - Assertions.assertEquals(false, model.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(true, model.governanceEmailNotification().disableOwnerEmailNotification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleListTests.java deleted file mode 100644 index 62c6e0f78e0f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GovernanceRuleList; - -public final class GovernanceRuleListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceRuleList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"tenantId\":\"p\",\"displayName\":\"bkdq\",\"description\":\"dzsylollgtrczz\",\"remediationTimeframe\":\"mxzjijpvua\",\"isGracePeriod\":true,\"rulePriority\":153071773,\"isDisabled\":false,\"ruleType\":\"Integrated\",\"sourceResourceType\":\"Assessments\",\"excludedScopes\":[],\"conditionSets\":[],\"includeMemberScopes\":true},\"id\":\"rdcoxnbkkj\",\"name\":\"nurnnq\",\"type\":\"nqbpi\"},{\"properties\":{\"tenantId\":\"ltgrdogypxrxv\",\"displayName\":\"fihwu\",\"description\":\"ctafsrbxrblm\",\"remediationTimeframe\":\"owxih\",\"isGracePeriod\":false,\"rulePriority\":491471659,\"isDisabled\":true,\"ruleType\":\"ServiceNow\",\"sourceResourceType\":\"Assessments\",\"excludedScopes\":[],\"conditionSets\":[],\"includeMemberScopes\":true},\"id\":\"aklsbsbq\",\"name\":\"qagwwrxaomz\",\"type\":\"sgl\"},{\"properties\":{\"tenantId\":\"zezkhhltnjadh\",\"displayName\":\"oawjqoyueay\",\"description\":\"pcmsplbyrrueqth\",\"remediationTimeframe\":\"gnmbscbbxigdhx\",\"isGracePeriod\":false,\"rulePriority\":1518081378,\"isDisabled\":true,\"ruleType\":\"Integrated\",\"sourceResourceType\":\"Assessments\",\"excludedScopes\":[],\"conditionSets\":[],\"includeMemberScopes\":true},\"id\":\"qyybxubmdnafcbq\",\"name\":\"remj\",\"type\":\"laqacigele\"},{\"properties\":{\"tenantId\":\"bvqvwzkjopwbeo\",\"displayName\":\"r\",\"description\":\"wzdqybxceakxcpts\",\"remediationTimeframe\":\"fyiaseqch\",\"isGracePeriod\":true,\"rulePriority\":375914410,\"isDisabled\":false,\"ruleType\":\"Integrated\",\"sourceResourceType\":\"Assessments\",\"excludedScopes\":[],\"conditionSets\":[],\"includeMemberScopes\":false},\"id\":\"iuemvanbwzohmnr\",\"name\":\"xbsojkli\",\"type\":\"hmdp\"}],\"nextLink\":\"sprqsgnzxojpslsv\"}") - .toObject(GovernanceRuleList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceRuleList model = new GovernanceRuleList(); - model = BinaryData.fromObject(model).toObject(GovernanceRuleList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleMetadataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleMetadataTests.java deleted file mode 100644 index ac4d620cc5c8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleMetadataTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GovernanceRuleMetadata; - -public final class GovernanceRuleMetadataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceRuleMetadata model = - BinaryData - .fromString( - "{\"createdBy\":\"dvrmazlpd\",\"createdOn\":\"2021-01-11T12:00:50Z\",\"updatedBy\":\"ymzvla\",\"updatedOn\":\"2021-05-17T23:09:54Z\"}") - .toObject(GovernanceRuleMetadata.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceRuleMetadata model = new GovernanceRuleMetadata(); - model = BinaryData.fromObject(model).toObject(GovernanceRuleMetadata.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleOwnerSourceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleOwnerSourceTests.java deleted file mode 100644 index 67374d090a31..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleOwnerSourceTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSourceType; -import org.junit.jupiter.api.Assertions; - -public final class GovernanceRuleOwnerSourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceRuleOwnerSource model = - BinaryData - .fromString("{\"type\":\"ByTag\",\"value\":\"vfkoxml\"}") - .toObject(GovernanceRuleOwnerSource.class); - Assertions.assertEquals(GovernanceRuleOwnerSourceType.BY_TAG, model.type()); - Assertions.assertEquals("vfkoxml", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceRuleOwnerSource model = - new GovernanceRuleOwnerSource().withType(GovernanceRuleOwnerSourceType.BY_TAG).withValue("vfkoxml"); - model = BinaryData.fromObject(model).toObject(GovernanceRuleOwnerSource.class); - Assertions.assertEquals(GovernanceRuleOwnerSourceType.BY_TAG, model.type()); - Assertions.assertEquals("vfkoxml", model.value()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulePropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulePropertiesTests.java deleted file mode 100644 index e80930dfba71..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulePropertiesTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleProperties; -import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; -import com.azure.resourcemanager.security.models.GovernanceRuleMetadata; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class GovernanceRulePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceRuleProperties model = - BinaryData - .fromString( - "{\"tenantId\":\"sm\",\"displayName\":\"odlfpyapucygvo\",\"description\":\"yunssx\",\"remediationTimeframe\":\"hi\",\"isGracePeriod\":true,\"rulePriority\":230828821,\"isDisabled\":false,\"ruleType\":\"Integrated\",\"sourceResourceType\":\"Assessments\",\"excludedScopes\":[\"seksgbux\",\"ntuygdhgaqipir\",\"iwrqofulopmjnl\",\"x\"],\"conditionSets\":[\"datacbjpibkephuu\",\"dataerctatoyin\"],\"includeMemberScopes\":true,\"ownerSource\":{\"type\":\"ByTag\",\"value\":\"cyrduczkg\"},\"governanceEmailNotification\":{\"disableManagerEmailNotification\":false,\"disableOwnerEmailNotification\":true},\"metadata\":{\"createdBy\":\"cvcrrp\",\"createdOn\":\"2021-06-14T17:45:27Z\",\"updatedBy\":\"bstvje\",\"updatedOn\":\"2021-06-06T13:44:54Z\"}}") - .toObject(GovernanceRuleProperties.class); - Assertions.assertEquals("odlfpyapucygvo", model.displayName()); - Assertions.assertEquals("yunssx", model.description()); - Assertions.assertEquals("hi", model.remediationTimeframe()); - Assertions.assertEquals(true, model.isGracePeriod()); - Assertions.assertEquals(230828821, model.rulePriority()); - Assertions.assertEquals(false, model.isDisabled()); - Assertions.assertEquals(GovernanceRuleType.INTEGRATED, model.ruleType()); - Assertions.assertEquals(GovernanceRuleSourceResourceType.ASSESSMENTS, model.sourceResourceType()); - Assertions.assertEquals("seksgbux", model.excludedScopes().get(0)); - Assertions.assertEquals(true, model.includeMemberScopes()); - Assertions.assertEquals(GovernanceRuleOwnerSourceType.BY_TAG, model.ownerSource().type()); - Assertions.assertEquals("cyrduczkg", model.ownerSource().value()); - Assertions.assertEquals(false, model.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(true, model.governanceEmailNotification().disableOwnerEmailNotification()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceRuleProperties model = - new GovernanceRuleProperties() - .withDisplayName("odlfpyapucygvo") - .withDescription("yunssx") - .withRemediationTimeframe("hi") - .withIsGracePeriod(true) - .withRulePriority(230828821) - .withIsDisabled(false) - .withRuleType(GovernanceRuleType.INTEGRATED) - .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) - .withExcludedScopes(Arrays.asList("seksgbux", "ntuygdhgaqipir", "iwrqofulopmjnl", "x")) - .withConditionSets(Arrays.asList("datacbjpibkephuu", "dataerctatoyin")) - .withIncludeMemberScopes(true) - .withOwnerSource( - new GovernanceRuleOwnerSource() - .withType(GovernanceRuleOwnerSourceType.BY_TAG) - .withValue("cyrduczkg")) - .withGovernanceEmailNotification( - new GovernanceRuleEmailNotification() - .withDisableManagerEmailNotification(false) - .withDisableOwnerEmailNotification(true)) - .withMetadata(new GovernanceRuleMetadata()); - model = BinaryData.fromObject(model).toObject(GovernanceRuleProperties.class); - Assertions.assertEquals("odlfpyapucygvo", model.displayName()); - Assertions.assertEquals("yunssx", model.description()); - Assertions.assertEquals("hi", model.remediationTimeframe()); - Assertions.assertEquals(true, model.isGracePeriod()); - Assertions.assertEquals(230828821, model.rulePriority()); - Assertions.assertEquals(false, model.isDisabled()); - Assertions.assertEquals(GovernanceRuleType.INTEGRATED, model.ruleType()); - Assertions.assertEquals(GovernanceRuleSourceResourceType.ASSESSMENTS, model.sourceResourceType()); - Assertions.assertEquals("seksgbux", model.excludedScopes().get(0)); - Assertions.assertEquals(true, model.includeMemberScopes()); - Assertions.assertEquals(GovernanceRuleOwnerSourceType.BY_TAG, model.ownerSource().type()); - Assertions.assertEquals("cyrduczkg", model.ownerSource().value()); - Assertions.assertEquals(false, model.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(true, model.governanceEmailNotification().disableOwnerEmailNotification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 08cdf523f1d7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.GovernanceRule; -import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; -import com.azure.resourcemanager.security.models.GovernanceRuleMetadata; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.nio.ByteBuffer; -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 org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GovernanceRulesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"tenantId\":\"jqjpv\",\"displayName\":\"aihxjtgzgtaiywbq\",\"description\":\"oig\",\"remediationTimeframe\":\"fsgsa\",\"isGracePeriod\":false,\"rulePriority\":1919322541,\"isDisabled\":false,\"ruleType\":\"ServiceNow\",\"sourceResourceType\":\"Assessments\",\"excludedScopes\":[\"qlxspmrj\",\"tryldsxebuhsxr\",\"nmgsdaluyckhef\"],\"conditionSets\":[\"datahs\"],\"includeMemberScopes\":false,\"ownerSource\":{\"type\":\"Manually\",\"value\":\"pxebjlud\"},\"governanceEmailNotification\":{\"disableManagerEmailNotification\":true,\"disableOwnerEmailNotification\":true},\"metadata\":{\"createdBy\":\"xdtpry\",\"createdOn\":\"2021-05-23T11:25:30Z\",\"updatedBy\":\"nsewouxl\",\"updatedOn\":\"2021-04-21T21:20:48Z\"}},\"id\":\"vvyljurkepose\",\"name\":\"qqylmpctwjwds\",\"type\":\"lzmkxerxxxotee\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - GovernanceRule response = - manager - .governanceRules() - .define("lhpses") - .withExistingScope("zpvxak") - .withDisplayName("goqg") - .withDescription("yqyxyjrcbqpbis") - .withRemediationTimeframe("lqjoxtda") - .withIsGracePeriod(false) - .withRulePriority(352859817) - .withIsDisabled(false) - .withRuleType(GovernanceRuleType.INTEGRATED) - .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) - .withExcludedScopes(Arrays.asList("ztivfwjl", "fzekfsrm", "uklajvcfoc", "hapejov")) - .withConditionSets(Arrays.asList("datawxn", "datawhhnoyrzaa", "dataee", "datapmjen")) - .withIncludeMemberScopes(false) - .withOwnerSource( - new GovernanceRuleOwnerSource() - .withType(GovernanceRuleOwnerSourceType.MANUALLY) - .withValue("axxcrxoxdj")) - .withGovernanceEmailNotification( - new GovernanceRuleEmailNotification() - .withDisableManagerEmailNotification(false) - .withDisableOwnerEmailNotification(false)) - .withMetadata(new GovernanceRuleMetadata()) - .create(); - - Assertions.assertEquals("aihxjtgzgtaiywbq", response.displayName()); - Assertions.assertEquals("oig", response.description()); - Assertions.assertEquals("fsgsa", response.remediationTimeframe()); - Assertions.assertEquals(false, response.isGracePeriod()); - Assertions.assertEquals(1919322541, response.rulePriority()); - Assertions.assertEquals(false, response.isDisabled()); - Assertions.assertEquals(GovernanceRuleType.SERVICE_NOW, response.ruleType()); - Assertions.assertEquals(GovernanceRuleSourceResourceType.ASSESSMENTS, response.sourceResourceType()); - Assertions.assertEquals("qlxspmrj", response.excludedScopes().get(0)); - Assertions.assertEquals(false, response.includeMemberScopes()); - Assertions.assertEquals(GovernanceRuleOwnerSourceType.MANUALLY, response.ownerSource().type()); - Assertions.assertEquals("pxebjlud", response.ownerSource().value()); - Assertions.assertEquals(true, response.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(true, response.governanceEmailNotification().disableOwnerEmailNotification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesDeleteMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesDeleteMockTests.java deleted file mode 100644 index 17e7f70aa603..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GovernanceRulesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.governanceRules().delete("wpdkktpmbmxbmb", "wgzzxljb", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesGetWithResponseMockTests.java deleted file mode 100644 index f82053789e5d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesGetWithResponseMockTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.GovernanceRule; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GovernanceRulesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"tenantId\":\"j\",\"displayName\":\"n\",\"description\":\"dtjva\",\"remediationTimeframe\":\"yznm\",\"isGracePeriod\":false,\"rulePriority\":1496636288,\"isDisabled\":false,\"ruleType\":\"ServiceNow\",\"sourceResourceType\":\"Assessments\",\"excludedScopes\":[\"gytoxuwhtt\",\"zqsa\"],\"conditionSets\":[\"dataebg\",\"datazplusdekpdzzms\",\"datagpgvokyejidbdq\"],\"includeMemberScopes\":true,\"ownerSource\":{\"type\":\"ByTag\",\"value\":\"cwztlvvws\"},\"governanceEmailNotification\":{\"disableManagerEmailNotification\":false,\"disableOwnerEmailNotification\":true},\"metadata\":{\"createdBy\":\"repwpwfkcaux\",\"createdOn\":\"2021-07-16T09:20:09Z\",\"updatedBy\":\"cpfpdofuckcl\",\"updatedOn\":\"2021-10-21T16:06:31Z\"}},\"id\":\"luevsolzwilfng\",\"name\":\"jfsqeb\",\"type\":\"uxjxhfxf\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - GovernanceRule response = - manager - .governanceRules() - .getWithResponse("gsevmdm", "enlrstgf", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("n", response.displayName()); - Assertions.assertEquals("dtjva", response.description()); - Assertions.assertEquals("yznm", response.remediationTimeframe()); - Assertions.assertEquals(false, response.isGracePeriod()); - Assertions.assertEquals(1496636288, response.rulePriority()); - Assertions.assertEquals(false, response.isDisabled()); - Assertions.assertEquals(GovernanceRuleType.SERVICE_NOW, response.ruleType()); - Assertions.assertEquals(GovernanceRuleSourceResourceType.ASSESSMENTS, response.sourceResourceType()); - Assertions.assertEquals("gytoxuwhtt", response.excludedScopes().get(0)); - Assertions.assertEquals(true, response.includeMemberScopes()); - Assertions.assertEquals(GovernanceRuleOwnerSourceType.BY_TAG, response.ownerSource().type()); - Assertions.assertEquals("cwztlvvws", response.ownerSource().value()); - Assertions.assertEquals(false, response.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(true, response.governanceEmailNotification().disableOwnerEmailNotification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesListMockTests.java deleted file mode 100644 index d5739fd28d74..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesListMockTests.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.GovernanceRule; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GovernanceRulesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"tenantId\":\"oaeoc\",\"displayName\":\"ajtfey\",\"description\":\"bdgddkrh\",\"remediationTimeframe\":\"cxbeuuqutkzwtjww\",\"isGracePeriod\":false,\"rulePriority\":574110550,\"isDisabled\":false,\"ruleType\":\"Integrated\",\"sourceResourceType\":\"Assessments\",\"excludedScopes\":[\"nondegjdyd\"],\"conditionSets\":[\"datakkkbjuckcatuqbh\",\"dataowcnxtpz\",\"datalyseidtoak\",\"datat\"],\"includeMemberScopes\":true,\"ownerSource\":{\"type\":\"ByTag\",\"value\":\"hzbqfdpfawrptvcs\"},\"governanceEmailNotification\":{\"disableManagerEmailNotification\":true,\"disableOwnerEmailNotification\":true},\"metadata\":{\"createdBy\":\"tbqgdirdamm\",\"createdOn\":\"2021-04-05T19:23:11Z\",\"updatedBy\":\"cfjfxtbwjj\",\"updatedOn\":\"2021-06-25T16:41:01Z\"}},\"id\":\"uydgfttmdofgeoa\",\"name\":\"fuof\",\"type\":\"nxodwxmdajwiyg\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.governanceRules().list("yjfzi", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ajtfey", response.iterator().next().displayName()); - Assertions.assertEquals("bdgddkrh", response.iterator().next().description()); - Assertions.assertEquals("cxbeuuqutkzwtjww", response.iterator().next().remediationTimeframe()); - Assertions.assertEquals(false, response.iterator().next().isGracePeriod()); - Assertions.assertEquals(574110550, response.iterator().next().rulePriority()); - Assertions.assertEquals(false, response.iterator().next().isDisabled()); - Assertions.assertEquals(GovernanceRuleType.INTEGRATED, response.iterator().next().ruleType()); - Assertions - .assertEquals( - GovernanceRuleSourceResourceType.ASSESSMENTS, response.iterator().next().sourceResourceType()); - Assertions.assertEquals("nondegjdyd", response.iterator().next().excludedScopes().get(0)); - Assertions.assertEquals(true, response.iterator().next().includeMemberScopes()); - Assertions.assertEquals(GovernanceRuleOwnerSourceType.BY_TAG, response.iterator().next().ownerSource().type()); - Assertions.assertEquals("hzbqfdpfawrptvcs", response.iterator().next().ownerSource().value()); - Assertions - .assertEquals( - true, response.iterator().next().governanceEmailNotification().disableManagerEmailNotification()); - Assertions - .assertEquals( - true, response.iterator().next().governanceEmailNotification().disableOwnerEmailNotification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationResultsWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationResultsWithResponseMockTests.java deleted file mode 100644 index ffe9ddfdb235..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationResultsWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.OperationResultAutoGenerated; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GovernanceRulesOperationResultsWithResponseMockTests { - @Test - public void testOperationResultsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"status\":\"Failed\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationResultAutoGenerated response = - manager - .governanceRules() - .operationResultsWithResponse( - "hxsdplaumydmhwe", "jf", "xydgtokvqbvwg", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HealthDataClassificationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HealthDataClassificationTests.java deleted file mode 100644 index 276de2c075f9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HealthDataClassificationTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.HealthDataClassification; -import com.azure.resourcemanager.security.models.ScopeName; -import org.junit.jupiter.api.Assertions; - -public final class HealthDataClassificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HealthDataClassification model = - BinaryData - .fromString("{\"component\":\"fxjelg\",\"scenario\":\"pzqjhhhq\",\"scope\":\"Connectors\"}") - .toObject(HealthDataClassification.class); - Assertions.assertEquals("fxjelg", model.component()); - Assertions.assertEquals("pzqjhhhq", model.scenario()); - Assertions.assertEquals(ScopeName.CONNECTORS, model.scope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HealthDataClassification model = - new HealthDataClassification() - .withComponent("fxjelg") - .withScenario("pzqjhhhq") - .withScope(ScopeName.CONNECTORS); - model = BinaryData.fromObject(model).toObject(HealthDataClassification.class); - Assertions.assertEquals("fxjelg", model.component()); - Assertions.assertEquals("pzqjhhhq", model.scenario()); - Assertions.assertEquals(ScopeName.CONNECTORS, model.scope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HealthReportsListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HealthReportsListTests.java deleted file mode 100644 index 92a2accc73fd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HealthReportsListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.HealthReportsList; - -public final class HealthReportsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HealthReportsList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"affectedDefendersPlans\":[],\"issues\":[]},\"id\":\"rpq\",\"name\":\"vmblcouqe\",\"type\":\"bhbcdszir\"}],\"nextLink\":\"an\"}") - .toObject(HealthReportsList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HealthReportsList model = new HealthReportsList(); - model = BinaryData.fromObject(model).toObject(HealthReportsList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpC2DMessagesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpC2DMessagesNotInAllowedRangeTests.java deleted file mode 100644 index 945fff22cb97..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpC2DMessagesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.HttpC2DMessagesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class HttpC2DMessagesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HttpC2DMessagesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"HttpC2DMessagesNotInAllowedRange\",\"timeWindowSize\":\"PT97H37M31S\",\"minThreshold\":1748294835,\"maxThreshold\":94404068,\"displayName\":\"mouvbl\",\"description\":\"okzkltr\",\"isEnabled\":true}") - .toObject(HttpC2DMessagesNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1748294835, model.minThreshold()); - Assertions.assertEquals(94404068, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT97H37M31S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HttpC2DMessagesNotInAllowedRange model = - new HttpC2DMessagesNotInAllowedRange() - .withIsEnabled(true) - .withMinThreshold(1748294835) - .withMaxThreshold(94404068) - .withTimeWindowSize(Duration.parse("PT97H37M31S")); - model = BinaryData.fromObject(model).toObject(HttpC2DMessagesNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1748294835, model.minThreshold()); - Assertions.assertEquals(94404068, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT97H37M31S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpC2DRejectedMessagesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpC2DRejectedMessagesNotInAllowedRangeTests.java deleted file mode 100644 index 84b708f60d13..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpC2DRejectedMessagesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.HttpC2DRejectedMessagesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class HttpC2DRejectedMessagesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HttpC2DRejectedMessagesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"HttpC2DRejectedMessagesNotInAllowedRange\",\"timeWindowSize\":\"PT63H43M46S\",\"minThreshold\":290921266,\"maxThreshold\":1500801234,\"displayName\":\"qxmbjroumzzn\",\"description\":\"l\",\"isEnabled\":false}") - .toObject(HttpC2DRejectedMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(290921266, model.minThreshold()); - Assertions.assertEquals(1500801234, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT63H43M46S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HttpC2DRejectedMessagesNotInAllowedRange model = - new HttpC2DRejectedMessagesNotInAllowedRange() - .withIsEnabled(false) - .withMinThreshold(290921266) - .withMaxThreshold(1500801234) - .withTimeWindowSize(Duration.parse("PT63H43M46S")); - model = BinaryData.fromObject(model).toObject(HttpC2DRejectedMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(290921266, model.minThreshold()); - Assertions.assertEquals(1500801234, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT63H43M46S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpD2CMessagesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpD2CMessagesNotInAllowedRangeTests.java deleted file mode 100644 index 9ec53e3fd2fb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpD2CMessagesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.HttpD2CMessagesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class HttpD2CMessagesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HttpD2CMessagesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"HttpD2CMessagesNotInAllowedRange\",\"timeWindowSize\":\"PT111H55M28S\",\"minThreshold\":1174525778,\"maxThreshold\":184797601,\"displayName\":\"jkqev\",\"description\":\"rmmwiuawvcmj\",\"isEnabled\":true}") - .toObject(HttpD2CMessagesNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1174525778, model.minThreshold()); - Assertions.assertEquals(184797601, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT111H55M28S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HttpD2CMessagesNotInAllowedRange model = - new HttpD2CMessagesNotInAllowedRange() - .withIsEnabled(true) - .withMinThreshold(1174525778) - .withMaxThreshold(184797601) - .withTimeWindowSize(Duration.parse("PT111H55M28S")); - model = BinaryData.fromObject(model).toObject(HttpD2CMessagesNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1174525778, model.minThreshold()); - Assertions.assertEquals(184797601, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT111H55M28S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IdentityTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IdentityTests.java deleted file mode 100644 index 16716635e2a9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IdentityTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Identity; -import com.azure.resourcemanager.security.models.ResourceIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class IdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Identity model = - BinaryData - .fromString("{\"principalId\":\"pzfngqjcli\",\"tenantId\":\"tujwjju\",\"type\":\"SystemAssigned\"}") - .toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Identity model = new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED); - model = BinaryData.fromObject(model).toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionAwsOfferingInformationProtectionTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionAwsOfferingInformationProtectionTests.java deleted file mode 100644 index cf5a043d9f54..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionAwsOfferingInformationProtectionTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.InformationProtectionAwsOfferingInformationProtection; -import org.junit.jupiter.api.Assertions; - -public final class InformationProtectionAwsOfferingInformationProtectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InformationProtectionAwsOfferingInformationProtection model = - BinaryData - .fromString("{\"cloudRoleArn\":\"atolekscbc\"}") - .toObject(InformationProtectionAwsOfferingInformationProtection.class); - Assertions.assertEquals("atolekscbc", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InformationProtectionAwsOfferingInformationProtection model = - new InformationProtectionAwsOfferingInformationProtection().withCloudRoleArn("atolekscbc"); - model = BinaryData.fromObject(model).toObject(InformationProtectionAwsOfferingInformationProtection.class); - Assertions.assertEquals("atolekscbc", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionAwsOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionAwsOfferingTests.java deleted file mode 100644 index 06d1cdde4fb0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionAwsOfferingTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.InformationProtectionAwsOffering; -import com.azure.resourcemanager.security.models.InformationProtectionAwsOfferingInformationProtection; -import org.junit.jupiter.api.Assertions; - -public final class InformationProtectionAwsOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InformationProtectionAwsOffering model = - BinaryData - .fromString( - "{\"offeringType\":\"InformationProtectionAws\",\"informationProtection\":{\"cloudRoleArn\":\"ytt\"},\"description\":\"knwfrkebsmhpdujd\"}") - .toObject(InformationProtectionAwsOffering.class); - Assertions.assertEquals("ytt", model.informationProtection().cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InformationProtectionAwsOffering model = - new InformationProtectionAwsOffering() - .withInformationProtection( - new InformationProtectionAwsOfferingInformationProtection().withCloudRoleArn("ytt")); - model = BinaryData.fromObject(model).toObject(InformationProtectionAwsOffering.class); - Assertions.assertEquals("ytt", model.informationProtection().cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionKeywordTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionKeywordTests.java deleted file mode 100644 index d3dedd80d401..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionKeywordTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.InformationProtectionKeyword; -import org.junit.jupiter.api.Assertions; - -public final class InformationProtectionKeywordTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InformationProtectionKeyword model = - BinaryData - .fromString( - "{\"pattern\":\"zlxwabmqoefkifr\",\"custom\":true,\"canBeNumeric\":true,\"excluded\":false}") - .toObject(InformationProtectionKeyword.class); - Assertions.assertEquals("zlxwabmqoefkifr", model.pattern()); - Assertions.assertEquals(true, model.custom()); - Assertions.assertEquals(true, model.canBeNumeric()); - Assertions.assertEquals(false, model.excluded()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InformationProtectionKeyword model = - new InformationProtectionKeyword() - .withPattern("zlxwabmqoefkifr") - .withCustom(true) - .withCanBeNumeric(true) - .withExcluded(false); - model = BinaryData.fromObject(model).toObject(InformationProtectionKeyword.class); - Assertions.assertEquals("zlxwabmqoefkifr", model.pattern()); - Assertions.assertEquals(true, model.custom()); - Assertions.assertEquals(true, model.canBeNumeric()); - Assertions.assertEquals(false, model.excluded()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 6b9bc99e2e6e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.InformationProtectionPolicy; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InformationProtectionPoliciesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"lastModifiedUtc\":\"2021-09-28T10:09:58Z\",\"version\":\"ugggzlfbgrdcgu\",\"labels\":{},\"informationTypes\":{}},\"id\":\"dylperpilttjzgc\",\"name\":\"fcm\",\"type\":\"pfb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - InformationProtectionPolicy response = - manager - .informationProtectionPolicies() - .define(InformationProtectionPolicyName.EFFECTIVE) - .withExistingScope("auwazcgwd") - .withLabels(mapOf()) - .withInformationTypes(mapOf()) - .create(); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetWithResponseMockTests.java deleted file mode 100644 index afe0d0fc390c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.InformationProtectionPolicy; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InformationProtectionPoliciesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"lastModifiedUtc\":\"2021-04-24T13:47:51Z\",\"version\":\"xnxmlbmuoswkj\",\"labels\":{},\"informationTypes\":{}},\"id\":\"cy\",\"name\":\"yzlwhbwzjnufzrf\",\"type\":\"m\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - InformationProtectionPolicy response = - manager - .informationProtectionPolicies() - .getWithResponse("rf", InformationProtectionPolicyName.CUSTOM, com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListMockTests.java deleted file mode 100644 index dc5034b7ba76..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.InformationProtectionPolicy; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InformationProtectionPoliciesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"lastModifiedUtc\":\"2021-01-14T00:19:35Z\",\"version\":\"dzuubjtvgjsxm\",\"labels\":{},\"informationTypes\":{}},\"id\":\"avdpwwobtdphtits\",\"name\":\"fofwan\",\"type\":\"hks\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.informationProtectionPolicies().list("qgnnbz", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPolicyListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPolicyListTests.java deleted file mode 100644 index 95c38e44ca1e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPolicyListTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.InformationProtectionPolicyInner; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -public final class InformationProtectionPolicyListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InformationProtectionPolicyList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"lastModifiedUtc\":\"2021-01-14T06:42:30Z\",\"version\":\"btndo\",\"labels\":{},\"informationTypes\":{}},\"id\":\"gbjcntujitcjed\",\"name\":\"twwaezkojvdcpzf\",\"type\":\"qouicybxarzgsz\"},{\"properties\":{\"lastModifiedUtc\":\"2021-07-26T12:22:12Z\",\"version\":\"iqopidoamciod\",\"labels\":{},\"informationTypes\":{}},\"id\":\"azxkhnzbonlwnto\",\"name\":\"gokdwbwhks\",\"type\":\"zcmrvexztvb\"}],\"nextLink\":\"gsfraoyzkoow\"}") - .toObject(InformationProtectionPolicyList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InformationProtectionPolicyList model = - new InformationProtectionPolicyList() - .withValue( - Arrays - .asList( - new InformationProtectionPolicyInner().withLabels(mapOf()).withInformationTypes(mapOf()), - new InformationProtectionPolicyInner().withLabels(mapOf()).withInformationTypes(mapOf()))); - model = BinaryData.fromObject(model).toObject(InformationProtectionPolicyList.class); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionConnectionStringTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionConnectionStringTests.java deleted file mode 100644 index b2e32e7d4689..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionConnectionStringTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.IngestionConnectionString; - -public final class IngestionConnectionStringTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IngestionConnectionString model = - BinaryData - .fromString("{\"location\":\"d\",\"value\":\"ypivlsbb\"}") - .toObject(IngestionConnectionString.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IngestionConnectionString model = new IngestionConnectionString(); - model = BinaryData.fromObject(model).toObject(IngestionConnectionString.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingInnerTests.java deleted file mode 100644 index 2aa4af3471bf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingInner; - -public final class IngestionSettingInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IngestionSettingInner model = - BinaryData - .fromString("{\"properties\":\"datacqlh\",\"id\":\"isws\",\"name\":\"miii\",\"type\":\"v\"}") - .toObject(IngestionSettingInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IngestionSettingInner model = new IngestionSettingInner().withProperties("datacqlh"); - model = BinaryData.fromObject(model).toObject(IngestionSettingInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingListTests.java deleted file mode 100644 index f261272c0e03..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.IngestionSettingList; - -public final class IngestionSettingListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IngestionSettingList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":\"datamhdroznnhdrlktg\",\"id\":\"csgguxhemlw\",\"name\":\"waeeczgfb\",\"type\":\"kklelssxblycs\"},{\"properties\":\"dataujksrlsmdesqplpv\",\"id\":\"jcdoewb\",\"name\":\"dyvt\",\"type\":\"owx\"},{\"properties\":\"datapiudeugfsxzecpa\",\"id\":\"wkufykhvuhxepm\",\"name\":\"utznabaobns\",\"type\":\"ujdjltymkmvg\"},{\"properties\":\"datahywartspph\",\"id\":\"ixkykxd\",\"name\":\"sj\",\"type\":\"emmucfxh\"}],\"nextLink\":\"kflrmymy\"}") - .toObject(IngestionSettingList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IngestionSettingList model = new IngestionSettingList(); - model = BinaryData.fromObject(model).toObject(IngestionSettingList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsCreateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsCreateWithResponseMockTests.java deleted file mode 100644 index 957fb8471852..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsCreateWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.IngestionSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IngestionSettingsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":\"datanzrsbkkzovlzdmn\",\"id\":\"mfwsxafofu\",\"name\":\"orimmo\",\"type\":\"zwdehkkmvhz\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IngestionSetting response = manager.ingestionSettings().define("ecuyr").withProperties("dataimb").create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteWithResponseMockTests.java deleted file mode 100644 index 4e039d04b20b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IngestionSettingsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.ingestionSettings().deleteWithResponse("ezp", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetWithResponseMockTests.java deleted file mode 100644 index fb7975dc5601..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.IngestionSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IngestionSettingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":\"datafiybxqich\",\"id\":\"ybfzdqekivycp\",\"name\":\"cv\",\"type\":\"izulrqtbht\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IngestionSetting response = - manager.ingestionSettings().getWithResponse("kdtfo", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsWithResponseMockTests.java deleted file mode 100644 index bb78d72945b5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ConnectionStrings; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IngestionSettingsListConnectionStringsWithResponseMockTests { - @Test - public void testListConnectionStringsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"dccgndjgdpriggqq\",\"value\":\"qfcbuul\"},{\"location\":\"uflqjfshtuj\",\"value\":\"ohigimwdcsk\"},{\"location\":\"qnq\",\"value\":\"ixnmbz\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ConnectionStrings response = - manager - .ingestionSettings() - .listConnectionStringsWithResponse("il", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsListMockTests.java deleted file mode 100644 index a8b3100f8f67..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.IngestionSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IngestionSettingsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":\"datahgjnaq\",\"id\":\"qipslz\",\"name\":\"vcdsvm\",\"type\":\"bit\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.ingestionSettings().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertInnerTests.java deleted file mode 100644 index 634b34355835..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertInnerTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedAlertInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IoTSecurityAggregatedAlertInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecurityAggregatedAlertInner model = - BinaryData - .fromString( - "{\"properties\":{\"alertType\":\"riplrbpbewtg\",\"alertDisplayName\":\"gblcgwxzvlvq\",\"vendorName\":\"begibtnmxiebwwa\",\"reportedSeverity\":\"Low\",\"remediationSteps\":\"qcgw\",\"description\":\"zjuzgwyz\",\"count\":4114340895697399622,\"effectedResourceType\":\"ngmtsavjcb\",\"systemSource\":\"xqpsrknftguv\",\"actionTaken\":\"uhprwmdyvxqt\",\"logAnalyticsQuery\":\"riwwroy\",\"topDevicesList\":[{\"deviceId\":\"rmcqiby\",\"alertsCount\":8763943848607308417,\"lastOccurrence\":\"knme\"},{\"deviceId\":\"sgzvahapjyzhpv\",\"alertsCount\":6872658649281325491,\"lastOccurrence\":\"rvxdjzlmw\"},{\"deviceId\":\"kvugfhzovawjvzun\",\"alertsCount\":6384208989627743230,\"lastOccurrence\":\"n\"},{\"deviceId\":\"nxipeil\",\"alertsCount\":7813618899616430195,\"lastOccurrence\":\"e\"}]},\"tags\":{\"mv\":\"ultskzbbtdz\",\"wozuhkf\":\"ekg\"},\"id\":\"bsjyofdx\",\"name\":\"uusdttouwa\",\"type\":\"oekqvk\"}") - .toObject(IoTSecurityAggregatedAlertInner.class); - Assertions.assertEquals("ultskzbbtdz", model.tags().get("mv")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecurityAggregatedAlertInner model = - new IoTSecurityAggregatedAlertInner().withTags(mapOf("mv", "ultskzbbtdz", "wozuhkf", "ekg")); - model = BinaryData.fromObject(model).toObject(IoTSecurityAggregatedAlertInner.class); - Assertions.assertEquals("ultskzbbtdz", model.tags().get("mv")); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertListTests.java deleted file mode 100644 index cb00af9b5533..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertListTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedAlertInner; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlertList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IoTSecurityAggregatedAlertListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecurityAggregatedAlertList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"alertType\":\"b\",\"alertDisplayName\":\"ldawkzbaliourqha\",\"vendorName\":\"hashsfwxosow\",\"reportedSeverity\":\"Medium\",\"remediationSteps\":\"gicjooxdjeb\",\"description\":\"ucww\",\"count\":2907518339137583712,\"effectedResourceType\":\"vmeueci\",\"systemSource\":\"hzceuojgjrwjue\",\"actionTaken\":\"twm\",\"logAnalyticsQuery\":\"ytdxwit\",\"topDevicesList\":[]},\"tags\":{\"kxfbkpycgklwndn\":\"awgqwgxhni\",\"wzbtdhxu\":\"jdauwhvy\"},\"id\":\"znbmpowuwprzq\",\"name\":\"veual\",\"type\":\"pjmkhfxobbc\"}],\"nextLink\":\"s\"}") - .toObject(IoTSecurityAggregatedAlertList.class); - Assertions.assertEquals("awgqwgxhni", model.value().get(0).tags().get("kxfbkpycgklwndn")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecurityAggregatedAlertList model = - new IoTSecurityAggregatedAlertList() - .withValue( - Arrays - .asList( - new IoTSecurityAggregatedAlertInner() - .withTags(mapOf("kxfbkpycgklwndn", "awgqwgxhni", "wzbtdhxu", "jdauwhvy")))); - model = BinaryData.fromObject(model).toObject(IoTSecurityAggregatedAlertList.class); - Assertions.assertEquals("awgqwgxhni", model.value().get(0).tags().get("kxfbkpycgklwndn")); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertPropertiesTests.java deleted file mode 100644 index f2d7da1f12e4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedAlertProperties; - -public final class IoTSecurityAggregatedAlertPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecurityAggregatedAlertProperties model = - BinaryData - .fromString( - "{\"alertType\":\"nsmvbxwyj\",\"alertDisplayName\":\"lh\",\"vendorName\":\"aln\",\"reportedSeverity\":\"High\",\"remediationSteps\":\"sxyawjoyaqcs\",\"description\":\"jpkiidzyexznelix\",\"count\":3030315127445847890,\"effectedResourceType\":\"folhbnxknal\",\"systemSource\":\"lp\",\"actionTaken\":\"gdtpnapnyiro\",\"logAnalyticsQuery\":\"hpigv\",\"topDevicesList\":[{\"deviceId\":\"gqgitxmedjvcsl\",\"alertsCount\":5849348987172300465,\"lastOccurrence\":\"ncw\"},{\"deviceId\":\"hxg\",\"alertsCount\":8312530618702549187,\"lastOccurrence\":\"ucnapkteoellwp\"},{\"deviceId\":\"d\",\"alertsCount\":4494990539994529771,\"lastOccurrence\":\"b\"},{\"deviceId\":\"ceopzfqrhhuaopp\",\"alertsCount\":5543596082951034644,\"lastOccurrence\":\"xolzdahzx\"}]}") - .toObject(IoTSecurityAggregatedAlertProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecurityAggregatedAlertProperties model = new IoTSecurityAggregatedAlertProperties(); - model = BinaryData.fromObject(model).toObject(IoTSecurityAggregatedAlertProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertPropertiesTopDevicesListItemTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertPropertiesTopDevicesListItemTests.java deleted file mode 100644 index bd0e8b85ac1c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertPropertiesTopDevicesListItemTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem; - -public final class IoTSecurityAggregatedAlertPropertiesTopDevicesListItemTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecurityAggregatedAlertPropertiesTopDevicesListItem model = - BinaryData - .fromString( - "{\"deviceId\":\"obgbkdmoizp\",\"alertsCount\":753837388632017239,\"lastOccurrence\":\"rcfbunrm\"}") - .toObject(IoTSecurityAggregatedAlertPropertiesTopDevicesListItem.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecurityAggregatedAlertPropertiesTopDevicesListItem model = - new IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(); - model = BinaryData.fromObject(model).toObject(IoTSecurityAggregatedAlertPropertiesTopDevicesListItem.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationInnerTests.java deleted file mode 100644 index c96292eadcba..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationInnerTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IoTSecurityAggregatedRecommendationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecurityAggregatedRecommendationInner model = - BinaryData - .fromString( - "{\"properties\":{\"recommendationName\":\"hhkxbp\",\"recommendationDisplayName\":\"ymjhxxjyngudivkr\",\"description\":\"wbxqzvszjfau\",\"recommendationTypeId\":\"fdxxivetvtcqaqtd\",\"detectedBy\":\"mcbxvwvxysl\",\"remediationSteps\":\"hsfxoblytkb\",\"reportedSeverity\":\"Informational\",\"healthyDevices\":7965235858819395640,\"unhealthyDeviceCount\":2233870853702293034,\"logAnalyticsQuery\":\"rvrnsvshqjohxc\"},\"tags\":{\"uvwbhsqfs\":\"fovasr\",\"bsrfbj\":\"bcgjbirxbp\",\"otftpvjzbexilz\":\"dtws\",\"qtaruoujmkcjhwq\":\"nfqqnvwp\"},\"id\":\"tjrybnwjewgdr\",\"name\":\"ervnaenqpehi\",\"type\":\"doy\"}") - .toObject(IoTSecurityAggregatedRecommendationInner.class); - Assertions.assertEquals("fovasr", model.tags().get("uvwbhsqfs")); - Assertions.assertEquals("hhkxbp", model.recommendationName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecurityAggregatedRecommendationInner model = - new IoTSecurityAggregatedRecommendationInner() - .withTags( - mapOf( - "uvwbhsqfs", - "fovasr", - "bsrfbj", - "bcgjbirxbp", - "otftpvjzbexilz", - "dtws", - "qtaruoujmkcjhwq", - "nfqqnvwp")) - .withRecommendationName("hhkxbp"); - model = BinaryData.fromObject(model).toObject(IoTSecurityAggregatedRecommendationInner.class); - Assertions.assertEquals("fovasr", model.tags().get("uvwbhsqfs")); - Assertions.assertEquals("hhkxbp", model.recommendationName()); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationListTests.java deleted file mode 100644 index a0132eb01140..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationListTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationInner; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedRecommendationList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IoTSecurityAggregatedRecommendationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecurityAggregatedRecommendationList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"recommendationName\":\"sadbz\",\"recommendationDisplayName\":\"vdfznudaodvxzb\",\"description\":\"blylpstdbh\",\"recommendationTypeId\":\"srzdzucerscdn\",\"detectedBy\":\"evfiwjmygt\",\"remediationSteps\":\"slswtm\",\"reportedSeverity\":\"Medium\",\"healthyDevices\":3002295961372287593,\"unhealthyDeviceCount\":3838355662332369134,\"logAnalyticsQuery\":\"semwabnet\"},\"tags\":{\"wubmwmbesldn\":\"szhedplvw\",\"lcxog\":\"wwtppj\",\"qqkdltfzxmhhvhgu\":\"okonzmnsikvmkqz\",\"xtibqdxbxwakbog\":\"eodkwobda\"},\"id\":\"xndlkzgxhu\",\"name\":\"iplbpodxunkbebxm\",\"type\":\"byyntwlrbqt\"},{\"properties\":{\"recommendationName\":\"evseotgqrlltmuwl\",\"recommendationDisplayName\":\"wzizxbmpgcjefuzm\",\"description\":\"pbttdum\",\"recommendationTypeId\":\"p\",\"detectedBy\":\"ebmnzbtbhjpglk\",\"remediationSteps\":\"ohdneuel\",\"reportedSeverity\":\"Informational\",\"healthyDevices\":8674928390516574118,\"unhealthyDeviceCount\":250164414285445387,\"logAnalyticsQuery\":\"fikdowwqu\"},\"tags\":{\"lvithhqzonosgg\":\"zx\",\"ljuti\":\"hcohfwdsjnk\"},\"id\":\"swacffgdkzz\",\"name\":\"wkfvhqcrailvp\",\"type\":\"ppfufl\"},{\"properties\":{\"recommendationName\":\"mh\",\"recommendationDisplayName\":\"xyjrxsagafcnih\",\"description\":\"qapnedgfbcv\",\"recommendationTypeId\":\"vq\",\"detectedBy\":\"keqdcvdrhvoods\",\"remediationSteps\":\"bobzdopcjwvnhd\",\"reportedSeverity\":\"Medium\",\"healthyDevices\":2069944131022748416,\"unhealthyDeviceCount\":6392707975975047926,\"logAnalyticsQuery\":\"lpmutwuoegrpkhj\"},\"tags\":{\"dggkzzlvmbmpa\":\"yqsluic\"},\"id\":\"modfvuefywsbpfvm\",\"name\":\"yhrfouyftaakcpw\",\"type\":\"yzvqt\"}],\"nextLink\":\"ubex\"}") - .toObject(IoTSecurityAggregatedRecommendationList.class); - Assertions.assertEquals("szhedplvw", model.value().get(0).tags().get("wubmwmbesldn")); - Assertions.assertEquals("sadbz", model.value().get(0).recommendationName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecurityAggregatedRecommendationList model = - new IoTSecurityAggregatedRecommendationList() - .withValue( - Arrays - .asList( - new IoTSecurityAggregatedRecommendationInner() - .withTags( - mapOf( - "wubmwmbesldn", - "szhedplvw", - "lcxog", - "wwtppj", - "qqkdltfzxmhhvhgu", - "okonzmnsikvmkqz", - "xtibqdxbxwakbog", - "eodkwobda")) - .withRecommendationName("sadbz"), - new IoTSecurityAggregatedRecommendationInner() - .withTags(mapOf("lvithhqzonosgg", "zx", "ljuti", "hcohfwdsjnk")) - .withRecommendationName("evseotgqrlltmuwl"), - new IoTSecurityAggregatedRecommendationInner() - .withTags(mapOf("dggkzzlvmbmpa", "yqsluic")) - .withRecommendationName("mh"))); - model = BinaryData.fromObject(model).toObject(IoTSecurityAggregatedRecommendationList.class); - Assertions.assertEquals("szhedplvw", model.value().get(0).tags().get("wubmwmbesldn")); - Assertions.assertEquals("sadbz", model.value().get(0).recommendationName()); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationPropertiesTests.java deleted file mode 100644 index 965d77288d01..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationPropertiesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationProperties; -import org.junit.jupiter.api.Assertions; - -public final class IoTSecurityAggregatedRecommendationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecurityAggregatedRecommendationProperties model = - BinaryData - .fromString( - "{\"recommendationName\":\"ifthnz\",\"recommendationDisplayName\":\"dslgnayqigynduh\",\"description\":\"hqlkthumaqo\",\"recommendationTypeId\":\"gycdu\",\"detectedBy\":\"r\",\"remediationSteps\":\"ccymvaolpsslql\",\"reportedSeverity\":\"High\",\"healthyDevices\":245140836582564523,\"unhealthyDeviceCount\":2285407320964329848,\"logAnalyticsQuery\":\"pswiydmcwyh\"}") - .toObject(IoTSecurityAggregatedRecommendationProperties.class); - Assertions.assertEquals("ifthnz", model.recommendationName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecurityAggregatedRecommendationProperties model = - new IoTSecurityAggregatedRecommendationProperties().withRecommendationName("ifthnz"); - model = BinaryData.fromObject(model).toObject(IoTSecurityAggregatedRecommendationProperties.class); - Assertions.assertEquals("ifthnz", model.recommendationName()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAlertedDeviceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAlertedDeviceTests.java deleted file mode 100644 index ad5edc1d2a5b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAlertedDeviceTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.IoTSecurityAlertedDevice; - -public final class IoTSecurityAlertedDeviceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecurityAlertedDevice model = - BinaryData - .fromString("{\"deviceId\":\"laexqp\",\"alertsCount\":3403871146459803360}") - .toObject(IoTSecurityAlertedDevice.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecurityAlertedDevice model = new IoTSecurityAlertedDevice(); - model = BinaryData.fromObject(model).toObject(IoTSecurityAlertedDevice.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityDeviceAlertTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityDeviceAlertTests.java deleted file mode 100644 index 54c7ac693964..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityDeviceAlertTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceAlert; - -public final class IoTSecurityDeviceAlertTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecurityDeviceAlert model = - BinaryData - .fromString( - "{\"alertDisplayName\":\"ws\",\"reportedSeverity\":\"Informational\",\"alertsCount\":8220008823832302214}") - .toObject(IoTSecurityDeviceAlert.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecurityDeviceAlert model = new IoTSecurityDeviceAlert(); - model = BinaryData.fromObject(model).toObject(IoTSecurityDeviceAlert.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityDeviceRecommendationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityDeviceRecommendationTests.java deleted file mode 100644 index 643cce2df7a3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityDeviceRecommendationTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceRecommendation; - -public final class IoTSecurityDeviceRecommendationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecurityDeviceRecommendation model = - BinaryData - .fromString( - "{\"recommendationDisplayName\":\"vgomz\",\"reportedSeverity\":\"Low\",\"devicesCount\":2110052424631332756}") - .toObject(IoTSecurityDeviceRecommendation.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecurityDeviceRecommendation model = new IoTSecurityDeviceRecommendation(); - model = BinaryData.fromObject(model).toObject(IoTSecurityDeviceRecommendation.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelInnerTests.java deleted file mode 100644 index d54e2f52dd4c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelInnerTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelInner; -import com.azure.resourcemanager.security.models.IoTSecurityAlertedDevice; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceAlert; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceRecommendation; -import java.util.Arrays; - -public final class IoTSecuritySolutionAnalyticsModelInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecuritySolutionAnalyticsModelInner model = - BinaryData - .fromString( - "{\"properties\":{\"metrics\":{\"high\":4021445942662392747,\"medium\":4294667967107007677,\"low\":7036117632331754318},\"unhealthyDeviceCount\":2795086805451114111,\"devicesMetrics\":[{\"date\":\"2021-06-07T11:11Z\"}],\"topAlertedDevices\":[{\"deviceId\":\"lbbovplw\",\"alertsCount\":3734794049628665607},{\"deviceId\":\"yuguosvmkfssx\",\"alertsCount\":5126500575476383860},{\"deviceId\":\"plgmgsxnk\",\"alertsCount\":2541322280404196409}],\"mostPrevalentDeviceAlerts\":[{\"alertDisplayName\":\"pvlopwiyighxpkd\",\"reportedSeverity\":\"Medium\",\"alertsCount\":1775218219583343661},{\"alertDisplayName\":\"bbaumnyquped\",\"reportedSeverity\":\"Informational\",\"alertsCount\":533974290165093237}],\"mostPrevalentDeviceRecommendations\":[{\"recommendationDisplayName\":\"smtxpsieb\",\"reportedSeverity\":\"High\",\"devicesCount\":6627631118472357246},{\"recommendationDisplayName\":\"apskrdqm\",\"reportedSeverity\":\"Medium\",\"devicesCount\":6206046747227637327},{\"recommendationDisplayName\":\"dwkyzxuu\",\"reportedSeverity\":\"High\",\"devicesCount\":1186103723197260996}]},\"id\":\"cwsvlxotog\",\"name\":\"wrupqsxvnmicykvc\",\"type\":\"o\"}") - .toObject(IoTSecuritySolutionAnalyticsModelInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecuritySolutionAnalyticsModelInner model = - new IoTSecuritySolutionAnalyticsModelInner() - .withTopAlertedDevices( - Arrays - .asList( - new IoTSecurityAlertedDevice(), - new IoTSecurityAlertedDevice(), - new IoTSecurityAlertedDevice())) - .withMostPrevalentDeviceAlerts( - Arrays.asList(new IoTSecurityDeviceAlert(), new IoTSecurityDeviceAlert())) - .withMostPrevalentDeviceRecommendations( - Arrays - .asList( - new IoTSecurityDeviceRecommendation(), - new IoTSecurityDeviceRecommendation(), - new IoTSecurityDeviceRecommendation())); - model = BinaryData.fromObject(model).toObject(IoTSecuritySolutionAnalyticsModelInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelListInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelListInnerTests.java deleted file mode 100644 index f129646abccb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelListInnerTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelInner; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelListInner; -import java.util.Arrays; - -public final class IoTSecuritySolutionAnalyticsModelListInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecuritySolutionAnalyticsModelListInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"unhealthyDeviceCount\":623670055928945506,\"devicesMetrics\":[],\"topAlertedDevices\":[],\"mostPrevalentDeviceAlerts\":[],\"mostPrevalentDeviceRecommendations\":[]},\"id\":\"eyueaxibxujwb\",\"name\":\"qwalmuzyoxaepd\",\"type\":\"zjancuxr\"},{\"properties\":{\"unhealthyDeviceCount\":8073615781533611484,\"devicesMetrics\":[],\"topAlertedDevices\":[],\"mostPrevalentDeviceAlerts\":[],\"mostPrevalentDeviceRecommendations\":[]},\"id\":\"wd\",\"name\":\"swzts\",\"type\":\"bpg\"}],\"nextLink\":\"ytxhp\"}") - .toObject(IoTSecuritySolutionAnalyticsModelListInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecuritySolutionAnalyticsModelListInner model = - new IoTSecuritySolutionAnalyticsModelListInner() - .withValue( - Arrays - .asList( - new IoTSecuritySolutionAnalyticsModelInner() - .withTopAlertedDevices(Arrays.asList()) - .withMostPrevalentDeviceAlerts(Arrays.asList()) - .withMostPrevalentDeviceRecommendations(Arrays.asList()), - new IoTSecuritySolutionAnalyticsModelInner() - .withTopAlertedDevices(Arrays.asList()) - .withMostPrevalentDeviceAlerts(Arrays.asList()) - .withMostPrevalentDeviceRecommendations(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(IoTSecuritySolutionAnalyticsModelListInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItemTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItemTests.java deleted file mode 100644 index 9af4402ea31f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItemTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem; -import com.azure.resourcemanager.security.models.IoTSeverityMetrics; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItemTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem model = - BinaryData - .fromString( - "{\"date\":\"2021-08-28T04:10:12Z\",\"devicesMetrics\":{\"high\":6531016586304771464,\"medium\":6112562014909407139,\"low\":4716171323603349027}}") - .toObject(IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-28T04:10:12Z"), model.date()); - Assertions.assertEquals(6531016586304771464L, model.devicesMetrics().high()); - Assertions.assertEquals(6112562014909407139L, model.devicesMetrics().medium()); - Assertions.assertEquals(4716171323603349027L, model.devicesMetrics().low()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem model = - new IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem() - .withDate(OffsetDateTime.parse("2021-08-28T04:10:12Z")) - .withDevicesMetrics( - new IoTSeverityMetrics() - .withHigh(6531016586304771464L) - .withMedium(6112562014909407139L) - .withLow(4716171323603349027L)); - model = - BinaryData.fromObject(model).toObject(IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-28T04:10:12Z"), model.date()); - Assertions.assertEquals(6531016586304771464L, model.devicesMetrics().high()); - Assertions.assertEquals(6112562014909407139L, model.devicesMetrics().medium()); - Assertions.assertEquals(4716171323603349027L, model.devicesMetrics().low()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelPropertiesTests.java deleted file mode 100644 index 805e5e37424a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelPropertiesTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelProperties; -import com.azure.resourcemanager.security.models.IoTSecurityAlertedDevice; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceAlert; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceRecommendation; -import java.util.Arrays; - -public final class IoTSecuritySolutionAnalyticsModelPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecuritySolutionAnalyticsModelProperties model = - BinaryData - .fromString( - "{\"metrics\":{\"high\":2202893815567667311,\"medium\":5776325152256074523,\"low\":2732685754264877829},\"unhealthyDeviceCount\":3928242933963476014,\"devicesMetrics\":[{\"date\":\"2021-03-07T15:05:13Z\",\"devicesMetrics\":{\"high\":319665118186558655,\"medium\":3857673152007757003,\"low\":2825151831912713640}},{\"date\":\"2021-06-24T08:22:45Z\",\"devicesMetrics\":{\"high\":2116320352279967667,\"medium\":962291776216015099,\"low\":6718667665096544770}},{\"date\":\"2021-09-22T11:52:27Z\",\"devicesMetrics\":{\"high\":2840285264321299730,\"medium\":6255558235157330938,\"low\":3221959502351885450}},{\"date\":\"2021-10-09T14:43:40Z\",\"devicesMetrics\":{\"high\":4392160629829565824,\"medium\":1781523879629973808,\"low\":3301208873451353508}}],\"topAlertedDevices\":[{\"deviceId\":\"zq\",\"alertsCount\":8605356393131124323},{\"deviceId\":\"pmueefjzwfqk\",\"alertsCount\":7502146387336972702},{\"deviceId\":\"suyonobglaocq\",\"alertsCount\":2903733515306491145},{\"deviceId\":\"g\",\"alertsCount\":4531156159452032810}],\"mostPrevalentDeviceAlerts\":[{\"alertDisplayName\":\"moyrxvwfudwpz\",\"reportedSeverity\":\"High\",\"alertsCount\":6087131419458323367},{\"alertDisplayName\":\"lrqjbhckfr\",\"reportedSeverity\":\"Low\",\"alertsCount\":6356911616351908297}],\"mostPrevalentDeviceRecommendations\":[{\"recommendationDisplayName\":\"pycanuzbpz\",\"reportedSeverity\":\"High\",\"devicesCount\":3708510664132188472},{\"recommendationDisplayName\":\"crnwbmeh\",\"reportedSeverity\":\"High\",\"devicesCount\":455506710783591694},{\"recommendationDisplayName\":\"srtslhspkdeem\",\"reportedSeverity\":\"Informational\",\"devicesCount\":5804956821269941754},{\"recommendationDisplayName\":\"kv\",\"reportedSeverity\":\"Low\",\"devicesCount\":8799257187575805529}]}") - .toObject(IoTSecuritySolutionAnalyticsModelProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecuritySolutionAnalyticsModelProperties model = - new IoTSecuritySolutionAnalyticsModelProperties() - .withTopAlertedDevices( - Arrays - .asList( - new IoTSecurityAlertedDevice(), - new IoTSecurityAlertedDevice(), - new IoTSecurityAlertedDevice(), - new IoTSecurityAlertedDevice())) - .withMostPrevalentDeviceAlerts( - Arrays.asList(new IoTSecurityDeviceAlert(), new IoTSecurityDeviceAlert())) - .withMostPrevalentDeviceRecommendations( - Arrays - .asList( - new IoTSecurityDeviceRecommendation(), - new IoTSecurityDeviceRecommendation(), - new IoTSecurityDeviceRecommendation(), - new IoTSecurityDeviceRecommendation())); - model = BinaryData.fromObject(model).toObject(IoTSecuritySolutionAnalyticsModelProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionModelInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionModelInnerTests.java deleted file mode 100644 index 6d1733cdce9b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionModelInnerTests.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionModelInner; -import com.azure.resourcemanager.security.models.AdditionalWorkspaceType; -import com.azure.resourcemanager.security.models.AdditionalWorkspacesProperties; -import com.azure.resourcemanager.security.models.DataSource; -import com.azure.resourcemanager.security.models.ExportData; -import com.azure.resourcemanager.security.models.RecommendationConfigStatus; -import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.RecommendationType; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IoTSecuritySolutionModelInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecuritySolutionModelInner model = - BinaryData - .fromString( - "{\"location\":\"yocf\",\"properties\":{\"workspace\":\"s\",\"displayName\":\"mddystkiiux\",\"status\":\"Disabled\",\"export\":[\"RawEvents\",\"RawEvents\",\"RawEvents\",\"RawEvents\"],\"disabledDataSources\":[\"TwinData\",\"TwinData\",\"TwinData\",\"TwinData\"],\"iotHubs\":[\"vyifqrvkdvjsl\",\"rm\",\"vdfwatkpn\"],\"userDefinedResources\":{\"query\":\"lexxbczwtru\",\"querySubscriptions\":[\"qzbqjvsov\",\"yokacspkw\"]},\"autoDiscoveredResources\":[\"dobpxjmflbvvn\",\"hrk\",\"ciwwzjuqkhr\",\"ajiwkuo\"],\"recommendationsConfiguration\":[{\"recommendationType\":\"IoT_AgentSendsUnutilizedMessages\",\"name\":\"hsauuimjmvxied\",\"status\":\"Disabled\"},{\"recommendationType\":\"IoT_IPFilter_DenyAll\",\"name\":\"dyjrrfbyaosv\",\"status\":\"Disabled\"},{\"recommendationType\":\"IoT_PermissiveFirewallPolicy\",\"name\":\"onpc\",\"status\":\"Enabled\"}],\"unmaskedIpLoggingStatus\":\"Disabled\",\"additionalWorkspaces\":[{\"workspace\":\"lkevle\",\"type\":\"Sentinel\",\"dataTypes\":[]},{\"workspace\":\"u\",\"type\":\"Sentinel\",\"dataTypes\":[]},{\"workspace\":\"axkffei\",\"type\":\"Sentinel\",\"dataTypes\":[]}]},\"tags\":{\"shxmzsbbzoggigrx\":\"zy\"},\"id\":\"burvjxxjnspy\",\"name\":\"ptkoenkoukn\",\"type\":\"udwtiukbl\"}") - .toObject(IoTSecuritySolutionModelInner.class); - Assertions.assertEquals("yocf", model.location()); - Assertions.assertEquals("zy", model.tags().get("shxmzsbbzoggigrx")); - Assertions.assertEquals("s", model.workspace()); - Assertions.assertEquals("mddystkiiux", model.displayName()); - Assertions.assertEquals(SecuritySolutionStatus.DISABLED, model.status()); - Assertions.assertEquals(ExportData.RAW_EVENTS, model.export().get(0)); - Assertions.assertEquals(DataSource.TWIN_DATA, model.disabledDataSources().get(0)); - Assertions.assertEquals("vyifqrvkdvjsl", model.iotHubs().get(0)); - Assertions.assertEquals("lexxbczwtru", model.userDefinedResources().query()); - Assertions.assertEquals("qzbqjvsov", model.userDefinedResources().querySubscriptions().get(0)); - Assertions - .assertEquals( - RecommendationType.IO_T_AGENT_SENDS_UNUTILIZED_MESSAGES, - model.recommendationsConfiguration().get(0).recommendationType()); - Assertions - .assertEquals(RecommendationConfigStatus.DISABLED, model.recommendationsConfiguration().get(0).status()); - Assertions.assertEquals(UnmaskedIpLoggingStatus.DISABLED, model.unmaskedIpLoggingStatus()); - Assertions.assertEquals("lkevle", model.additionalWorkspaces().get(0).workspace()); - Assertions.assertEquals(AdditionalWorkspaceType.SENTINEL, model.additionalWorkspaces().get(0).type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecuritySolutionModelInner model = - new IoTSecuritySolutionModelInner() - .withLocation("yocf") - .withTags(mapOf("shxmzsbbzoggigrx", "zy")) - .withWorkspace("s") - .withDisplayName("mddystkiiux") - .withStatus(SecuritySolutionStatus.DISABLED) - .withExport( - Arrays - .asList( - ExportData.RAW_EVENTS, ExportData.RAW_EVENTS, ExportData.RAW_EVENTS, ExportData.RAW_EVENTS)) - .withDisabledDataSources( - Arrays - .asList(DataSource.TWIN_DATA, DataSource.TWIN_DATA, DataSource.TWIN_DATA, DataSource.TWIN_DATA)) - .withIotHubs(Arrays.asList("vyifqrvkdvjsl", "rm", "vdfwatkpn")) - .withUserDefinedResources( - new UserDefinedResourcesProperties() - .withQuery("lexxbczwtru") - .withQuerySubscriptions(Arrays.asList("qzbqjvsov", "yokacspkw"))) - .withRecommendationsConfiguration( - Arrays - .asList( - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_AGENT_SENDS_UNUTILIZED_MESSAGES) - .withStatus(RecommendationConfigStatus.DISABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_IPFILTER_DENY_ALL) - .withStatus(RecommendationConfigStatus.DISABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_PERMISSIVE_FIREWALL_POLICY) - .withStatus(RecommendationConfigStatus.ENABLED))) - .withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus.DISABLED) - .withAdditionalWorkspaces( - Arrays - .asList( - new AdditionalWorkspacesProperties() - .withWorkspace("lkevle") - .withType(AdditionalWorkspaceType.SENTINEL) - .withDataTypes(Arrays.asList()), - new AdditionalWorkspacesProperties() - .withWorkspace("u") - .withType(AdditionalWorkspaceType.SENTINEL) - .withDataTypes(Arrays.asList()), - new AdditionalWorkspacesProperties() - .withWorkspace("axkffei") - .withType(AdditionalWorkspaceType.SENTINEL) - .withDataTypes(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(IoTSecuritySolutionModelInner.class); - Assertions.assertEquals("yocf", model.location()); - Assertions.assertEquals("zy", model.tags().get("shxmzsbbzoggigrx")); - Assertions.assertEquals("s", model.workspace()); - Assertions.assertEquals("mddystkiiux", model.displayName()); - Assertions.assertEquals(SecuritySolutionStatus.DISABLED, model.status()); - Assertions.assertEquals(ExportData.RAW_EVENTS, model.export().get(0)); - Assertions.assertEquals(DataSource.TWIN_DATA, model.disabledDataSources().get(0)); - Assertions.assertEquals("vyifqrvkdvjsl", model.iotHubs().get(0)); - Assertions.assertEquals("lexxbczwtru", model.userDefinedResources().query()); - Assertions.assertEquals("qzbqjvsov", model.userDefinedResources().querySubscriptions().get(0)); - Assertions - .assertEquals( - RecommendationType.IO_T_AGENT_SENDS_UNUTILIZED_MESSAGES, - model.recommendationsConfiguration().get(0).recommendationType()); - Assertions - .assertEquals(RecommendationConfigStatus.DISABLED, model.recommendationsConfiguration().get(0).status()); - Assertions.assertEquals(UnmaskedIpLoggingStatus.DISABLED, model.unmaskedIpLoggingStatus()); - Assertions.assertEquals("lkevle", model.additionalWorkspaces().get(0).workspace()); - Assertions.assertEquals(AdditionalWorkspaceType.SENTINEL, model.additionalWorkspaces().get(0).type()); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionPropertiesTests.java deleted file mode 100644 index 61a6ccee5b0a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionPropertiesTests.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionProperties; -import com.azure.resourcemanager.security.models.AdditionalWorkspaceDataType; -import com.azure.resourcemanager.security.models.AdditionalWorkspaceType; -import com.azure.resourcemanager.security.models.AdditionalWorkspacesProperties; -import com.azure.resourcemanager.security.models.DataSource; -import com.azure.resourcemanager.security.models.ExportData; -import com.azure.resourcemanager.security.models.RecommendationConfigStatus; -import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.RecommendationType; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IoTSecuritySolutionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecuritySolutionProperties model = - BinaryData - .fromString( - "{\"workspace\":\"gkpocipazyxoe\",\"displayName\":\"ukgjnpiucgygevq\",\"status\":\"Disabled\",\"export\":[\"RawEvents\"],\"disabledDataSources\":[\"TwinData\",\"TwinData\",\"TwinData\",\"TwinData\"],\"iotHubs\":[\"r\",\"j\"],\"userDefinedResources\":{\"query\":\"pyd\",\"querySubscriptions\":[\"yhxdeoejzicwi\",\"sjttgzfbish\"]},\"autoDiscoveredResources\":[\"hajdeyeamdpha\"],\"recommendationsConfiguration\":[{\"recommendationType\":\"IoT_PermissiveInputFirewallRules\",\"name\":\"uxwgipwho\",\"status\":\"Disabled\"},{\"recommendationType\":\"IoT_InstallAgent\",\"name\":\"gshwankixz\",\"status\":\"Disabled\"},{\"recommendationType\":\"IoT_PermissiveInputFirewallRules\",\"name\":\"eputtmrywnuzoqf\",\"status\":\"Disabled\"},{\"recommendationType\":\"IoT_PermissiveOutputFirewallRules\",\"name\":\"zrnkcqvyxlwh\",\"status\":\"Enabled\"}],\"unmaskedIpLoggingStatus\":\"Enabled\",\"additionalWorkspaces\":[{\"workspace\":\"oqqnwvlryav\",\"type\":\"Sentinel\",\"dataTypes\":[\"RawEvents\",\"RawEvents\"]},{\"workspace\":\"qhgyxzkonocukok\",\"type\":\"Sentinel\",\"dataTypes\":[\"RawEvents\",\"Alerts\",\"RawEvents\",\"Alerts\"]},{\"workspace\":\"szfkbe\",\"type\":\"Sentinel\",\"dataTypes\":[\"RawEvents\",\"Alerts\",\"RawEvents\"]},{\"workspace\":\"vvjektcxsenhwlrs\",\"type\":\"Sentinel\",\"dataTypes\":[\"Alerts\",\"Alerts\"]}]}") - .toObject(IoTSecuritySolutionProperties.class); - Assertions.assertEquals("gkpocipazyxoe", model.workspace()); - Assertions.assertEquals("ukgjnpiucgygevq", model.displayName()); - Assertions.assertEquals(SecuritySolutionStatus.DISABLED, model.status()); - Assertions.assertEquals(ExportData.RAW_EVENTS, model.export().get(0)); - Assertions.assertEquals(DataSource.TWIN_DATA, model.disabledDataSources().get(0)); - Assertions.assertEquals("r", model.iotHubs().get(0)); - Assertions.assertEquals("pyd", model.userDefinedResources().query()); - Assertions.assertEquals("yhxdeoejzicwi", model.userDefinedResources().querySubscriptions().get(0)); - Assertions - .assertEquals( - RecommendationType.IO_T_PERMISSIVE_INPUT_FIREWALL_RULES, - model.recommendationsConfiguration().get(0).recommendationType()); - Assertions - .assertEquals(RecommendationConfigStatus.DISABLED, model.recommendationsConfiguration().get(0).status()); - Assertions.assertEquals(UnmaskedIpLoggingStatus.ENABLED, model.unmaskedIpLoggingStatus()); - Assertions.assertEquals("oqqnwvlryav", model.additionalWorkspaces().get(0).workspace()); - Assertions.assertEquals(AdditionalWorkspaceType.SENTINEL, model.additionalWorkspaces().get(0).type()); - Assertions - .assertEquals( - AdditionalWorkspaceDataType.RAW_EVENTS, model.additionalWorkspaces().get(0).dataTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecuritySolutionProperties model = - new IoTSecuritySolutionProperties() - .withWorkspace("gkpocipazyxoe") - .withDisplayName("ukgjnpiucgygevq") - .withStatus(SecuritySolutionStatus.DISABLED) - .withExport(Arrays.asList(ExportData.RAW_EVENTS)) - .withDisabledDataSources( - Arrays - .asList(DataSource.TWIN_DATA, DataSource.TWIN_DATA, DataSource.TWIN_DATA, DataSource.TWIN_DATA)) - .withIotHubs(Arrays.asList("r", "j")) - .withUserDefinedResources( - new UserDefinedResourcesProperties() - .withQuery("pyd") - .withQuerySubscriptions(Arrays.asList("yhxdeoejzicwi", "sjttgzfbish"))) - .withRecommendationsConfiguration( - Arrays - .asList( - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_PERMISSIVE_INPUT_FIREWALL_RULES) - .withStatus(RecommendationConfigStatus.DISABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_INSTALL_AGENT) - .withStatus(RecommendationConfigStatus.DISABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_PERMISSIVE_INPUT_FIREWALL_RULES) - .withStatus(RecommendationConfigStatus.DISABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_PERMISSIVE_OUTPUT_FIREWALL_RULES) - .withStatus(RecommendationConfigStatus.ENABLED))) - .withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus.ENABLED) - .withAdditionalWorkspaces( - Arrays - .asList( - new AdditionalWorkspacesProperties() - .withWorkspace("oqqnwvlryav") - .withType(AdditionalWorkspaceType.SENTINEL) - .withDataTypes( - Arrays - .asList( - AdditionalWorkspaceDataType.RAW_EVENTS, - AdditionalWorkspaceDataType.RAW_EVENTS)), - new AdditionalWorkspacesProperties() - .withWorkspace("qhgyxzkonocukok") - .withType(AdditionalWorkspaceType.SENTINEL) - .withDataTypes( - Arrays - .asList( - AdditionalWorkspaceDataType.RAW_EVENTS, - AdditionalWorkspaceDataType.ALERTS, - AdditionalWorkspaceDataType.RAW_EVENTS, - AdditionalWorkspaceDataType.ALERTS)), - new AdditionalWorkspacesProperties() - .withWorkspace("szfkbe") - .withType(AdditionalWorkspaceType.SENTINEL) - .withDataTypes( - Arrays - .asList( - AdditionalWorkspaceDataType.RAW_EVENTS, - AdditionalWorkspaceDataType.ALERTS, - AdditionalWorkspaceDataType.RAW_EVENTS)), - new AdditionalWorkspacesProperties() - .withWorkspace("vvjektcxsenhwlrs") - .withType(AdditionalWorkspaceType.SENTINEL) - .withDataTypes( - Arrays - .asList( - AdditionalWorkspaceDataType.ALERTS, AdditionalWorkspaceDataType.ALERTS)))); - model = BinaryData.fromObject(model).toObject(IoTSecuritySolutionProperties.class); - Assertions.assertEquals("gkpocipazyxoe", model.workspace()); - Assertions.assertEquals("ukgjnpiucgygevq", model.displayName()); - Assertions.assertEquals(SecuritySolutionStatus.DISABLED, model.status()); - Assertions.assertEquals(ExportData.RAW_EVENTS, model.export().get(0)); - Assertions.assertEquals(DataSource.TWIN_DATA, model.disabledDataSources().get(0)); - Assertions.assertEquals("r", model.iotHubs().get(0)); - Assertions.assertEquals("pyd", model.userDefinedResources().query()); - Assertions.assertEquals("yhxdeoejzicwi", model.userDefinedResources().querySubscriptions().get(0)); - Assertions - .assertEquals( - RecommendationType.IO_T_PERMISSIVE_INPUT_FIREWALL_RULES, - model.recommendationsConfiguration().get(0).recommendationType()); - Assertions - .assertEquals(RecommendationConfigStatus.DISABLED, model.recommendationsConfiguration().get(0).status()); - Assertions.assertEquals(UnmaskedIpLoggingStatus.ENABLED, model.unmaskedIpLoggingStatus()); - Assertions.assertEquals("oqqnwvlryav", model.additionalWorkspaces().get(0).workspace()); - Assertions.assertEquals(AdditionalWorkspaceType.SENTINEL, model.additionalWorkspaces().get(0).type()); - Assertions - .assertEquals( - AdditionalWorkspaceDataType.RAW_EVENTS, model.additionalWorkspaces().get(0).dataTypes().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionsListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionsListTests.java deleted file mode 100644 index cb1dbc83eeb1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionsListTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionModelInner; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionsList; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IoTSecuritySolutionsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecuritySolutionsList model = - BinaryData - .fromString( - "{\"value\":[{\"location\":\"dgwdslfhot\",\"properties\":{\"workspace\":\"ynpwlbj\",\"displayName\":\"pgacftadehxnlty\",\"status\":\"Disabled\",\"export\":[],\"disabledDataSources\":[],\"iotHubs\":[],\"autoDiscoveredResources\":[],\"recommendationsConfiguration\":[],\"unmaskedIpLoggingStatus\":\"Disabled\",\"additionalWorkspaces\":[]},\"tags\":{\"avo\":\"ej\",\"vudwx\":\"xzdmohctb\"},\"id\":\"ndnvo\",\"name\":\"gujjugwdkcglh\",\"type\":\"lazjdyggdtjixhbk\"},{\"location\":\"fqweykhmene\",\"properties\":{\"workspace\":\"exfwhy\",\"displayName\":\"cibvyvdcsitynn\",\"status\":\"Disabled\",\"export\":[],\"disabledDataSources\":[],\"iotHubs\":[],\"autoDiscoveredResources\":[],\"recommendationsConfiguration\":[],\"unmaskedIpLoggingStatus\":\"Disabled\",\"additionalWorkspaces\":[]},\"tags\":{\"hezrkgq\":\"jeyp\"},\"id\":\"c\",\"name\":\"refovgmkqsleyyvx\",\"type\":\"qjpkcattpngjcrc\"},{\"location\":\"sqpjhvmdajvn\",\"properties\":{\"workspace\":\"unqecanoae\",\"displayName\":\"pfhyhl\",\"status\":\"Enabled\",\"export\":[],\"disabledDataSources\":[],\"iotHubs\":[],\"autoDiscoveredResources\":[],\"recommendationsConfiguration\":[],\"unmaskedIpLoggingStatus\":\"Disabled\",\"additionalWorkspaces\":[]},\"tags\":{\"aodsfcpkv\":\"kthfui\"},\"id\":\"odpuozmyzydag\",\"name\":\"uaxbezyiuokkt\",\"type\":\"hrdxwzywqsmbs\"}],\"nextLink\":\"exim\"}") - .toObject(IoTSecuritySolutionsList.class); - Assertions.assertEquals("dgwdslfhot", model.value().get(0).location()); - Assertions.assertEquals("ej", model.value().get(0).tags().get("avo")); - Assertions.assertEquals("ynpwlbj", model.value().get(0).workspace()); - Assertions.assertEquals("pgacftadehxnlty", model.value().get(0).displayName()); - Assertions.assertEquals(SecuritySolutionStatus.DISABLED, model.value().get(0).status()); - Assertions.assertEquals(UnmaskedIpLoggingStatus.DISABLED, model.value().get(0).unmaskedIpLoggingStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecuritySolutionsList model = - new IoTSecuritySolutionsList() - .withValue( - Arrays - .asList( - new IoTSecuritySolutionModelInner() - .withLocation("dgwdslfhot") - .withTags(mapOf("avo", "ej", "vudwx", "xzdmohctb")) - .withWorkspace("ynpwlbj") - .withDisplayName("pgacftadehxnlty") - .withStatus(SecuritySolutionStatus.DISABLED) - .withExport(Arrays.asList()) - .withDisabledDataSources(Arrays.asList()) - .withIotHubs(Arrays.asList()) - .withRecommendationsConfiguration(Arrays.asList()) - .withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus.DISABLED) - .withAdditionalWorkspaces(Arrays.asList()), - new IoTSecuritySolutionModelInner() - .withLocation("fqweykhmene") - .withTags(mapOf("hezrkgq", "jeyp")) - .withWorkspace("exfwhy") - .withDisplayName("cibvyvdcsitynn") - .withStatus(SecuritySolutionStatus.DISABLED) - .withExport(Arrays.asList()) - .withDisabledDataSources(Arrays.asList()) - .withIotHubs(Arrays.asList()) - .withRecommendationsConfiguration(Arrays.asList()) - .withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus.DISABLED) - .withAdditionalWorkspaces(Arrays.asList()), - new IoTSecuritySolutionModelInner() - .withLocation("sqpjhvmdajvn") - .withTags(mapOf("aodsfcpkv", "kthfui")) - .withWorkspace("unqecanoae") - .withDisplayName("pfhyhl") - .withStatus(SecuritySolutionStatus.ENABLED) - .withExport(Arrays.asList()) - .withDisabledDataSources(Arrays.asList()) - .withIotHubs(Arrays.asList()) - .withRecommendationsConfiguration(Arrays.asList()) - .withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus.DISABLED) - .withAdditionalWorkspaces(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(IoTSecuritySolutionsList.class); - Assertions.assertEquals("dgwdslfhot", model.value().get(0).location()); - Assertions.assertEquals("ej", model.value().get(0).tags().get("avo")); - Assertions.assertEquals("ynpwlbj", model.value().get(0).workspace()); - Assertions.assertEquals("pgacftadehxnlty", model.value().get(0).displayName()); - Assertions.assertEquals(SecuritySolutionStatus.DISABLED, model.value().get(0).status()); - Assertions.assertEquals(UnmaskedIpLoggingStatus.DISABLED, model.value().get(0).unmaskedIpLoggingStatus()); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSeverityMetricsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSeverityMetricsTests.java deleted file mode 100644 index 17e411e56574..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSeverityMetricsTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.IoTSeverityMetrics; -import org.junit.jupiter.api.Assertions; - -public final class IoTSeverityMetricsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSeverityMetrics model = - BinaryData - .fromString("{\"high\":9028045602986691631,\"medium\":2874780118088744582,\"low\":9144697658006681867}") - .toObject(IoTSeverityMetrics.class); - Assertions.assertEquals(9028045602986691631L, model.high()); - Assertions.assertEquals(2874780118088744582L, model.medium()); - Assertions.assertEquals(9144697658006681867L, model.low()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSeverityMetrics model = - new IoTSeverityMetrics() - .withHigh(9028045602986691631L) - .withMedium(2874780118088744582L) - .withLow(9144697658006681867L); - model = BinaryData.fromObject(model).toObject(IoTSeverityMetrics.class); - Assertions.assertEquals(9028045602986691631L, model.high()); - Assertions.assertEquals(2874780118088744582L, model.medium()); - Assertions.assertEquals(9144697658006681867L, model.low()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetWithResponseMockTests.java deleted file mode 100644 index 0457202989af..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModel; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionAnalyticsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"metrics\":{\"high\":5542611774329052681,\"medium\":6661372100363486743,\"low\":3710990785713505162},\"unhealthyDeviceCount\":7761016592414796563,\"devicesMetrics\":[],\"topAlertedDevices\":[],\"mostPrevalentDeviceAlerts\":[],\"mostPrevalentDeviceRecommendations\":[]},\"id\":\"tjoxztfw\",\"name\":\"qchvczevjn\",\"type\":\"cta\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IoTSecuritySolutionAnalyticsModel response = - manager - .iotSecuritySolutionAnalytics() - .getWithResponse("u", "t", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListWithResponseMockTests.java deleted file mode 100644 index 12ef01040d97..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModelList; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionAnalyticsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"bjgmnzj\",\"name\":\"t\",\"type\":\"mrxkhlobvv\"},{\"id\":\"hvhd\",\"name\":\"qayfl\",\"type\":\"iyu\"}],\"nextLink\":\"n\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IoTSecuritySolutionAnalyticsModelList response = - manager - .iotSecuritySolutionAnalytics() - .listWithResponse("aaqgzeka", "clyzgs", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsDismissWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsDismissWithResponseMockTests.java deleted file mode 100644 index 40c910b36ec4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsDismissWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionsAnalyticsAggregatedAlertsDismissWithResponseMockTests { - @Test - public void testDismissWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .iotSecuritySolutionsAnalyticsAggregatedAlerts() - .dismissWithResponse("z", "xlujkhnjcm", "nkfm", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsGetWithResponseMockTests.java deleted file mode 100644 index 51be7ab6a50e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlert; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionsAnalyticsAggregatedAlertsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"alertType\":\"psimioy\",\"alertDisplayName\":\"glkmiqwnnr\",\"vendorName\":\"ibb\",\"reportedSeverity\":\"High\",\"remediationSteps\":\"pkl\",\"description\":\"ydgnha\",\"count\":3154276649040417156,\"effectedResourceType\":\"exzgpmnmabedd\",\"systemSource\":\"lwgdfpfqfpcvs\",\"actionTaken\":\"l\",\"logAnalyticsQuery\":\"rvwerfwxbsmtb\",\"topDevicesList\":[]},\"tags\":{\"kwdvbtb\":\"hci\"},\"id\":\"ekqhs\",\"name\":\"htfpwpqb\",\"type\":\"ejuwyqwdqigmghgi\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IoTSecurityAggregatedAlert response = - manager - .iotSecuritySolutionsAnalyticsAggregatedAlerts() - .getWithResponse("tdavuqmcbymsfobj", "quvjez", "j", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("hci", response.tags().get("kwdvbtb")); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsListMockTests.java deleted file mode 100644 index 611fe6f5a224..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsListMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlert; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionsAnalyticsAggregatedAlertsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"alertType\":\"xqabckmzeoxi\",\"alertDisplayName\":\"greohtwhlpuzjp\",\"vendorName\":\"znzangprbfaxy\",\"reportedSeverity\":\"Medium\",\"remediationSteps\":\"ciphmsexr\",\"description\":\"rndktx\",\"count\":8107112782048178404,\"effectedResourceType\":\"eeqgpkri\",\"systemSource\":\"bgnixxoww\",\"actionTaken\":\"yfwnw\",\"logAnalyticsQuery\":\"wxeiicrmpepk\",\"topDevicesList\":[]},\"tags\":{\"rasek\":\"xijvskwsdgkjgyac\"},\"id\":\"efcvo\",\"name\":\"nwoqartwy\",\"type\":\"qicladv\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .iotSecuritySolutionsAnalyticsAggregatedAlerts() - .list("fyvrtpqpemhzcgk", "epdqhqyhwq", 252630032, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xijvskwsdgkjgyac", response.iterator().next().tags().get("rasek")); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationsGetWithResponseMockTests.java deleted file mode 100644 index e4f5c8c4df4a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationsGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedRecommendation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionsAnalyticsRecommendationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"recommendationName\":\"uavt\",\"recommendationDisplayName\":\"bkew\",\"description\":\"yn\",\"recommendationTypeId\":\"gbvoffbkk\",\"detectedBy\":\"dxaexqokmyrljia\",\"remediationSteps\":\"bn\",\"reportedSeverity\":\"Medium\",\"healthyDevices\":565720864272399930,\"unhealthyDeviceCount\":7735327142708488909,\"logAnalyticsQuery\":\"rpzuyudivbx\"},\"tags\":{\"nqelwgdhuru\":\"qeae\",\"za\":\"y\",\"mpinmzvfkneerzzt\":\"ogatmoljiy\"},\"id\":\"knsjulugd\",\"name\":\"bnhrxlelfjhkeiz\",\"type\":\"pihtdmiwjekpt\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IoTSecurityAggregatedRecommendation response = - manager - .iotSecuritySolutionsAnalyticsRecommendations() - .getWithResponse("h", "qtwmlmhjnqtqeahj", "dvragpokddxejhh", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("qeae", response.tags().get("nqelwgdhuru")); - Assertions.assertEquals("uavt", response.recommendationName()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationsListMockTests.java deleted file mode 100644 index f2b7c7fd6e64..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationsListMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedRecommendation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionsAnalyticsRecommendationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"recommendationName\":\"auolawiu\",\"recommendationDisplayName\":\"oms\",\"description\":\"vjhvvlr\",\"recommendationTypeId\":\"hewjjmajnkdflqio\",\"detectedBy\":\"waeqkzfzqxjosho\",\"remediationSteps\":\"otryegp\",\"reportedSeverity\":\"Medium\",\"healthyDevices\":341577657952902216,\"unhealthyDeviceCount\":4595206481574403678,\"logAnalyticsQuery\":\"wkbfokxkhupzer\"},\"tags\":{\"yykyalu\":\"jblcdrmyfcemftz\"},\"id\":\"ekdfqnhttwd\",\"name\":\"wrczfjjnnuxxrk\",\"type\":\"mhmnulwemp\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .iotSecuritySolutionsAnalyticsRecommendations() - .list("caydbjzcqymlcfnz", "mhsurlgwqkpmm", 1745325763, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jblcdrmyfcemftz", response.iterator().next().tags().get("yykyalu")); - Assertions.assertEquals("auolawiu", response.iterator().next().recommendationName()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index d379b4a647bc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.DataSource; -import com.azure.resourcemanager.security.models.ExportData; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionModel; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"location\":\"vmtumxpym\",\"properties\":{\"workspace\":\"uaxroqvqpilrgu\",\"displayName\":\"canlduwzorxs\",\"status\":\"Enabled\",\"export\":[\"RawEvents\"],\"disabledDataSources\":[\"TwinData\"],\"iotHubs\":[\"x\",\"qvfqepdxc\"],\"userDefinedResources\":{\"query\":\"uubwyvpjb\",\"querySubscriptions\":[]},\"autoDiscoveredResources\":[\"pjqduqgix\"],\"recommendationsConfiguration\":[],\"unmaskedIpLoggingStatus\":\"Disabled\",\"additionalWorkspaces\":[]},\"tags\":{\"ftcvbii\":\"avhuerkjddvrglie\"},\"id\":\"tksdwgdnkefgmw\",\"name\":\"hcebuvczldbglzo\",\"type\":\"t\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IoTSecuritySolutionModel response = - manager - .iotSecuritySolutions() - .define("rulfuct") - .withExistingResourceGroup("aqgvto") - .withRegion("rthcfjzh") - .withTags(mapOf("iibelwcerw", "quwzp", "pjxljtxb", "w", "sdzhgbdgzpagsec", "sqtbxxniu")) - .withWorkspace("ubqjro") - .withDisplayName("tvrjeqmtz") - .withStatus(SecuritySolutionStatus.DISABLED) - .withExport( - Arrays - .asList( - ExportData.RAW_EVENTS, ExportData.RAW_EVENTS, ExportData.RAW_EVENTS, ExportData.RAW_EVENTS)) - .withDisabledDataSources( - Arrays - .asList(DataSource.TWIN_DATA, DataSource.TWIN_DATA, DataSource.TWIN_DATA, DataSource.TWIN_DATA)) - .withIotHubs(Arrays.asList("bsrwrsnrhpqat")) - .withUserDefinedResources( - new UserDefinedResourcesProperties().withQuery("kkvyanxk").withQuerySubscriptions(Arrays.asList())) - .withRecommendationsConfiguration(Arrays.asList()) - .withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus.DISABLED) - .withAdditionalWorkspaces(Arrays.asList()) - .create(); - - Assertions.assertEquals("vmtumxpym", response.location()); - Assertions.assertEquals("avhuerkjddvrglie", response.tags().get("ftcvbii")); - Assertions.assertEquals("uaxroqvqpilrgu", response.workspace()); - Assertions.assertEquals("canlduwzorxs", response.displayName()); - Assertions.assertEquals(SecuritySolutionStatus.ENABLED, response.status()); - Assertions.assertEquals(ExportData.RAW_EVENTS, response.export().get(0)); - Assertions.assertEquals(DataSource.TWIN_DATA, response.disabledDataSources().get(0)); - Assertions.assertEquals("x", response.iotHubs().get(0)); - Assertions.assertEquals("uubwyvpjb", response.userDefinedResources().query()); - Assertions.assertEquals(UnmaskedIpLoggingStatus.DISABLED, response.unmaskedIpLoggingStatus()); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsDeleteByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 2cc55bb3dc76..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .iotSecuritySolutions() - .deleteByResourceGroupWithResponse("chskxxka", "sbvr", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsGetByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index d0af517eeafd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.DataSource; -import com.azure.resourcemanager.security.models.ExportData; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionModel; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"location\":\"gwokmikpazfbmjxu\",\"properties\":{\"workspace\":\"pfdvhaxdv\",\"displayName\":\"zaehpphthd\",\"status\":\"Disabled\",\"export\":[\"RawEvents\",\"RawEvents\"],\"disabledDataSources\":[\"TwinData\"],\"iotHubs\":[\"fqoixwgiksbbvt\",\"oxrpogw\",\"hchgjtnhtukf\",\"cihmbfntumeezbxv\"],\"userDefinedResources\":{\"query\":\"bnuvwcg\",\"querySubscriptions\":[]},\"autoDiscoveredResources\":[\"omtmjzwxuqgov\",\"xpwwzt\"],\"recommendationsConfiguration\":[],\"unmaskedIpLoggingStatus\":\"Enabled\",\"additionalWorkspaces\":[]},\"tags\":{\"grllcc\":\"edmls\",\"zhpabac\":\"aovjow\",\"wsxnsrqor\":\"mlyotg\",\"eetqujxcxxq\":\"genmvceb\"},\"id\":\"dcqjkedwqurc\",\"name\":\"ojmrvvxwjongzse\",\"type\":\"qqrsil\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IoTSecuritySolutionModel response = - manager - .iotSecuritySolutions() - .getByResourceGroupWithResponse("ezsdsuxheq", "gcruxspinym", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("gwokmikpazfbmjxu", response.location()); - Assertions.assertEquals("edmls", response.tags().get("grllcc")); - Assertions.assertEquals("pfdvhaxdv", response.workspace()); - Assertions.assertEquals("zaehpphthd", response.displayName()); - Assertions.assertEquals(SecuritySolutionStatus.DISABLED, response.status()); - Assertions.assertEquals(ExportData.RAW_EVENTS, response.export().get(0)); - Assertions.assertEquals(DataSource.TWIN_DATA, response.disabledDataSources().get(0)); - Assertions.assertEquals("fqoixwgiksbbvt", response.iotHubs().get(0)); - Assertions.assertEquals("bnuvwcg", response.userDefinedResources().query()); - Assertions.assertEquals(UnmaskedIpLoggingStatus.ENABLED, response.unmaskedIpLoggingStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsListByResourceGroupMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsListByResourceGroupMockTests.java deleted file mode 100644 index ad9b2a936743..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsListByResourceGroupMockTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.DataSource; -import com.azure.resourcemanager.security.models.ExportData; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionModel; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"wtltngvmreuptrk\",\"properties\":{\"workspace\":\"ijajwolx\",\"displayName\":\"s\",\"status\":\"Enabled\",\"export\":[\"RawEvents\",\"RawEvents\",\"RawEvents\"],\"disabledDataSources\":[\"TwinData\",\"TwinData\",\"TwinData\"],\"iotHubs\":[\"igt\"],\"userDefinedResources\":{\"query\":\"cvbxqlapsnss\",\"querySubscriptions\":[]},\"autoDiscoveredResources\":[\"xpavid\",\"ievw\",\"fcvvy\"],\"recommendationsConfiguration\":[],\"unmaskedIpLoggingStatus\":\"Enabled\",\"additionalWorkspaces\":[]},\"tags\":{\"pazwug\":\"dsvalpnptwtrkx\",\"hldiuhzzgqlm\":\"yqvnjobfe\"},\"id\":\"aewzgiudjp\",\"name\":\"pqht\",\"type\":\"qhnmhk\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.iotSecuritySolutions().listByResourceGroup("kfscjfncjwv", "ag", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wtltngvmreuptrk", response.iterator().next().location()); - Assertions.assertEquals("dsvalpnptwtrkx", response.iterator().next().tags().get("pazwug")); - Assertions.assertEquals("ijajwolx", response.iterator().next().workspace()); - Assertions.assertEquals("s", response.iterator().next().displayName()); - Assertions.assertEquals(SecuritySolutionStatus.ENABLED, response.iterator().next().status()); - Assertions.assertEquals(ExportData.RAW_EVENTS, response.iterator().next().export().get(0)); - Assertions.assertEquals(DataSource.TWIN_DATA, response.iterator().next().disabledDataSources().get(0)); - Assertions.assertEquals("igt", response.iterator().next().iotHubs().get(0)); - Assertions.assertEquals("cvbxqlapsnss", response.iterator().next().userDefinedResources().query()); - Assertions.assertEquals(UnmaskedIpLoggingStatus.ENABLED, response.iterator().next().unmaskedIpLoggingStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsListMockTests.java deleted file mode 100644 index 53ac1a10cf82..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsListMockTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.DataSource; -import com.azure.resourcemanager.security.models.ExportData; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionModel; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"utmdpvozg\",\"properties\":{\"workspace\":\"bknlzcl\",\"displayName\":\"tzeyowmndcovd\",\"status\":\"Enabled\",\"export\":[\"RawEvents\"],\"disabledDataSources\":[\"TwinData\"],\"iotHubs\":[\"mk\",\"fruwkud\",\"bcpftxudqyemebun\",\"ucmci\"],\"userDefinedResources\":{\"query\":\"nee\",\"querySubscriptions\":[]},\"autoDiscoveredResources\":[\"auwcg\",\"efnoh\",\"itranizerwguda\",\"mxubvfbngfcoce\"],\"recommendationsConfiguration\":[],\"unmaskedIpLoggingStatus\":\"Enabled\",\"additionalWorkspaces\":[]},\"tags\":{\"vhl\":\"ztraud\",\"tmojhvrztnvgyshq\":\"dculregp\",\"zlpykcfazzwjcay\":\"dgrtwmew\"},\"id\":\"rzrr\",\"name\":\"nsyby\",\"type\":\"polwzrghsrlei\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.iotSecuritySolutions().list("q", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("utmdpvozg", response.iterator().next().location()); - Assertions.assertEquals("ztraud", response.iterator().next().tags().get("vhl")); - Assertions.assertEquals("bknlzcl", response.iterator().next().workspace()); - Assertions.assertEquals("tzeyowmndcovd", response.iterator().next().displayName()); - Assertions.assertEquals(SecuritySolutionStatus.ENABLED, response.iterator().next().status()); - Assertions.assertEquals(ExportData.RAW_EVENTS, response.iterator().next().export().get(0)); - Assertions.assertEquals(DataSource.TWIN_DATA, response.iterator().next().disabledDataSources().get(0)); - Assertions.assertEquals("mk", response.iterator().next().iotHubs().get(0)); - Assertions.assertEquals("nee", response.iterator().next().userDefinedResources().query()); - Assertions.assertEquals(UnmaskedIpLoggingStatus.ENABLED, response.iterator().next().unmaskedIpLoggingStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index be841f97dd2c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicy; -import java.nio.ByteBuffer; -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 org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JitNetworkAccessPoliciesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"virtualMachines\":[],\"requests\":[],\"provisioningState\":\"npv\"},\"kind\":\"szrbwtdrcwg\",\"location\":\"ll\",\"id\":\"zlhhfix\",\"name\":\"cfculzj\",\"type\":\"mhpfywvy\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - JitNetworkAccessPolicy response = - manager - .jitNetworkAccessPolicies() - .define("hkfktlt") - .withExistingLocation("qhfnkvycqqqds", "ipnquwzxhrptyod") - .withVirtualMachines(Arrays.asList()) - .withKind("saluzyi") - .withRequests(Arrays.asList()) - .create(); - - Assertions.assertEquals("szrbwtdrcwg", response.kind()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteWithResponseMockTests.java deleted file mode 100644 index cd540e24437b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JitNetworkAccessPoliciesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .jitNetworkAccessPolicies() - .deleteWithResponse("jsumxpezcoio", "jrmfqzwqd", "xkeedcnwmy", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetWithResponseMockTests.java deleted file mode 100644 index 0516669d3765..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicy; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JitNetworkAccessPoliciesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"virtualMachines\":[],\"requests\":[],\"provisioningState\":\"qbriq\"},\"kind\":\"wwtrjm\",\"location\":\"kvyhzokpoyu\",\"id\":\"h\",\"name\":\"ensnaa\",\"type\":\"phmpoejnglpwsada\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - JitNetworkAccessPolicy response = - manager - .jitNetworkAccessPolicies() - .getWithResponse("ooxrqwoeurb", "igapdy", "rikeejdpdfht", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("wwtrjm", response.kind()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesInitiateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesInitiateWithResponseMockTests.java deleted file mode 100644 index 5cebd93ca782..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesInitiateWithResponseMockTests.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateRequest; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateVirtualMachine; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequest; -import java.nio.ByteBuffer; -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 org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JitNetworkAccessPoliciesInitiateWithResponseMockTests { - @Test - public void testInitiateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"virtualMachines\":[{\"id\":\"xyrujmt\",\"ports\":[]}],\"startTimeUtc\":\"2021-06-08T04:38:24Z\",\"requestor\":\"s\",\"justification\":\"kyohzix\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(202); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - JitNetworkAccessRequest response = - manager - .jitNetworkAccessPolicies() - .initiateWithResponse( - "xfqzkvemyzd", - "czaqpqifdbmpt", - "wtxzuisam", - new JitNetworkAccessPolicyInitiateRequest() - .withVirtualMachines( - Arrays - .asList( - new JitNetworkAccessPolicyInitiateVirtualMachine() - .withId("at") - .withPorts(Arrays.asList()), - new JitNetworkAccessPolicyInitiateVirtualMachine() - .withId("zexroqsqjgh") - .withPorts(Arrays.asList()), - new JitNetworkAccessPolicyInitiateVirtualMachine() - .withId("thsplwsttxsr") - .withPorts(Arrays.asList()), - new JitNetworkAccessPolicyInitiateVirtualMachine() - .withId("fq") - .withPorts(Arrays.asList()))) - .withJustification("iceovxgzw"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xyrujmt", response.virtualMachines().get(0).id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-08T04:38:24Z"), response.startTimeUtc()); - Assertions.assertEquals("s", response.requestor()); - Assertions.assertEquals("kyohzix", response.justification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByRegionMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByRegionMockTests.java deleted file mode 100644 index b1e5ff351f1c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByRegionMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicy; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JitNetworkAccessPoliciesListByRegionMockTests { - @Test - public void testListByRegion() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"virtualMachines\":[],\"requests\":[],\"provisioningState\":\"kzidgzwdyd\"},\"kind\":\"isvpztdivykpxkqe\",\"location\":\"pjfojiunrls\",\"id\":\"xuknsykdtoi\",\"name\":\"oancdrco\",\"type\":\"nvxuldxonckb\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.jitNetworkAccessPolicies().listByRegion("nzvajbvbnkrdem", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("isvpztdivykpxkqe", response.iterator().next().kind()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupAndRegionMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupAndRegionMockTests.java deleted file mode 100644 index d21c22cac68c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupAndRegionMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicy; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JitNetworkAccessPoliciesListByResourceGroupAndRegionMockTests { - @Test - public void testListByResourceGroupAndRegion() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"virtualMachines\":[],\"requests\":[],\"provisioningState\":\"o\"},\"kind\":\"dvrgptqmawzjdrp\",\"location\":\"fu\",\"id\":\"gyc\",\"name\":\"sd\",\"type\":\"tqgkujd\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .jitNetworkAccessPolicies() - .listByResourceGroupAndRegion("pimyndnoxax", "rqaqotn", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("dvrgptqmawzjdrp", response.iterator().next().kind()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupMockTests.java deleted file mode 100644 index ee8b1eaec2a0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicy; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JitNetworkAccessPoliciesListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"virtualMachines\":[],\"requests\":[],\"provisioningState\":\"ghlww\"},\"kind\":\"gvgfklqiyndveqe\",\"location\":\"b\",\"id\":\"vd\",\"name\":\"trkzxsgtznsvlrds\",\"type\":\"o\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .jitNetworkAccessPolicies() - .listByResourceGroup("lblfxlupibaqzizx", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("gvgfklqiyndveqe", response.iterator().next().kind()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListMockTests.java deleted file mode 100644 index e2e93c7bb422..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicy; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JitNetworkAccessPoliciesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"virtualMachines\":[],\"requests\":[],\"provisioningState\":\"sgqk\"},\"kind\":\"yecup\",\"location\":\"ijpardavsjcf\",\"id\":\"azpzdqwuz\",\"name\":\"cmcokxizekuv\",\"type\":\"rjwuca\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.jitNetworkAccessPolicies().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("yecup", response.iterator().next().kind()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListTests.java deleted file mode 100644 index a18c27241fc2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyInner; -import com.azure.resourcemanager.security.models.JitNetworkAccessPoliciesList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessPoliciesListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessPoliciesList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"virtualMachines\":[],\"requests\":[],\"provisioningState\":\"bzefezr\"},\"kind\":\"czurtlei\",\"location\":\"xbkwv\",\"id\":\"gnzvdfbzdixzm\",\"name\":\"pnodawopqhe\",\"type\":\"jptmcgsbost\"},{\"properties\":{\"virtualMachines\":[],\"requests\":[],\"provisioningState\":\"ndlatutmzlbi\"},\"kind\":\"lvfhrbbp\",\"location\":\"qvcww\",\"id\":\"yurmochpprprs\",\"name\":\"mo\",\"type\":\"ayzejnhlbkpbz\"}],\"nextLink\":\"piljhahzvech\"}") - .toObject(JitNetworkAccessPoliciesList.class); - Assertions.assertEquals("czurtlei", model.value().get(0).kind()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessPoliciesList model = - new JitNetworkAccessPoliciesList() - .withValue( - Arrays - .asList( - new JitNetworkAccessPolicyInner() - .withKind("czurtlei") - .withVirtualMachines(Arrays.asList()) - .withRequests(Arrays.asList()), - new JitNetworkAccessPolicyInner() - .withKind("lvfhrbbp") - .withVirtualMachines(Arrays.asList()) - .withRequests(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessPoliciesList.class); - Assertions.assertEquals("czurtlei", model.value().get(0).kind()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiatePortTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiatePortTests.java deleted file mode 100644 index 583a5d020cf6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiatePortTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiatePort; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessPolicyInitiatePortTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessPolicyInitiatePort model = - BinaryData - .fromString( - "{\"number\":30912450,\"allowedSourceAddressPrefix\":\"wwp\",\"endTimeUtc\":\"2021-06-18T17:27:40Z\"}") - .toObject(JitNetworkAccessPolicyInitiatePort.class); - Assertions.assertEquals(30912450, model.number()); - Assertions.assertEquals("wwp", model.allowedSourceAddressPrefix()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-18T17:27:40Z"), model.endTimeUtc()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessPolicyInitiatePort model = - new JitNetworkAccessPolicyInitiatePort() - .withNumber(30912450) - .withAllowedSourceAddressPrefix("wwp") - .withEndTimeUtc(OffsetDateTime.parse("2021-06-18T17:27:40Z")); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessPolicyInitiatePort.class); - Assertions.assertEquals(30912450, model.number()); - Assertions.assertEquals("wwp", model.allowedSourceAddressPrefix()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-18T17:27:40Z"), model.endTimeUtc()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiateRequestTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiateRequestTests.java deleted file mode 100644 index 03b9fcd341ae..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiateRequestTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateRequest; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateVirtualMachine; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessPolicyInitiateRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessPolicyInitiateRequest model = - BinaryData - .fromString( - "{\"virtualMachines\":[{\"id\":\"trsqqw\",\"ports\":[]}],\"justification\":\"mwqkchcxwaxf\"}") - .toObject(JitNetworkAccessPolicyInitiateRequest.class); - Assertions.assertEquals("trsqqw", model.virtualMachines().get(0).id()); - Assertions.assertEquals("mwqkchcxwaxf", model.justification()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessPolicyInitiateRequest model = - new JitNetworkAccessPolicyInitiateRequest() - .withVirtualMachines( - Arrays - .asList( - new JitNetworkAccessPolicyInitiateVirtualMachine() - .withId("trsqqw") - .withPorts(Arrays.asList()))) - .withJustification("mwqkchcxwaxf"); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessPolicyInitiateRequest.class); - Assertions.assertEquals("trsqqw", model.virtualMachines().get(0).id()); - Assertions.assertEquals("mwqkchcxwaxf", model.justification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiateVirtualMachineTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiateVirtualMachineTests.java deleted file mode 100644 index 23d745f14acd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiateVirtualMachineTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiatePort; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateVirtualMachine; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessPolicyInitiateVirtualMachineTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessPolicyInitiateVirtualMachine model = - BinaryData - .fromString( - "{\"id\":\"w\",\"ports\":[{\"number\":636641870,\"allowedSourceAddressPrefix\":\"exfdeqvhpsylk\",\"endTimeUtc\":\"2021-04-17T08:49:18Z\"},{\"number\":2021763833,\"allowedSourceAddressPrefix\":\"bffmbmxz\",\"endTimeUtc\":\"2021-06-13T14:19:09Z\"}]}") - .toObject(JitNetworkAccessPolicyInitiateVirtualMachine.class); - Assertions.assertEquals("w", model.id()); - Assertions.assertEquals(636641870, model.ports().get(0).number()); - Assertions.assertEquals("exfdeqvhpsylk", model.ports().get(0).allowedSourceAddressPrefix()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-17T08:49:18Z"), model.ports().get(0).endTimeUtc()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessPolicyInitiateVirtualMachine model = - new JitNetworkAccessPolicyInitiateVirtualMachine() - .withId("w") - .withPorts( - Arrays - .asList( - new JitNetworkAccessPolicyInitiatePort() - .withNumber(636641870) - .withAllowedSourceAddressPrefix("exfdeqvhpsylk") - .withEndTimeUtc(OffsetDateTime.parse("2021-04-17T08:49:18Z")), - new JitNetworkAccessPolicyInitiatePort() - .withNumber(2021763833) - .withAllowedSourceAddressPrefix("bffmbmxz") - .withEndTimeUtc(OffsetDateTime.parse("2021-06-13T14:19:09Z")))); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessPolicyInitiateVirtualMachine.class); - Assertions.assertEquals("w", model.id()); - Assertions.assertEquals(636641870, model.ports().get(0).number()); - Assertions.assertEquals("exfdeqvhpsylk", model.ports().get(0).allowedSourceAddressPrefix()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-17T08:49:18Z"), model.ports().get(0).endTimeUtc()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInnerTests.java deleted file mode 100644 index 758a18f86b8e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInnerTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyInner; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyVirtualMachine; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessPolicyInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessPolicyInner model = - BinaryData - .fromString( - "{\"properties\":{\"virtualMachines\":[{\"id\":\"bnwieholew\",\"ports\":[],\"publicIpAddress\":\"iuubwefqsf\"}],\"requests\":[{\"virtualMachines\":[],\"startTimeUtc\":\"2021-06-03T00:57:38Z\",\"requestor\":\"tf\",\"justification\":\"rqwexjkmfxapjwog\"},{\"virtualMachines\":[],\"startTimeUtc\":\"2021-01-30T20:27:58Z\",\"requestor\":\"nobpudcdabtqwpw\",\"justification\":\"wbzasqbuclj\"}],\"provisioningState\":\"yexaoguy\"},\"kind\":\"p\",\"location\":\"sdaultxij\",\"id\":\"um\",\"name\":\"qwazlnqnmcjngzq\",\"type\":\"qxtbjwgnyf\"}") - .toObject(JitNetworkAccessPolicyInner.class); - Assertions.assertEquals("p", model.kind()); - Assertions.assertEquals("bnwieholew", model.virtualMachines().get(0).id()); - Assertions.assertEquals("iuubwefqsf", model.virtualMachines().get(0).publicIpAddress()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-03T00:57:38Z"), model.requests().get(0).startTimeUtc()); - Assertions.assertEquals("tf", model.requests().get(0).requestor()); - Assertions.assertEquals("rqwexjkmfxapjwog", model.requests().get(0).justification()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessPolicyInner model = - new JitNetworkAccessPolicyInner() - .withKind("p") - .withVirtualMachines( - Arrays - .asList( - new JitNetworkAccessPolicyVirtualMachine() - .withId("bnwieholew") - .withPorts(Arrays.asList()) - .withPublicIpAddress("iuubwefqsf"))) - .withRequests( - Arrays - .asList( - new JitNetworkAccessRequestInner() - .withVirtualMachines(Arrays.asList()) - .withStartTimeUtc(OffsetDateTime.parse("2021-06-03T00:57:38Z")) - .withRequestor("tf") - .withJustification("rqwexjkmfxapjwog"), - new JitNetworkAccessRequestInner() - .withVirtualMachines(Arrays.asList()) - .withStartTimeUtc(OffsetDateTime.parse("2021-01-30T20:27:58Z")) - .withRequestor("nobpudcdabtqwpw") - .withJustification("wbzasqbuclj"))); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessPolicyInner.class); - Assertions.assertEquals("p", model.kind()); - Assertions.assertEquals("bnwieholew", model.virtualMachines().get(0).id()); - Assertions.assertEquals("iuubwefqsf", model.virtualMachines().get(0).publicIpAddress()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-03T00:57:38Z"), model.requests().get(0).startTimeUtc()); - Assertions.assertEquals("tf", model.requests().get(0).requestor()); - Assertions.assertEquals("rqwexjkmfxapjwog", model.requests().get(0).justification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyPropertiesTests.java deleted file mode 100644 index 1a3836f3e5c0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyPropertiesTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyProperties; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyVirtualMachine; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessPolicyPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessPolicyProperties model = - BinaryData - .fromString( - "{\"virtualMachines\":[{\"id\":\"fzsvtuikzh\",\"ports\":[],\"publicIpAddress\":\"glcfhmlrqryxyn\"}],\"requests\":[{\"virtualMachines\":[],\"startTimeUtc\":\"2021-01-25T20:50:55Z\",\"requestor\":\"p\",\"justification\":\"vwxzn\"},{\"virtualMachines\":[],\"startTimeUtc\":\"2021-11-01T02:58:07Z\",\"requestor\":\"oeiy\",\"justification\":\"abpfhvfs\"},{\"virtualMachines\":[],\"startTimeUtc\":\"2021-03-03T19:37:28Z\",\"requestor\":\"ntjlr\",\"justification\":\"jkskyr\"},{\"virtualMachines\":[],\"startTimeUtc\":\"2021-02-22T17:46:16Z\",\"requestor\":\"vzidsxwaab\",\"justification\":\"ifrygzn\"}],\"provisioningState\":\"axri\"}") - .toObject(JitNetworkAccessPolicyProperties.class); - Assertions.assertEquals("fzsvtuikzh", model.virtualMachines().get(0).id()); - Assertions.assertEquals("glcfhmlrqryxyn", model.virtualMachines().get(0).publicIpAddress()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-25T20:50:55Z"), model.requests().get(0).startTimeUtc()); - Assertions.assertEquals("p", model.requests().get(0).requestor()); - Assertions.assertEquals("vwxzn", model.requests().get(0).justification()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessPolicyProperties model = - new JitNetworkAccessPolicyProperties() - .withVirtualMachines( - Arrays - .asList( - new JitNetworkAccessPolicyVirtualMachine() - .withId("fzsvtuikzh") - .withPorts(Arrays.asList()) - .withPublicIpAddress("glcfhmlrqryxyn"))) - .withRequests( - Arrays - .asList( - new JitNetworkAccessRequestInner() - .withVirtualMachines(Arrays.asList()) - .withStartTimeUtc(OffsetDateTime.parse("2021-01-25T20:50:55Z")) - .withRequestor("p") - .withJustification("vwxzn"), - new JitNetworkAccessRequestInner() - .withVirtualMachines(Arrays.asList()) - .withStartTimeUtc(OffsetDateTime.parse("2021-11-01T02:58:07Z")) - .withRequestor("oeiy") - .withJustification("abpfhvfs"), - new JitNetworkAccessRequestInner() - .withVirtualMachines(Arrays.asList()) - .withStartTimeUtc(OffsetDateTime.parse("2021-03-03T19:37:28Z")) - .withRequestor("ntjlr") - .withJustification("jkskyr"), - new JitNetworkAccessRequestInner() - .withVirtualMachines(Arrays.asList()) - .withStartTimeUtc(OffsetDateTime.parse("2021-02-22T17:46:16Z")) - .withRequestor("vzidsxwaab") - .withJustification("ifrygzn"))); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessPolicyProperties.class); - Assertions.assertEquals("fzsvtuikzh", model.virtualMachines().get(0).id()); - Assertions.assertEquals("glcfhmlrqryxyn", model.virtualMachines().get(0).publicIpAddress()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-25T20:50:55Z"), model.requests().get(0).startTimeUtc()); - Assertions.assertEquals("p", model.requests().get(0).requestor()); - Assertions.assertEquals("vwxzn", model.requests().get(0).justification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyVirtualMachineTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyVirtualMachineTests.java deleted file mode 100644 index ad224c7ace12..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyVirtualMachineTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyVirtualMachine; -import com.azure.resourcemanager.security.models.JitNetworkAccessPortRule; -import com.azure.resourcemanager.security.models.Protocol; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessPolicyVirtualMachineTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessPolicyVirtualMachine model = - BinaryData - .fromString( - "{\"id\":\"kzobgopxlhsln\",\"ports\":[{\"number\":1024527659,\"protocol\":\"*\",\"allowedSourceAddressPrefix\":\"ixynllxecwcrojp\",\"allowedSourceAddressPrefixes\":[\"hcawjutifdwfmv\"],\"maxRequestAccessDuration\":\"gorqjbttzh\"},{\"number\":65250234,\"protocol\":\"*\",\"allowedSourceAddressPrefix\":\"kafhonqj\",\"allowedSourceAddressPrefixes\":[\"ickpz\",\"cpopmxel\"],\"maxRequestAccessDuration\":\"wcltyjede\"},{\"number\":427218214,\"protocol\":\"*\",\"allowedSourceAddressPrefix\":\"f\",\"allowedSourceAddressPrefixes\":[\"scazuawxtzxpu\",\"mwabzxrvxc\",\"s\"],\"maxRequestAccessDuration\":\"sphaivmxyasflvg\"},{\"number\":1752644697,\"protocol\":\"*\",\"allowedSourceAddressPrefix\":\"ywakoihk\",\"allowedSourceAddressPrefixes\":[\"jblmljhlnymz\",\"tqyryuzcbmqqv\",\"mv\"],\"maxRequestAccessDuration\":\"fgtayxonsup\"}],\"publicIpAddress\":\"jlzqnhc\"}") - .toObject(JitNetworkAccessPolicyVirtualMachine.class); - Assertions.assertEquals("kzobgopxlhsln", model.id()); - Assertions.assertEquals(1024527659, model.ports().get(0).number()); - Assertions.assertEquals(Protocol.ASTERISK, model.ports().get(0).protocol()); - Assertions.assertEquals("ixynllxecwcrojp", model.ports().get(0).allowedSourceAddressPrefix()); - Assertions.assertEquals("hcawjutifdwfmv", model.ports().get(0).allowedSourceAddressPrefixes().get(0)); - Assertions.assertEquals("gorqjbttzh", model.ports().get(0).maxRequestAccessDuration()); - Assertions.assertEquals("jlzqnhc", model.publicIpAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessPolicyVirtualMachine model = - new JitNetworkAccessPolicyVirtualMachine() - .withId("kzobgopxlhsln") - .withPorts( - Arrays - .asList( - new JitNetworkAccessPortRule() - .withNumber(1024527659) - .withProtocol(Protocol.ASTERISK) - .withAllowedSourceAddressPrefix("ixynllxecwcrojp") - .withAllowedSourceAddressPrefixes(Arrays.asList("hcawjutifdwfmv")) - .withMaxRequestAccessDuration("gorqjbttzh"), - new JitNetworkAccessPortRule() - .withNumber(65250234) - .withProtocol(Protocol.ASTERISK) - .withAllowedSourceAddressPrefix("kafhonqj") - .withAllowedSourceAddressPrefixes(Arrays.asList("ickpz", "cpopmxel")) - .withMaxRequestAccessDuration("wcltyjede"), - new JitNetworkAccessPortRule() - .withNumber(427218214) - .withProtocol(Protocol.ASTERISK) - .withAllowedSourceAddressPrefix("f") - .withAllowedSourceAddressPrefixes(Arrays.asList("scazuawxtzxpu", "mwabzxrvxc", "s")) - .withMaxRequestAccessDuration("sphaivmxyasflvg"), - new JitNetworkAccessPortRule() - .withNumber(1752644697) - .withProtocol(Protocol.ASTERISK) - .withAllowedSourceAddressPrefix("ywakoihk") - .withAllowedSourceAddressPrefixes(Arrays.asList("jblmljhlnymz", "tqyryuzcbmqqv", "mv")) - .withMaxRequestAccessDuration("fgtayxonsup"))) - .withPublicIpAddress("jlzqnhc"); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessPolicyVirtualMachine.class); - Assertions.assertEquals("kzobgopxlhsln", model.id()); - Assertions.assertEquals(1024527659, model.ports().get(0).number()); - Assertions.assertEquals(Protocol.ASTERISK, model.ports().get(0).protocol()); - Assertions.assertEquals("ixynllxecwcrojp", model.ports().get(0).allowedSourceAddressPrefix()); - Assertions.assertEquals("hcawjutifdwfmv", model.ports().get(0).allowedSourceAddressPrefixes().get(0)); - Assertions.assertEquals("gorqjbttzh", model.ports().get(0).maxRequestAccessDuration()); - Assertions.assertEquals("jlzqnhc", model.publicIpAddress()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPortRuleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPortRuleTests.java deleted file mode 100644 index 7aa5a94171a5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPortRuleTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.JitNetworkAccessPortRule; -import com.azure.resourcemanager.security.models.Protocol; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessPortRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessPortRule model = - BinaryData - .fromString( - "{\"number\":1664438715,\"protocol\":\"UDP\",\"allowedSourceAddressPrefix\":\"tnzoibgsxgnxfy\",\"allowedSourceAddressPrefixes\":[\"mpqoxw\",\"o\",\"dbxiqx\"],\"maxRequestAccessDuration\":\"iiqbi\"}") - .toObject(JitNetworkAccessPortRule.class); - Assertions.assertEquals(1664438715, model.number()); - Assertions.assertEquals(Protocol.UDP, model.protocol()); - Assertions.assertEquals("tnzoibgsxgnxfy", model.allowedSourceAddressPrefix()); - Assertions.assertEquals("mpqoxw", model.allowedSourceAddressPrefixes().get(0)); - Assertions.assertEquals("iiqbi", model.maxRequestAccessDuration()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessPortRule model = - new JitNetworkAccessPortRule() - .withNumber(1664438715) - .withProtocol(Protocol.UDP) - .withAllowedSourceAddressPrefix("tnzoibgsxgnxfy") - .withAllowedSourceAddressPrefixes(Arrays.asList("mpqoxw", "o", "dbxiqx")) - .withMaxRequestAccessDuration("iiqbi"); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessPortRule.class); - Assertions.assertEquals(1664438715, model.number()); - Assertions.assertEquals(Protocol.UDP, model.protocol()); - Assertions.assertEquals("tnzoibgsxgnxfy", model.allowedSourceAddressPrefix()); - Assertions.assertEquals("mpqoxw", model.allowedSourceAddressPrefixes().get(0)); - Assertions.assertEquals("iiqbi", model.maxRequestAccessDuration()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestInnerTests.java deleted file mode 100644 index 971f33535ba9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestInnerTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequestVirtualMachine; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessRequestInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessRequestInner model = - BinaryData - .fromString( - "{\"virtualMachines\":[{\"id\":\"tmwwi\",\"ports\":[]},{\"id\":\"ehfqpofvwbc\",\"ports\":[]}],\"startTimeUtc\":\"2021-02-06T20:45:07Z\",\"requestor\":\"mbnkb\",\"justification\":\"qvxkd\"}") - .toObject(JitNetworkAccessRequestInner.class); - Assertions.assertEquals("tmwwi", model.virtualMachines().get(0).id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T20:45:07Z"), model.startTimeUtc()); - Assertions.assertEquals("mbnkb", model.requestor()); - Assertions.assertEquals("qvxkd", model.justification()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessRequestInner model = - new JitNetworkAccessRequestInner() - .withVirtualMachines( - Arrays - .asList( - new JitNetworkAccessRequestVirtualMachine().withId("tmwwi").withPorts(Arrays.asList()), - new JitNetworkAccessRequestVirtualMachine() - .withId("ehfqpofvwbc") - .withPorts(Arrays.asList()))) - .withStartTimeUtc(OffsetDateTime.parse("2021-02-06T20:45:07Z")) - .withRequestor("mbnkb") - .withJustification("qvxkd"); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessRequestInner.class); - Assertions.assertEquals("tmwwi", model.virtualMachines().get(0).id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T20:45:07Z"), model.startTimeUtc()); - Assertions.assertEquals("mbnkb", model.requestor()); - Assertions.assertEquals("qvxkd", model.justification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestPortTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestPortTests.java deleted file mode 100644 index 3d5fb39d2d5d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestPortTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequestPort; -import com.azure.resourcemanager.security.models.Status; -import com.azure.resourcemanager.security.models.StatusReason; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessRequestPortTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessRequestPort model = - BinaryData - .fromString( - "{\"number\":839780472,\"allowedSourceAddressPrefix\":\"hzfylsgcrpfbc\",\"allowedSourceAddressPrefixes\":[\"zzcezelfwyfwlw\",\"jwetnpsihcla\"],\"endTimeUtc\":\"2021-03-16T15:49:25Z\",\"status\":\"Revoked\",\"statusReason\":\"UserRequested\",\"mappedPort\":743676437}") - .toObject(JitNetworkAccessRequestPort.class); - Assertions.assertEquals(839780472, model.number()); - Assertions.assertEquals("hzfylsgcrpfbc", model.allowedSourceAddressPrefix()); - Assertions.assertEquals("zzcezelfwyfwlw", model.allowedSourceAddressPrefixes().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-16T15:49:25Z"), model.endTimeUtc()); - Assertions.assertEquals(Status.REVOKED, model.status()); - Assertions.assertEquals(StatusReason.USER_REQUESTED, model.statusReason()); - Assertions.assertEquals(743676437, model.mappedPort()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessRequestPort model = - new JitNetworkAccessRequestPort() - .withNumber(839780472) - .withAllowedSourceAddressPrefix("hzfylsgcrpfbc") - .withAllowedSourceAddressPrefixes(Arrays.asList("zzcezelfwyfwlw", "jwetnpsihcla")) - .withEndTimeUtc(OffsetDateTime.parse("2021-03-16T15:49:25Z")) - .withStatus(Status.REVOKED) - .withStatusReason(StatusReason.USER_REQUESTED) - .withMappedPort(743676437); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessRequestPort.class); - Assertions.assertEquals(839780472, model.number()); - Assertions.assertEquals("hzfylsgcrpfbc", model.allowedSourceAddressPrefix()); - Assertions.assertEquals("zzcezelfwyfwlw", model.allowedSourceAddressPrefixes().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-16T15:49:25Z"), model.endTimeUtc()); - Assertions.assertEquals(Status.REVOKED, model.status()); - Assertions.assertEquals(StatusReason.USER_REQUESTED, model.statusReason()); - Assertions.assertEquals(743676437, model.mappedPort()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestVirtualMachineTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestVirtualMachineTests.java deleted file mode 100644 index 6c4b4cc81a9c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestVirtualMachineTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequestPort; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequestVirtualMachine; -import com.azure.resourcemanager.security.models.Status; -import com.azure.resourcemanager.security.models.StatusReason; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessRequestVirtualMachineTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessRequestVirtualMachine model = - BinaryData - .fromString( - "{\"id\":\"vqihebwtswbzuwf\",\"ports\":[{\"number\":1479921462,\"allowedSourceAddressPrefix\":\"agegiz\",\"allowedSourceAddressPrefixes\":[\"felisdjub\",\"gbqi\",\"kxkbsazgakgacyr\",\"m\"],\"endTimeUtc\":\"2021-07-17T04:39:31Z\",\"status\":\"Initiated\",\"statusReason\":\"Expired\",\"mappedPort\":374782594},{\"number\":1831739785,\"allowedSourceAddressPrefix\":\"pv\",\"allowedSourceAddressPrefixes\":[\"ylnio\",\"rz\",\"bzjedmstk\"],\"endTimeUtc\":\"2021-11-19T17:56:37Z\",\"status\":\"Revoked\",\"statusReason\":\"Expired\",\"mappedPort\":1553181859},{\"number\":114492978,\"allowedSourceAddressPrefix\":\"iiznktwfan\",\"allowedSourceAddressPrefixes\":[\"pdibmikostbzbki\"],\"endTimeUtc\":\"2021-11-09T06:15:16Z\",\"status\":\"Revoked\",\"statusReason\":\"NewerRequestInitiated\",\"mappedPort\":1276364779}]}") - .toObject(JitNetworkAccessRequestVirtualMachine.class); - Assertions.assertEquals("vqihebwtswbzuwf", model.id()); - Assertions.assertEquals(1479921462, model.ports().get(0).number()); - Assertions.assertEquals("agegiz", model.ports().get(0).allowedSourceAddressPrefix()); - Assertions.assertEquals("felisdjub", model.ports().get(0).allowedSourceAddressPrefixes().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-17T04:39:31Z"), model.ports().get(0).endTimeUtc()); - Assertions.assertEquals(Status.INITIATED, model.ports().get(0).status()); - Assertions.assertEquals(StatusReason.EXPIRED, model.ports().get(0).statusReason()); - Assertions.assertEquals(374782594, model.ports().get(0).mappedPort()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessRequestVirtualMachine model = - new JitNetworkAccessRequestVirtualMachine() - .withId("vqihebwtswbzuwf") - .withPorts( - Arrays - .asList( - new JitNetworkAccessRequestPort() - .withNumber(1479921462) - .withAllowedSourceAddressPrefix("agegiz") - .withAllowedSourceAddressPrefixes( - Arrays.asList("felisdjub", "gbqi", "kxkbsazgakgacyr", "m")) - .withEndTimeUtc(OffsetDateTime.parse("2021-07-17T04:39:31Z")) - .withStatus(Status.INITIATED) - .withStatusReason(StatusReason.EXPIRED) - .withMappedPort(374782594), - new JitNetworkAccessRequestPort() - .withNumber(1831739785) - .withAllowedSourceAddressPrefix("pv") - .withAllowedSourceAddressPrefixes(Arrays.asList("ylnio", "rz", "bzjedmstk")) - .withEndTimeUtc(OffsetDateTime.parse("2021-11-19T17:56:37Z")) - .withStatus(Status.REVOKED) - .withStatusReason(StatusReason.EXPIRED) - .withMappedPort(1553181859), - new JitNetworkAccessRequestPort() - .withNumber(114492978) - .withAllowedSourceAddressPrefix("iiznktwfan") - .withAllowedSourceAddressPrefixes(Arrays.asList("pdibmikostbzbki")) - .withEndTimeUtc(OffsetDateTime.parse("2021-11-09T06:15:16Z")) - .withStatus(Status.REVOKED) - .withStatusReason(StatusReason.NEWER_REQUEST_INITIATED) - .withMappedPort(1276364779))); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessRequestVirtualMachine.class); - Assertions.assertEquals("vqihebwtswbzuwf", model.id()); - Assertions.assertEquals(1479921462, model.ports().get(0).number()); - Assertions.assertEquals("agegiz", model.ports().get(0).allowedSourceAddressPrefix()); - Assertions.assertEquals("felisdjub", model.ports().get(0).allowedSourceAddressPrefixes().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-17T04:39:31Z"), model.ports().get(0).endTimeUtc()); - Assertions.assertEquals(Status.INITIATED, model.ports().get(0).status()); - Assertions.assertEquals(StatusReason.EXPIRED, model.ports().get(0).statusReason()); - Assertions.assertEquals(374782594, model.ports().get(0).mappedPort()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/KindAutoGeneratedTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/KindAutoGeneratedTests.java deleted file mode 100644 index 81395b2e1c72..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/KindAutoGeneratedTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.KindAutoGenerated; -import org.junit.jupiter.api.Assertions; - -public final class KindAutoGeneratedTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - KindAutoGenerated model = BinaryData.fromString("{\"kind\":\"mczuo\"}").toObject(KindAutoGenerated.class); - Assertions.assertEquals("mczuo", model.kind()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - KindAutoGenerated model = new KindAutoGenerated().withKind("mczuo"); - model = BinaryData.fromObject(model).toObject(KindAutoGenerated.class); - Assertions.assertEquals("mczuo", model.kind()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ListCustomAlertRuleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ListCustomAlertRuleTests.java deleted file mode 100644 index fd9e2819e974..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ListCustomAlertRuleTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ListCustomAlertRule; -import org.junit.jupiter.api.Assertions; - -public final class ListCustomAlertRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ListCustomAlertRule model = - BinaryData - .fromString( - "{\"ruleType\":\"ListCustomAlertRule\",\"valueType\":\"String\",\"displayName\":\"xnj\",\"description\":\"seiphe\",\"isEnabled\":false}") - .toObject(ListCustomAlertRule.class); - Assertions.assertEquals(false, model.isEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ListCustomAlertRule model = new ListCustomAlertRule().withIsEnabled(false); - model = BinaryData.fromObject(model).toObject(ListCustomAlertRule.class); - Assertions.assertEquals(false, model.isEnabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocalUserNotAllowedTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocalUserNotAllowedTests.java deleted file mode 100644 index 6c7ac78cdcce..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocalUserNotAllowedTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.LocalUserNotAllowed; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LocalUserNotAllowedTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LocalUserNotAllowed model = - BinaryData - .fromString( - "{\"ruleType\":\"LocalUserNotAllowed\",\"allowlistValues\":[\"rijwai\",\"fanraybfu\",\"qfrojsydgrhyd\",\"ygywe\"],\"valueType\":\"String\",\"displayName\":\"ec\",\"description\":\"ygzmxieqvdsmak\",\"isEnabled\":true}") - .toObject(LocalUserNotAllowed.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals("rijwai", model.allowlistValues().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LocalUserNotAllowed model = - new LocalUserNotAllowed() - .withIsEnabled(true) - .withAllowlistValues(Arrays.asList("rijwai", "fanraybfu", "qfrojsydgrhyd", "ygywe")); - model = BinaryData.fromObject(model).toObject(LocalUserNotAllowed.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals("rijwai", model.allowlistValues().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationTests.java deleted file mode 100644 index 3233ca4fc910..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Location; - -public final class LocationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Location model = BinaryData.fromString("{\"location\":\"zunbixx\"}").toObject(Location.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Location model = new Location(); - model = BinaryData.fromObject(model).toObject(Location.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationsGetWithResponseMockTests.java deleted file mode 100644 index 1d362fe8ce8a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationsGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AscLocation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class LocationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":\"datacqydey\",\"id\":\"vskiczd\",\"name\":\"rjeizik\",\"type\":\"qaboohxbms\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AscLocation response = - manager.locations().getWithResponse("ighctxbxmo", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationsListMockTests.java deleted file mode 100644 index be83688b7c89..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationsListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AscLocation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class LocationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":\"dataifrhjulrsul\",\"id\":\"zpfl\",\"name\":\"snawmhhgzotfri\",\"type\":\"rgkoekvzwxxyx\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.locations().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LogAnalyticsIdentifierTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LogAnalyticsIdentifierTests.java deleted file mode 100644 index a806e1adb8a0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LogAnalyticsIdentifierTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.LogAnalyticsIdentifier; - -public final class LogAnalyticsIdentifierTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogAnalyticsIdentifier model = - BinaryData - .fromString( - "{\"type\":\"LogAnalytics\",\"workspaceId\":\"o\",\"workspaceSubscriptionId\":\"qocarkuzlbc\",\"workspaceResourceGroup\":\"dtsnxawqytllhdyz\",\"agentId\":\"ckze\"}") - .toObject(LogAnalyticsIdentifier.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogAnalyticsIdentifier model = new LogAnalyticsIdentifier(); - model = BinaryData.fromObject(model).toObject(LogAnalyticsIdentifier.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataInnerTests.java deleted file mode 100644 index 9e9d55146699..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner; - -public final class MdeOnboardingDataInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MdeOnboardingDataInner model = - BinaryData - .fromString( - "{\"properties\":{},\"id\":\"oqijgkdmbpaz\",\"name\":\"obcu\",\"type\":\"pdznrbtcqqjnqgl\"}") - .toObject(MdeOnboardingDataInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MdeOnboardingDataInner model = new MdeOnboardingDataInner(); - model = BinaryData.fromObject(model).toObject(MdeOnboardingDataInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataListInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataListInnerTests.java deleted file mode 100644 index c6b143d79fa0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataListInnerTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataListInner; -import java.util.Arrays; - -public final class MdeOnboardingDataListInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MdeOnboardingDataListInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{},\"id\":\"vgjxpybczm\",\"name\":\"hmtzopbsphrup\",\"type\":\"dgs\"},{\"properties\":{},\"id\":\"jhphoyc\",\"name\":\"sx\",\"type\":\"obhdxbmtqioqjze\"},{\"properties\":{},\"id\":\"ufpo\",\"name\":\"noi\",\"type\":\"hwlrx\"}]}") - .toObject(MdeOnboardingDataListInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MdeOnboardingDataListInner model = - new MdeOnboardingDataListInner() - .withValue( - Arrays - .asList( - new MdeOnboardingDataInner(), new MdeOnboardingDataInner(), new MdeOnboardingDataInner())); - model = BinaryData.fromObject(model).toObject(MdeOnboardingDataListInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataPropertiesTests.java deleted file mode 100644 index 89dc9b92f31b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataPropertiesTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataProperties; - -public final class MdeOnboardingDataPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MdeOnboardingDataProperties model = BinaryData.fromString("{}").toObject(MdeOnboardingDataProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MdeOnboardingDataProperties model = new MdeOnboardingDataProperties(); - model = BinaryData.fromObject(model).toObject(MdeOnboardingDataProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetWithResponseMockTests.java deleted file mode 100644 index e87a85e07e0b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.MdeOnboardingData; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MdeOnboardingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"properties\":{},\"id\":\"twfhi\",\"name\":\"xwgsa\",\"type\":\"vcipo\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MdeOnboardingData response = - manager.mdeOnboardings().getWithResponse(com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListWithResponseMockTests.java deleted file mode 100644 index 95609d148e3d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.MdeOnboardingDataList; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MdeOnboardingsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"value\":[{\"id\":\"hlgmgbehl\",\"name\":\"txnr\",\"type\":\"lkndrndpgfjodh\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MdeOnboardingDataList response = - manager.mdeOnboardings().listWithResponse(com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttC2DMessagesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttC2DMessagesNotInAllowedRangeTests.java deleted file mode 100644 index 9a5778e44899..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttC2DMessagesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.MqttC2DMessagesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class MqttC2DMessagesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MqttC2DMessagesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"MqttC2DMessagesNotInAllowedRange\",\"timeWindowSize\":\"PT44H32M11S\",\"minThreshold\":2052753548,\"maxThreshold\":1662063978,\"displayName\":\"ds\",\"description\":\"snuyemlowuowhl\",\"isEnabled\":false}") - .toObject(MqttC2DMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(2052753548, model.minThreshold()); - Assertions.assertEquals(1662063978, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT44H32M11S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MqttC2DMessagesNotInAllowedRange model = - new MqttC2DMessagesNotInAllowedRange() - .withIsEnabled(false) - .withMinThreshold(2052753548) - .withMaxThreshold(1662063978) - .withTimeWindowSize(Duration.parse("PT44H32M11S")); - model = BinaryData.fromObject(model).toObject(MqttC2DMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(2052753548, model.minThreshold()); - Assertions.assertEquals(1662063978, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT44H32M11S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttC2DRejectedMessagesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttC2DRejectedMessagesNotInAllowedRangeTests.java deleted file mode 100644 index 036867ab0f18..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttC2DRejectedMessagesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.MqttC2DRejectedMessagesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class MqttC2DRejectedMessagesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MqttC2DRejectedMessagesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"MqttC2DRejectedMessagesNotInAllowedRange\",\"timeWindowSize\":\"PT88H6M23S\",\"minThreshold\":953823508,\"maxThreshold\":1995489309,\"displayName\":\"dxlwyojbfqz\",\"description\":\"fnjyix\",\"isEnabled\":false}") - .toObject(MqttC2DRejectedMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(953823508, model.minThreshold()); - Assertions.assertEquals(1995489309, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT88H6M23S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MqttC2DRejectedMessagesNotInAllowedRange model = - new MqttC2DRejectedMessagesNotInAllowedRange() - .withIsEnabled(false) - .withMinThreshold(953823508) - .withMaxThreshold(1995489309) - .withTimeWindowSize(Duration.parse("PT88H6M23S")); - model = BinaryData.fromObject(model).toObject(MqttC2DRejectedMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(953823508, model.minThreshold()); - Assertions.assertEquals(1995489309, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT88H6M23S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttD2CMessagesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttD2CMessagesNotInAllowedRangeTests.java deleted file mode 100644 index 211e6d4039f0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttD2CMessagesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.MqttD2CMessagesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class MqttD2CMessagesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MqttD2CMessagesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"MqttD2CMessagesNotInAllowedRange\",\"timeWindowSize\":\"PT217H45M3S\",\"minThreshold\":1518371143,\"maxThreshold\":1402835309,\"displayName\":\"gryfqiuasig\",\"description\":\"wsocnequygdjbo\",\"isEnabled\":false}") - .toObject(MqttD2CMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1518371143, model.minThreshold()); - Assertions.assertEquals(1402835309, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT217H45M3S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MqttD2CMessagesNotInAllowedRange model = - new MqttD2CMessagesNotInAllowedRange() - .withIsEnabled(false) - .withMinThreshold(1518371143) - .withMaxThreshold(1402835309) - .withTimeWindowSize(Duration.parse("PT217H45M3S")); - model = BinaryData.fromObject(model).toObject(MqttD2CMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1518371143, model.minThreshold()); - Assertions.assertEquals(1402835309, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT217H45M3S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OnPremiseResourceDetailsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OnPremiseResourceDetailsTests.java deleted file mode 100644 index d05839a18a3e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OnPremiseResourceDetailsTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.OnPremiseResourceDetails; -import org.junit.jupiter.api.Assertions; - -public final class OnPremiseResourceDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OnPremiseResourceDetails model = - BinaryData - .fromString( - "{\"source\":\"OnPremise\",\"workspaceId\":\"ilaywkdcwm\",\"vmuuid\":\"syril\",\"sourceComputerId\":\"hxdqaol\",\"machineName\":\"ylnkkbjpjvlywltm\"}") - .toObject(OnPremiseResourceDetails.class); - Assertions.assertEquals("ilaywkdcwm", model.workspaceId()); - Assertions.assertEquals("syril", model.vmuuid()); - Assertions.assertEquals("hxdqaol", model.sourceComputerId()); - Assertions.assertEquals("ylnkkbjpjvlywltm", model.machineName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OnPremiseResourceDetails model = - new OnPremiseResourceDetails() - .withWorkspaceId("ilaywkdcwm") - .withVmuuid("syril") - .withSourceComputerId("hxdqaol") - .withMachineName("ylnkkbjpjvlywltm"); - model = BinaryData.fromObject(model).toObject(OnPremiseResourceDetails.class); - Assertions.assertEquals("ilaywkdcwm", model.workspaceId()); - Assertions.assertEquals("syril", model.vmuuid()); - Assertions.assertEquals("hxdqaol", model.sourceComputerId()); - Assertions.assertEquals("ylnkkbjpjvlywltm", model.machineName()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OnPremiseSqlResourceDetailsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OnPremiseSqlResourceDetailsTests.java deleted file mode 100644 index e278f5b0f7ed..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OnPremiseSqlResourceDetailsTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.OnPremiseSqlResourceDetails; -import org.junit.jupiter.api.Assertions; - -public final class OnPremiseSqlResourceDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OnPremiseSqlResourceDetails model = - BinaryData - .fromString( - "{\"source\":\"OnPremiseSql\",\"serverName\":\"wob\",\"databaseName\":\"jw\",\"workspaceId\":\"lwyjfnqzocrdz\",\"vmuuid\":\"czeuntgx\",\"sourceComputerId\":\"ncaqttiekoifu\",\"machineName\":\"nyttzgix\"}") - .toObject(OnPremiseSqlResourceDetails.class); - Assertions.assertEquals("lwyjfnqzocrdz", model.workspaceId()); - Assertions.assertEquals("czeuntgx", model.vmuuid()); - Assertions.assertEquals("ncaqttiekoifu", model.sourceComputerId()); - Assertions.assertEquals("nyttzgix", model.machineName()); - Assertions.assertEquals("wob", model.serverName()); - Assertions.assertEquals("jw", model.databaseName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OnPremiseSqlResourceDetails model = - new OnPremiseSqlResourceDetails() - .withWorkspaceId("lwyjfnqzocrdz") - .withVmuuid("czeuntgx") - .withSourceComputerId("ncaqttiekoifu") - .withMachineName("nyttzgix") - .withServerName("wob") - .withDatabaseName("jw"); - model = BinaryData.fromObject(model).toObject(OnPremiseSqlResourceDetails.class); - Assertions.assertEquals("lwyjfnqzocrdz", model.workspaceId()); - Assertions.assertEquals("czeuntgx", model.vmuuid()); - Assertions.assertEquals("ncaqttiekoifu", model.sourceComputerId()); - Assertions.assertEquals("nyttzgix", model.machineName()); - Assertions.assertEquals("wob", model.serverName()); - Assertions.assertEquals("jw", model.databaseName()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationDisplayTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationDisplayTests.java deleted file mode 100644 index 09d62012e821..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationDisplayTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"kvpuvksgplsaknyn\",\"resource\":\"ynl\",\"operation\":\"huopxodlqiynto\",\"description\":\"ihleos\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationInnerTests.java deleted file mode 100644 index ed927f37bc49..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.OperationInner; -import com.azure.resourcemanager.security.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"e\",\"origin\":\"zar\",\"display\":{\"provider\":\"q\",\"resource\":\"ijfqkacewiipfp\",\"operation\":\"ji\",\"description\":\"wifto\"}}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationListTests.java deleted file mode 100644 index adcc5225ce3f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationListTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.OperationInner; -import com.azure.resourcemanager.security.models.OperationDisplay; -import com.azure.resourcemanager.security.models.OperationList; -import java.util.Arrays; - -public final class OperationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationList model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"nwashrtd\",\"origin\":\"cnqxwbpokulpi\",\"display\":{\"provider\":\"aasipqi\",\"resource\":\"byuqerpqlp\",\"operation\":\"cciuqgbdbutau\",\"description\":\"btkuwhh\"}},{\"name\":\"ykojoxafnndlpic\",\"origin\":\"o\",\"display\":{\"provider\":\"cdyhbpkkpwdreqn\",\"resource\":\"vq\",\"operation\":\"vljxywsu\",\"description\":\"yrs\"}}],\"nextLink\":\"sytgadgvraea\"}") - .toObject(OperationList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationList model = - new OperationList() - .withValue( - Arrays - .asList( - new OperationInner().withDisplay(new OperationDisplay()), - new OperationInner().withDisplay(new OperationDisplay()))); - model = BinaryData.fromObject(model).toObject(OperationList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationResultAutoGeneratedInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationResultAutoGeneratedInnerTests.java deleted file mode 100644 index 674d96a98b2f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationResultAutoGeneratedInnerTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; - -public final class OperationResultAutoGeneratedInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationResultAutoGeneratedInner model = - BinaryData.fromString("{\"status\":\"Succeeded\"}").toObject(OperationResultAutoGeneratedInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationResultAutoGeneratedInner model = new OperationResultAutoGeneratedInner(); - model = BinaryData.fromObject(model).toObject(OperationResultAutoGeneratedInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PathRecommendationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PathRecommendationTests.java deleted file mode 100644 index 93105f0342d2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PathRecommendationTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ConfigurationStatus; -import com.azure.resourcemanager.security.models.FileType; -import com.azure.resourcemanager.security.models.PathRecommendation; -import com.azure.resourcemanager.security.models.PublisherInfo; -import com.azure.resourcemanager.security.models.RecommendationAction; -import com.azure.resourcemanager.security.models.RecommendationType; -import com.azure.resourcemanager.security.models.UserRecommendation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PathRecommendationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PathRecommendation model = - BinaryData - .fromString( - "{\"path\":\"sgbpfgzdjtx\",\"action\":\"Remove\",\"type\":\"IoT_InstallAgent\",\"publisherInfo\":{\"publisherName\":\"gaqvlgafcqusrd\",\"productName\":\"t\",\"binaryName\":\"sdtutnwlduyc\",\"version\":\"zhyrmewipmve\"},\"common\":false,\"userSids\":[\"uqgsj\",\"xundxgk\",\"twzhhzjhfjmhv\",\"muvgp\"],\"usernames\":[{\"username\":\"qsxvmhf\",\"recommendationAction\":\"Remove\"},{\"username\":\"yihsasbhudypohyu\",\"recommendationAction\":\"Add\"}],\"fileType\":\"Script\",\"configurationStatus\":\"NoStatus\"}") - .toObject(PathRecommendation.class); - Assertions.assertEquals("sgbpfgzdjtx", model.path()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.action()); - Assertions.assertEquals(RecommendationType.IO_T_INSTALL_AGENT, model.type()); - Assertions.assertEquals("gaqvlgafcqusrd", model.publisherInfo().publisherName()); - Assertions.assertEquals("t", model.publisherInfo().productName()); - Assertions.assertEquals("sdtutnwlduyc", model.publisherInfo().binaryName()); - Assertions.assertEquals("zhyrmewipmve", model.publisherInfo().version()); - Assertions.assertEquals(false, model.common()); - Assertions.assertEquals("uqgsj", model.userSids().get(0)); - Assertions.assertEquals("qsxvmhf", model.usernames().get(0).username()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.usernames().get(0).recommendationAction()); - Assertions.assertEquals(FileType.SCRIPT, model.fileType()); - Assertions.assertEquals(ConfigurationStatus.NO_STATUS, model.configurationStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PathRecommendation model = - new PathRecommendation() - .withPath("sgbpfgzdjtx") - .withAction(RecommendationAction.REMOVE) - .withType(RecommendationType.IO_T_INSTALL_AGENT) - .withPublisherInfo( - new PublisherInfo() - .withPublisherName("gaqvlgafcqusrd") - .withProductName("t") - .withBinaryName("sdtutnwlduyc") - .withVersion("zhyrmewipmve")) - .withCommon(false) - .withUserSids(Arrays.asList("uqgsj", "xundxgk", "twzhhzjhfjmhv", "muvgp")) - .withUsernames( - Arrays - .asList( - new UserRecommendation() - .withUsername("qsxvmhf") - .withRecommendationAction(RecommendationAction.REMOVE), - new UserRecommendation() - .withUsername("yihsasbhudypohyu") - .withRecommendationAction(RecommendationAction.ADD))) - .withFileType(FileType.SCRIPT) - .withConfigurationStatus(ConfigurationStatus.NO_STATUS); - model = BinaryData.fromObject(model).toObject(PathRecommendation.class); - Assertions.assertEquals("sgbpfgzdjtx", model.path()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.action()); - Assertions.assertEquals(RecommendationType.IO_T_INSTALL_AGENT, model.type()); - Assertions.assertEquals("gaqvlgafcqusrd", model.publisherInfo().publisherName()); - Assertions.assertEquals("t", model.publisherInfo().productName()); - Assertions.assertEquals("sdtutnwlduyc", model.publisherInfo().binaryName()); - Assertions.assertEquals("zhyrmewipmve", model.publisherInfo().version()); - Assertions.assertEquals(false, model.common()); - Assertions.assertEquals("uqgsj", model.userSids().get(0)); - Assertions.assertEquals("qsxvmhf", model.usernames().get(0).username()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.usernames().get(0).recommendationAction()); - Assertions.assertEquals(FileType.SCRIPT, model.fileType()); - Assertions.assertEquals(ConfigurationStatus.NO_STATUS, model.configurationStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingInnerTests.java deleted file mode 100644 index c1116922488e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingInnerTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.PricingInner; -import com.azure.resourcemanager.security.models.Extension; -import com.azure.resourcemanager.security.models.IsEnabled; -import com.azure.resourcemanager.security.models.PricingTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PricingInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PricingInner model = - BinaryData - .fromString( - "{\"properties\":{\"pricingTier\":\"Standard\",\"subPlan\":\"dqytbciqfouflmm\",\"freeTrialRemainingTime\":\"PT108H50M46S\",\"enablementTime\":\"2021-02-23T09:34:26Z\",\"deprecated\":false,\"replacedBy\":[\"lougpbkw\",\"mutduqktaps\"],\"extensions\":[{\"name\":\"cuertu\",\"isEnabled\":\"True\",\"additionalExtensionProperties\":{}}]},\"id\":\"svqwhbmdgbbjfd\",\"name\":\"gmbmbexppbh\",\"type\":\"q\"}") - .toObject(PricingInner.class); - Assertions.assertEquals(PricingTier.STANDARD, model.pricingTier()); - Assertions.assertEquals("dqytbciqfouflmm", model.subPlan()); - Assertions.assertEquals("cuertu", model.extensions().get(0).name()); - Assertions.assertEquals(IsEnabled.TRUE, model.extensions().get(0).isEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PricingInner model = - new PricingInner() - .withPricingTier(PricingTier.STANDARD) - .withSubPlan("dqytbciqfouflmm") - .withExtensions( - Arrays - .asList( - new Extension() - .withName("cuertu") - .withIsEnabled(IsEnabled.TRUE) - .withAdditionalExtensionProperties(mapOf()))); - model = BinaryData.fromObject(model).toObject(PricingInner.class); - Assertions.assertEquals(PricingTier.STANDARD, model.pricingTier()); - Assertions.assertEquals("dqytbciqfouflmm", model.subPlan()); - Assertions.assertEquals("cuertu", model.extensions().get(0).name()); - Assertions.assertEquals(IsEnabled.TRUE, model.extensions().get(0).isEnabled()); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingListInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingListInnerTests.java deleted file mode 100644 index 2397e29b4a9e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingListInnerTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.PricingInner; -import com.azure.resourcemanager.security.fluent.models.PricingListInner; -import com.azure.resourcemanager.security.models.PricingTier; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PricingListInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PricingListInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"pricingTier\":\"Standard\",\"subPlan\":\"nqpjwnzlljfmpp\",\"freeTrialRemainingTime\":\"PT46H48M36S\",\"enablementTime\":\"2021-10-30T03:41:11Z\",\"deprecated\":true,\"replacedBy\":[],\"extensions\":[]},\"id\":\"bkyqduu\",\"name\":\"itcjczdz\",\"type\":\"vndhkrwpdapp\"},{\"properties\":{\"pricingTier\":\"Standard\",\"subPlan\":\"kvwrwjfeu\",\"freeTrialRemainingTime\":\"PT36H39M29S\",\"enablementTime\":\"2021-01-02T14:30:26Z\",\"deprecated\":true,\"replacedBy\":[],\"extensions\":[]},\"id\":\"mrldhu\",\"name\":\"jzzd\",\"type\":\"tqxhocdgeab\"},{\"properties\":{\"pricingTier\":\"Free\",\"subPlan\":\"uticndvkaozwyif\",\"freeTrialRemainingTime\":\"PT23H12M54S\",\"enablementTime\":\"2021-10-09T12:18:53Z\",\"deprecated\":false,\"replacedBy\":[],\"extensions\":[]},\"id\":\"ftyxolniw\",\"name\":\"wcukjfkgiawxk\",\"type\":\"ryplwckbasyypn\"},{\"properties\":{\"pricingTier\":\"Standard\",\"subPlan\":\"gcbacphejkot\",\"freeTrialRemainingTime\":\"PT157H5M51S\",\"enablementTime\":\"2021-02-05T05:14:14Z\",\"deprecated\":false,\"replacedBy\":[],\"extensions\":[]},\"id\":\"dlikwyqkgfgibma\",\"name\":\"gakeqsr\",\"type\":\"yb\"}]}") - .toObject(PricingListInner.class); - Assertions.assertEquals(PricingTier.STANDARD, model.value().get(0).pricingTier()); - Assertions.assertEquals("nqpjwnzlljfmpp", model.value().get(0).subPlan()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PricingListInner model = - new PricingListInner() - .withValue( - Arrays - .asList( - new PricingInner() - .withPricingTier(PricingTier.STANDARD) - .withSubPlan("nqpjwnzlljfmpp") - .withExtensions(Arrays.asList()), - new PricingInner() - .withPricingTier(PricingTier.STANDARD) - .withSubPlan("kvwrwjfeu") - .withExtensions(Arrays.asList()), - new PricingInner() - .withPricingTier(PricingTier.FREE) - .withSubPlan("uticndvkaozwyif") - .withExtensions(Arrays.asList()), - new PricingInner() - .withPricingTier(PricingTier.STANDARD) - .withSubPlan("gcbacphejkot") - .withExtensions(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(PricingListInner.class); - Assertions.assertEquals(PricingTier.STANDARD, model.value().get(0).pricingTier()); - Assertions.assertEquals("nqpjwnzlljfmpp", model.value().get(0).subPlan()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsGetWithResponseMockTests.java deleted file mode 100644 index d683a15b0034..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsGetWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Pricing; -import com.azure.resourcemanager.security.models.PricingTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PricingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"pricingTier\":\"Standard\",\"subPlan\":\"rxhjnltcet\",\"freeTrialRemainingTime\":\"PT64H42M27S\",\"enablementTime\":\"2021-02-07T05:21:42Z\",\"deprecated\":false,\"replacedBy\":[\"qkwaruwd\"],\"extensions\":[]},\"id\":\"zxoebwgjxb\",\"name\":\"banbaupwtzv\",\"type\":\"aklozk\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Pricing response = manager.pricings().getWithResponse("glzrs", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals(PricingTier.STANDARD, response.pricingTier()); - Assertions.assertEquals("rxhjnltcet", response.subPlan()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsListWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsListWithResponseMockTests.java deleted file mode 100644 index e2bbb9f74b2c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsListWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.PricingList; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PricingsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"bafo\",\"name\":\"to\",\"type\":\"zhaquvwsxb\"},{\"id\":\"vkervqchoadhrsxq\",\"name\":\"z\",\"type\":\"spabdsrgfa\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PricingList response = manager.pricings().listWithResponse(com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsUpdateWithResponseMockTests.java deleted file mode 100644 index c7a2d86a2604..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsUpdateWithResponseMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.fluent.models.PricingInner; -import com.azure.resourcemanager.security.models.Pricing; -import com.azure.resourcemanager.security.models.PricingTier; -import java.nio.ByteBuffer; -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 org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PricingsUpdateWithResponseMockTests { - @Test - public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"pricingTier\":\"Standard\",\"subPlan\":\"ojkpoyh\",\"freeTrialRemainingTime\":\"PT131H58M8S\",\"enablementTime\":\"2021-11-09T18:13:39Z\",\"deprecated\":true,\"replacedBy\":[\"dljzgdyrc\"],\"extensions\":[]},\"id\":\"bsgzl\",\"name\":\"qhbjnqogdxwbsfpy\",\"type\":\"x\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Pricing response = - manager - .pricings() - .updateWithResponse( - "bzrpejp", - new PricingInner() - .withPricingTier(PricingTier.FREE) - .withSubPlan("nbtttkgsuxu") - .withExtensions(Arrays.asList()), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PricingTier.STANDARD, response.pricingTier()); - Assertions.assertEquals("ojkpoyh", response.subPlan()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProcessNotAllowedTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProcessNotAllowedTests.java deleted file mode 100644 index 91e9d144ff55..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProcessNotAllowedTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ProcessNotAllowed; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ProcessNotAllowedTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProcessNotAllowed model = - BinaryData - .fromString( - "{\"ruleType\":\"ProcessNotAllowed\",\"allowlistValues\":[\"qcahyhxal\"],\"valueType\":\"String\",\"displayName\":\"woijpodtbl\",\"description\":\"kkwjdjodq\",\"isEnabled\":true}") - .toObject(ProcessNotAllowed.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals("qcahyhxal", model.allowlistValues().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProcessNotAllowed model = - new ProcessNotAllowed().withIsEnabled(true).withAllowlistValues(Arrays.asList("qcahyhxal")); - model = BinaryData.fromObject(model).toObject(ProcessNotAllowed.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals("qcahyhxal", model.allowlistValues().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProtectionModeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProtectionModeTests.java deleted file mode 100644 index 9eb6bf3ff376..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProtectionModeTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.EnforcementMode; -import com.azure.resourcemanager.security.models.ProtectionMode; -import org.junit.jupiter.api.Assertions; - -public final class ProtectionModeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProtectionMode model = - BinaryData - .fromString("{\"exe\":\"Audit\",\"msi\":\"None\",\"script\":\"Enforce\",\"executable\":\"None\"}") - .toObject(ProtectionMode.class); - Assertions.assertEquals(EnforcementMode.AUDIT, model.exe()); - Assertions.assertEquals(EnforcementMode.NONE, model.msi()); - Assertions.assertEquals(EnforcementMode.ENFORCE, model.script()); - Assertions.assertEquals(EnforcementMode.NONE, model.executable()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProtectionMode model = - new ProtectionMode() - .withExe(EnforcementMode.AUDIT) - .withMsi(EnforcementMode.NONE) - .withScript(EnforcementMode.ENFORCE) - .withExecutable(EnforcementMode.NONE); - model = BinaryData.fromObject(model).toObject(ProtectionMode.class); - Assertions.assertEquals(EnforcementMode.AUDIT, model.exe()); - Assertions.assertEquals(EnforcementMode.NONE, model.msi()); - Assertions.assertEquals(EnforcementMode.ENFORCE, model.script()); - Assertions.assertEquals(EnforcementMode.NONE, model.executable()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProxyServerPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProxyServerPropertiesTests.java deleted file mode 100644 index 5966a7851905..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProxyServerPropertiesTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ProxyServerProperties; -import org.junit.jupiter.api.Assertions; - -public final class ProxyServerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProxyServerProperties model = - BinaryData.fromString("{\"ip\":\"lobdxna\",\"port\":\"mkmlmvevfx\"}").toObject(ProxyServerProperties.class); - Assertions.assertEquals("lobdxna", model.ip()); - Assertions.assertEquals("mkmlmvevfx", model.port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProxyServerProperties model = new ProxyServerProperties().withIp("lobdxna").withPort("mkmlmvevfx"); - model = BinaryData.fromObject(model).toObject(ProxyServerProperties.class); - Assertions.assertEquals("lobdxna", model.ip()); - Assertions.assertEquals("mkmlmvevfx", model.port()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PublisherInfoTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PublisherInfoTests.java deleted file mode 100644 index 54dfb9a18650..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PublisherInfoTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.PublisherInfo; -import org.junit.jupiter.api.Assertions; - -public final class PublisherInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PublisherInfo model = - BinaryData - .fromString( - "{\"publisherName\":\"yrpfoobrlttymsj\",\"productName\":\"gqdnfwqzd\",\"binaryName\":\"tilaxh\",\"version\":\"hqlyvijo\"}") - .toObject(PublisherInfo.class); - Assertions.assertEquals("yrpfoobrlttymsj", model.publisherName()); - Assertions.assertEquals("gqdnfwqzd", model.productName()); - Assertions.assertEquals("tilaxh", model.binaryName()); - Assertions.assertEquals("hqlyvijo", model.version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PublisherInfo model = - new PublisherInfo() - .withPublisherName("yrpfoobrlttymsj") - .withProductName("gqdnfwqzd") - .withBinaryName("tilaxh") - .withVersion("hqlyvijo"); - model = BinaryData.fromObject(model).toObject(PublisherInfo.class); - Assertions.assertEquals("yrpfoobrlttymsj", model.publisherName()); - Assertions.assertEquals("gqdnfwqzd", model.productName()); - Assertions.assertEquals("tilaxh", model.binaryName()); - Assertions.assertEquals("hqlyvijo", model.version()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/QueryCheckTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/QueryCheckTests.java deleted file mode 100644 index 429b84ab107c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/QueryCheckTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.QueryCheck; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class QueryCheckTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QueryCheck model = - BinaryData - .fromString( - "{\"query\":\"vcoqraswugyxpqi\",\"expectedResult\":[[\"alwvskbu\",\"z\"],[\"aq\"],[\"ltcoqc\",\"jpds\",\"zakuejk\"]],\"columnNames\":[\"iztjof\"]}") - .toObject(QueryCheck.class); - Assertions.assertEquals("vcoqraswugyxpqi", model.query()); - Assertions.assertEquals("alwvskbu", model.expectedResult().get(0).get(0)); - Assertions.assertEquals("iztjof", model.columnNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QueryCheck model = - new QueryCheck() - .withQuery("vcoqraswugyxpqi") - .withExpectedResult( - Arrays - .asList( - Arrays.asList("alwvskbu", "z"), - Arrays.asList("aq"), - Arrays.asList("ltcoqc", "jpds", "zakuejk"))) - .withColumnNames(Arrays.asList("iztjof")); - model = BinaryData.fromObject(model).toObject(QueryCheck.class); - Assertions.assertEquals("vcoqraswugyxpqi", model.query()); - Assertions.assertEquals("alwvskbu", model.expectedResult().get(0).get(0)); - Assertions.assertEquals("iztjof", model.columnNames().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/QueuePurgesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/QueuePurgesNotInAllowedRangeTests.java deleted file mode 100644 index acb13069353f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/QueuePurgesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.QueuePurgesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class QueuePurgesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QueuePurgesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"QueuePurgesNotInAllowedRange\",\"timeWindowSize\":\"PT46H8M28S\",\"minThreshold\":1596956883,\"maxThreshold\":2124553044,\"displayName\":\"xqiubxdukecpx\",\"description\":\"zvdhctmmkosz\",\"isEnabled\":true}") - .toObject(QueuePurgesNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1596956883, model.minThreshold()); - Assertions.assertEquals(2124553044, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT46H8M28S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QueuePurgesNotInAllowedRange model = - new QueuePurgesNotInAllowedRange() - .withIsEnabled(true) - .withMinThreshold(1596956883) - .withMaxThreshold(2124553044) - .withTimeWindowSize(Duration.parse("PT46H8M28S")); - model = BinaryData.fromObject(model).toObject(QueuePurgesNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1596956883, model.minThreshold()); - Assertions.assertEquals(2124553044, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT46H8M28S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RecommendationConfigurationPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RecommendationConfigurationPropertiesTests.java deleted file mode 100644 index ff75f20716cc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RecommendationConfigurationPropertiesTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.RecommendationConfigStatus; -import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.RecommendationType; -import org.junit.jupiter.api.Assertions; - -public final class RecommendationConfigurationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RecommendationConfigurationProperties model = - BinaryData - .fromString( - "{\"recommendationType\":\"IoT_PermissiveFirewallPolicy\",\"name\":\"xepcyvahfn\",\"status\":\"Disabled\"}") - .toObject(RecommendationConfigurationProperties.class); - Assertions.assertEquals(RecommendationType.IO_T_PERMISSIVE_FIREWALL_POLICY, model.recommendationType()); - Assertions.assertEquals(RecommendationConfigStatus.DISABLED, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RecommendationConfigurationProperties model = - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_PERMISSIVE_FIREWALL_POLICY) - .withStatus(RecommendationConfigStatus.DISABLED); - model = BinaryData.fromObject(model).toObject(RecommendationConfigurationProperties.class); - Assertions.assertEquals(RecommendationType.IO_T_PERMISSIVE_FIREWALL_POLICY, model.recommendationType()); - Assertions.assertEquals(RecommendationConfigStatus.DISABLED, model.status()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentInnerTests.java deleted file mode 100644 index 2d63f783869e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentInnerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentInner; -import com.azure.resourcemanager.security.models.State; -import org.junit.jupiter.api.Assertions; - -public final class RegulatoryComplianceAssessmentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegulatoryComplianceAssessmentInner model = - BinaryData - .fromString( - "{\"properties\":{\"description\":\"jsyingwfqatm\",\"assessmentType\":\"htmdvy\",\"assessmentDetailsLink\":\"ikdgszywkbir\",\"state\":\"Skipped\",\"passedResources\":1689730147,\"failedResources\":1361399231,\"skippedResources\":632633713,\"unsupportedResources\":1267831893},\"id\":\"rvqqaatj\",\"name\":\"nrvgoupmfiibfgg\",\"type\":\"ioolvrwxkvtkkgll\"}") - .toObject(RegulatoryComplianceAssessmentInner.class); - Assertions.assertEquals(State.SKIPPED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegulatoryComplianceAssessmentInner model = new RegulatoryComplianceAssessmentInner().withState(State.SKIPPED); - model = BinaryData.fromObject(model).toObject(RegulatoryComplianceAssessmentInner.class); - Assertions.assertEquals(State.SKIPPED, model.state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentListTests.java deleted file mode 100644 index b04f25b5d195..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentListTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessmentList; -import com.azure.resourcemanager.security.models.State; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RegulatoryComplianceAssessmentListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegulatoryComplianceAssessmentList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"description\":\"jguufzdm\",\"assessmentType\":\"qtfihwhbotzinga\",\"assessmentDetailsLink\":\"pph\",\"state\":\"Failed\",\"passedResources\":1174017685,\"failedResources\":1680525224,\"skippedResources\":1947700175,\"unsupportedResources\":1694830705},\"id\":\"mvdk\",\"name\":\"wynwcvtbvkayhm\",\"type\":\"nvyq\"},{\"properties\":{\"description\":\"kzwpcnpw\",\"assessmentType\":\"jaesgvvsccya\",\"assessmentDetailsLink\":\"uq\",\"state\":\"Unsupported\",\"passedResources\":288302688,\"failedResources\":1810005859,\"skippedResources\":1249464934,\"unsupportedResources\":826622083},\"id\":\"fxusemdwzr\",\"name\":\"uh\",\"type\":\"pfcqdp\"},{\"properties\":{\"description\":\"qvpsvuoymg\",\"assessmentType\":\"elvezrypq\",\"assessmentDetailsLink\":\"feo\",\"state\":\"Failed\",\"passedResources\":1007513685,\"failedResources\":835251373,\"skippedResources\":137094818,\"unsupportedResources\":1870547697},\"id\":\"opgxedkowepb\",\"name\":\"pc\",\"type\":\"fkbw\"}],\"nextLink\":\"snjvcdwxlpqekftn\"}") - .toObject(RegulatoryComplianceAssessmentList.class); - Assertions.assertEquals(State.FAILED, model.value().get(0).state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegulatoryComplianceAssessmentList model = - new RegulatoryComplianceAssessmentList() - .withValue( - Arrays - .asList( - new RegulatoryComplianceAssessmentInner().withState(State.FAILED), - new RegulatoryComplianceAssessmentInner().withState(State.UNSUPPORTED), - new RegulatoryComplianceAssessmentInner().withState(State.FAILED))); - model = BinaryData.fromObject(model).toObject(RegulatoryComplianceAssessmentList.class); - Assertions.assertEquals(State.FAILED, model.value().get(0).state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentPropertiesTests.java deleted file mode 100644 index aed7d8293083..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentProperties; -import com.azure.resourcemanager.security.models.State; -import org.junit.jupiter.api.Assertions; - -public final class RegulatoryComplianceAssessmentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegulatoryComplianceAssessmentProperties model = - BinaryData - .fromString( - "{\"description\":\"jygvjayvbl\",\"assessmentType\":\"vkzuhbxvvyhgso\",\"assessmentDetailsLink\":\"yrqufegxuvwz\",\"state\":\"Skipped\",\"passedResources\":1709616859,\"failedResources\":882366629,\"skippedResources\":171252991,\"unsupportedResources\":488471027}") - .toObject(RegulatoryComplianceAssessmentProperties.class); - Assertions.assertEquals(State.SKIPPED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegulatoryComplianceAssessmentProperties model = - new RegulatoryComplianceAssessmentProperties().withState(State.SKIPPED); - model = BinaryData.fromObject(model).toObject(RegulatoryComplianceAssessmentProperties.class); - Assertions.assertEquals(State.SKIPPED, model.state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsGetWithResponseMockTests.java deleted file mode 100644 index 51fa5e4e92fd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessment; -import com.azure.resourcemanager.security.models.State; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RegulatoryComplianceAssessmentsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"description\":\"oshjgcze\",\"assessmentType\":\"bnxgzt\",\"assessmentDetailsLink\":\"gctjch\",\"state\":\"Unsupported\",\"passedResources\":1976746044,\"failedResources\":11816420,\"skippedResources\":549834402,\"unsupportedResources\":630846895},\"id\":\"cu\",\"name\":\"lbefvwc\",\"type\":\"jkxpylrwoxzgwpsy\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RegulatoryComplianceAssessment response = - manager - .regulatoryComplianceAssessments() - .getWithResponse("ldahlfxlmu", "fmuad", "nfsncs", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(State.UNSUPPORTED, response.state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsListMockTests.java deleted file mode 100644 index cfafa78526f1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsListMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessment; -import com.azure.resourcemanager.security.models.State; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RegulatoryComplianceAssessmentsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"otjgxieqfkyfhi\",\"assessmentType\":\"jaqupbyynvskpaj\",\"assessmentDetailsLink\":\"geumexm\",\"state\":\"Skipped\",\"passedResources\":1361345524,\"failedResources\":401303949,\"skippedResources\":997716401,\"unsupportedResources\":1703770909},\"id\":\"txapeqiscrpilgf\",\"name\":\"rqre\",\"type\":\"daahuqi\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .regulatoryComplianceAssessments() - .list("uw", "jmwvvbtuqkxxi", "wgxql", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(State.SKIPPED, response.iterator().next().state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlInnerTests.java deleted file mode 100644 index 51989f4b62b1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlInnerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlInner; -import com.azure.resourcemanager.security.models.State; -import org.junit.jupiter.api.Assertions; - -public final class RegulatoryComplianceControlInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegulatoryComplianceControlInner model = - BinaryData - .fromString( - "{\"properties\":{\"description\":\"eljag\",\"state\":\"Skipped\",\"passedAssessments\":1903317968,\"failedAssessments\":777528334,\"skippedAssessments\":1378743202},\"id\":\"iiiojnalghf\",\"name\":\"vtvsexsowueluq\",\"type\":\"hahhxvrhmzkwpj\"}") - .toObject(RegulatoryComplianceControlInner.class); - Assertions.assertEquals(State.SKIPPED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegulatoryComplianceControlInner model = new RegulatoryComplianceControlInner().withState(State.SKIPPED); - model = BinaryData.fromObject(model).toObject(RegulatoryComplianceControlInner.class); - Assertions.assertEquals(State.SKIPPED, model.state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlListTests.java deleted file mode 100644 index 1e1b423cd7d9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlListTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceControlList; -import com.azure.resourcemanager.security.models.State; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RegulatoryComplianceControlListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegulatoryComplianceControlList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"description\":\"mbzonokix\",\"state\":\"Passed\",\"passedAssessments\":1122267125,\"failedAssessments\":1711524187,\"skippedAssessments\":2101008571},\"id\":\"frl\",\"name\":\"zszrnwoiindfpw\",\"type\":\"jylwbtlhflsj\"}],\"nextLink\":\"hszfjvfb\"}") - .toObject(RegulatoryComplianceControlList.class); - Assertions.assertEquals(State.PASSED, model.value().get(0).state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegulatoryComplianceControlList model = - new RegulatoryComplianceControlList() - .withValue(Arrays.asList(new RegulatoryComplianceControlInner().withState(State.PASSED))); - model = BinaryData.fromObject(model).toObject(RegulatoryComplianceControlList.class); - Assertions.assertEquals(State.PASSED, model.value().get(0).state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlPropertiesTests.java deleted file mode 100644 index 97780d0b2f47..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlProperties; -import com.azure.resourcemanager.security.models.State; -import org.junit.jupiter.api.Assertions; - -public final class RegulatoryComplianceControlPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegulatoryComplianceControlProperties model = - BinaryData - .fromString( - "{\"description\":\"wspughftqsxhqx\",\"state\":\"Skipped\",\"passedAssessments\":649615996,\"failedAssessments\":1485711526,\"skippedAssessments\":2084244471}") - .toObject(RegulatoryComplianceControlProperties.class); - Assertions.assertEquals(State.SKIPPED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegulatoryComplianceControlProperties model = - new RegulatoryComplianceControlProperties().withState(State.SKIPPED); - model = BinaryData.fromObject(model).toObject(RegulatoryComplianceControlProperties.class); - Assertions.assertEquals(State.SKIPPED, model.state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsGetWithResponseMockTests.java deleted file mode 100644 index 2c867d51342a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RegulatoryComplianceControl; -import com.azure.resourcemanager.security.models.State; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RegulatoryComplianceControlsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"description\":\"fokyks\",\"state\":\"Passed\",\"passedAssessments\":944337652,\"failedAssessments\":1143447896,\"skippedAssessments\":1950190822},\"id\":\"kcxzz\",\"name\":\"nuif\",\"type\":\"rsejegprkj\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RegulatoryComplianceControl response = - manager - .regulatoryComplianceControls() - .getWithResponse("lrrskap", "xwieexuyade", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(State.PASSED, response.state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsListMockTests.java deleted file mode 100644 index d030b87d8cf0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsListMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RegulatoryComplianceControl; -import com.azure.resourcemanager.security.models.State; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RegulatoryComplianceControlsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"wxiplkyso\",\"state\":\"Failed\",\"passedAssessments\":67847643,\"failedAssessments\":1371951498,\"skippedAssessments\":658802312},\"id\":\"whdmcvhtbbz\",\"name\":\"hfvhuwzbxpcqz\",\"type\":\"ihotjecohmxv\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .regulatoryComplianceControls() - .list("yhcdjwsuoardnag", "tpufpbpgnrholhu", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(State.FAILED, response.iterator().next().state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardInnerTests.java deleted file mode 100644 index af1d82ec432b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardInnerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardInner; -import com.azure.resourcemanager.security.models.State; -import org.junit.jupiter.api.Assertions; - -public final class RegulatoryComplianceStandardInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegulatoryComplianceStandardInner model = - BinaryData - .fromString( - "{\"properties\":{\"state\":\"Skipped\",\"passedControls\":738746300,\"failedControls\":638872994,\"skippedControls\":110101001,\"unsupportedControls\":174588693},\"id\":\"ib\",\"name\":\"rcgp\",\"type\":\"kpzi\"}") - .toObject(RegulatoryComplianceStandardInner.class); - Assertions.assertEquals(State.SKIPPED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegulatoryComplianceStandardInner model = new RegulatoryComplianceStandardInner().withState(State.SKIPPED); - model = BinaryData.fromObject(model).toObject(RegulatoryComplianceStandardInner.class); - Assertions.assertEquals(State.SKIPPED, model.state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardListTests.java deleted file mode 100644 index 7557e7ec0183..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardListTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceStandardList; -import com.azure.resourcemanager.security.models.State; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RegulatoryComplianceStandardListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegulatoryComplianceStandardList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"state\":\"Skipped\",\"passedControls\":1997907611,\"failedControls\":2111279751,\"skippedControls\":1073194543,\"unsupportedControls\":387671304},\"id\":\"p\",\"name\":\"jxbkzbzkdvn\",\"type\":\"jabudurgkakmo\"},{\"properties\":{\"state\":\"Failed\",\"passedControls\":893447379,\"failedControls\":873562090,\"skippedControls\":1182691834,\"unsupportedControls\":783879068},\"id\":\"uwqlgzrfzeey\",\"name\":\"bizikayuhq\",\"type\":\"bjbsybb\"},{\"properties\":{\"state\":\"Unsupported\",\"passedControls\":948234782,\"failedControls\":1918019278,\"skippedControls\":348550148,\"unsupportedControls\":1644492935},\"id\":\"vm\",\"name\":\"ipaslthaqfxssmwu\",\"type\":\"wbdsr\"}],\"nextLink\":\"pdrhne\"}") - .toObject(RegulatoryComplianceStandardList.class); - Assertions.assertEquals(State.SKIPPED, model.value().get(0).state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegulatoryComplianceStandardList model = - new RegulatoryComplianceStandardList() - .withValue( - Arrays - .asList( - new RegulatoryComplianceStandardInner().withState(State.SKIPPED), - new RegulatoryComplianceStandardInner().withState(State.FAILED), - new RegulatoryComplianceStandardInner().withState(State.UNSUPPORTED))); - model = BinaryData.fromObject(model).toObject(RegulatoryComplianceStandardList.class); - Assertions.assertEquals(State.SKIPPED, model.value().get(0).state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardPropertiesTests.java deleted file mode 100644 index fa2123da0edc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardProperties; -import com.azure.resourcemanager.security.models.State; -import org.junit.jupiter.api.Assertions; - -public final class RegulatoryComplianceStandardPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegulatoryComplianceStandardProperties model = - BinaryData - .fromString( - "{\"state\":\"Passed\",\"passedControls\":1289922635,\"failedControls\":2016240775,\"skippedControls\":1785480642,\"unsupportedControls\":1319362662}") - .toObject(RegulatoryComplianceStandardProperties.class); - Assertions.assertEquals(State.PASSED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegulatoryComplianceStandardProperties model = - new RegulatoryComplianceStandardProperties().withState(State.PASSED); - model = BinaryData.fromObject(model).toObject(RegulatoryComplianceStandardProperties.class); - Assertions.assertEquals(State.PASSED, model.state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsGetWithResponseMockTests.java deleted file mode 100644 index 880f5141db77..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RegulatoryComplianceStandard; -import com.azure.resourcemanager.security.models.State; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RegulatoryComplianceStandardsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"state\":\"Passed\",\"passedControls\":1731687538,\"failedControls\":1363649991,\"skippedControls\":453247963,\"unsupportedControls\":1503663605},\"id\":\"lriqbyokvjgbzs\",\"name\":\"e\",\"type\":\"rsltt\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RegulatoryComplianceStandard response = - manager - .regulatoryComplianceStandards() - .getWithResponse("qwulynkgfcfdru", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(State.PASSED, response.state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsListMockTests.java deleted file mode 100644 index 9d89eb70051e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsListMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RegulatoryComplianceStandard; -import com.azure.resourcemanager.security.models.State; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RegulatoryComplianceStandardsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"state\":\"Failed\",\"passedControls\":1575047020,\"failedControls\":1278915874,\"skippedControls\":1490193432,\"unsupportedControls\":146432492},\"id\":\"wiinjdllw\",\"name\":\"tlepowavvqxua\",\"type\":\"g\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.regulatoryComplianceStandards().list("uiadhbatecaatsdo", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(State.FAILED, response.iterator().next().state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RemediationEtaTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RemediationEtaTests.java deleted file mode 100644 index 4d3e2f24307f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RemediationEtaTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.RemediationEta; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class RemediationEtaTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RemediationEta model = - BinaryData - .fromString("{\"eta\":\"2021-03-27T00:38:49Z\",\"justification\":\"dbztjhqtfbov\"}") - .toObject(RemediationEta.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-27T00:38:49Z"), model.eta()); - Assertions.assertEquals("dbztjhqtfbov", model.justification()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RemediationEta model = - new RemediationEta() - .withEta(OffsetDateTime.parse("2021-03-27T00:38:49Z")) - .withJustification("dbztjhqtfbov"); - model = BinaryData.fromObject(model).toObject(RemediationEta.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-27T00:38:49Z"), model.eta()); - Assertions.assertEquals("dbztjhqtfbov", model.justification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RemediationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RemediationTests.java deleted file mode 100644 index 930327a8121d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RemediationTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Remediation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RemediationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Remediation model = - BinaryData - .fromString( - "{\"description\":\"kzykjtjk\",\"scripts\":[\"fwushcdpkupn\",\"rmgjfbpkuwx\"],\"automated\":true,\"portalLink\":\"jfizfavkjzwfbc\"}") - .toObject(Remediation.class); - Assertions.assertEquals("kzykjtjk", model.description()); - Assertions.assertEquals("fwushcdpkupn", model.scripts().get(0)); - Assertions.assertEquals(true, model.automated()); - Assertions.assertEquals("jfizfavkjzwfbc", model.portalLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Remediation model = - new Remediation() - .withDescription("kzykjtjk") - .withScripts(Arrays.asList("fwushcdpkupn", "rmgjfbpkuwx")) - .withAutomated(true) - .withPortalLink("jfizfavkjzwfbc"); - model = BinaryData.fromObject(model).toObject(Remediation.class); - Assertions.assertEquals("kzykjtjk", model.description()); - Assertions.assertEquals("fwushcdpkupn", model.scripts().get(0)); - Assertions.assertEquals(true, model.automated()); - Assertions.assertEquals("jfizfavkjzwfbc", model.portalLink()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceDetailsAutoGeneratedTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceDetailsAutoGeneratedTests.java deleted file mode 100644 index 8ba7719eae1f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceDetailsAutoGeneratedTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ResourceDetailsAutoGenerated; -import com.azure.resourcemanager.security.models.Source; -import org.junit.jupiter.api.Assertions; - -public final class ResourceDetailsAutoGeneratedTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceDetailsAutoGenerated model = - BinaryData - .fromString("{\"source\":\"Azure\",\"id\":\"qr\",\"connectorId\":\"tjzcfyjzpt\"}") - .toObject(ResourceDetailsAutoGenerated.class); - Assertions.assertEquals(Source.AZURE, model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceDetailsAutoGenerated model = new ResourceDetailsAutoGenerated().withSource(Source.AZURE); - model = BinaryData.fromObject(model).toObject(ResourceDetailsAutoGenerated.class); - Assertions.assertEquals(Source.AZURE, model.source()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceDetailsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceDetailsTests.java deleted file mode 100644 index 3caac7e5de92..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceDetailsTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ResourceDetails; - -public final class ResourceDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceDetails model = - BinaryData.fromString("{\"source\":\"ResourceDetails\"}").toObject(ResourceDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceDetails model = new ResourceDetails(); - model = BinaryData.fromObject(model).toObject(ResourceDetails.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceIdentifierTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceIdentifierTests.java deleted file mode 100644 index befa25b139d5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceIdentifierTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ResourceIdentifier; - -public final class ResourceIdentifierTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceIdentifier model = - BinaryData.fromString("{\"type\":\"ResourceIdentifier\"}").toObject(ResourceIdentifier.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceIdentifier model = new ResourceIdentifier(); - model = BinaryData.fromObject(model).toObject(ResourceIdentifier.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsInnerTests.java deleted file mode 100644 index 6cc2011caabf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsInnerTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RuleResultsInner; -import com.azure.resourcemanager.security.models.RuleResultsProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RuleResultsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RuleResultsInner model = - BinaryData - .fromString( - "{\"properties\":{\"results\":[[\"exdnd\",\"bdweade\",\"zmwntopagt\"]]},\"id\":\"mvmmagoaqylkjz\",\"name\":\"jiuazjc\",\"type\":\"mxitpfinzcpd\"}") - .toObject(RuleResultsInner.class); - Assertions.assertEquals("exdnd", model.properties().results().get(0).get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RuleResultsInner model = - new RuleResultsInner() - .withProperties( - new RuleResultsProperties() - .withResults(Arrays.asList(Arrays.asList("exdnd", "bdweade", "zmwntopagt")))); - model = BinaryData.fromObject(model).toObject(RuleResultsInner.class); - Assertions.assertEquals("exdnd", model.properties().results().get(0).get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsInputTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsInputTests.java deleted file mode 100644 index b371a08444c0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsInputTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.RuleResultsInput; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RuleResultsInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RuleResultsInput model = - BinaryData - .fromString("{\"latestScan\":false,\"results\":[[\"gvxvatv\",\"rkdlb\",\"bqxvhcsyhzlwxae\"]]}") - .toObject(RuleResultsInput.class); - Assertions.assertEquals(false, model.latestScan()); - Assertions.assertEquals("gvxvatv", model.results().get(0).get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RuleResultsInput model = - new RuleResultsInput() - .withLatestScan(false) - .withResults(Arrays.asList(Arrays.asList("gvxvatv", "rkdlb", "bqxvhcsyhzlwxae"))); - model = BinaryData.fromObject(model).toObject(RuleResultsInput.class); - Assertions.assertEquals(false, model.latestScan()); - Assertions.assertEquals("gvxvatv", model.results().get(0).get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsPropertiesTests.java deleted file mode 100644 index 6b8e3992ee35..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsPropertiesTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.RuleResultsProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RuleResultsPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RuleResultsProperties model = - BinaryData - .fromString("{\"results\":[[\"lgjmtbd\",\"vcqguefzh\"],[\"p\",\"eqdurelyujlfyoum\"]]}") - .toObject(RuleResultsProperties.class); - Assertions.assertEquals("lgjmtbd", model.results().get(0).get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RuleResultsProperties model = - new RuleResultsProperties() - .withResults( - Arrays.asList(Arrays.asList("lgjmtbd", "vcqguefzh"), Arrays.asList("p", "eqdurelyujlfyoum"))); - model = BinaryData.fromObject(model).toObject(RuleResultsProperties.class); - Assertions.assertEquals("lgjmtbd", model.results().get(0).get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleTests.java deleted file mode 100644 index 3d55194c942d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Direction; -import com.azure.resourcemanager.security.models.Rule; -import com.azure.resourcemanager.security.models.TransportProtocol; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Rule model = - BinaryData - .fromString( - "{\"name\":\"dfgsftufqobrj\",\"direction\":\"Outbound\",\"destinationPort\":1823557197,\"protocols\":[\"UDP\",\"TCP\",\"TCP\"],\"ipAddresses\":[\"kizvytn\",\"zvulj\"]}") - .toObject(Rule.class); - Assertions.assertEquals("dfgsftufqobrj", model.name()); - Assertions.assertEquals(Direction.OUTBOUND, model.direction()); - Assertions.assertEquals(1823557197, model.destinationPort()); - Assertions.assertEquals(TransportProtocol.UDP, model.protocols().get(0)); - Assertions.assertEquals("kizvytn", model.ipAddresses().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Rule model = - new Rule() - .withName("dfgsftufqobrj") - .withDirection(Direction.OUTBOUND) - .withDestinationPort(1823557197) - .withProtocols(Arrays.asList(TransportProtocol.UDP, TransportProtocol.TCP, TransportProtocol.TCP)) - .withIpAddresses(Arrays.asList("kizvytn", "zvulj")); - model = BinaryData.fromObject(model).toObject(Rule.class); - Assertions.assertEquals("dfgsftufqobrj", model.name()); - Assertions.assertEquals(Direction.OUTBOUND, model.direction()); - Assertions.assertEquals(1823557197, model.destinationPort()); - Assertions.assertEquals(TransportProtocol.UDP, model.protocols().get(0)); - Assertions.assertEquals("kizvytn", model.ipAddresses().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RulesResultsInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RulesResultsInnerTests.java deleted file mode 100644 index 495af69a18fd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RulesResultsInnerTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RuleResultsInner; -import com.azure.resourcemanager.security.fluent.models.RulesResultsInner; -import com.azure.resourcemanager.security.models.RuleResultsProperties; -import java.util.Arrays; - -public final class RulesResultsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RulesResultsInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"results\":[]},\"id\":\"clcdigptajbrzmq\",\"name\":\"ucycijo\",\"type\":\"lxiutgjcyzyzjdnr\"},{\"properties\":{\"results\":[]},\"id\":\"txjeaoqaqbzgy\",\"name\":\"fwwvuatbwbqam\",\"type\":\"e\"},{\"properties\":{\"results\":[]},\"id\":\"yslpkcvmw\",\"name\":\"auxxepmyw\",\"type\":\"ormcqmic\"}]}") - .toObject(RulesResultsInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RulesResultsInner model = - new RulesResultsInner() - .withValue( - Arrays - .asList( - new RuleResultsInner() - .withProperties(new RuleResultsProperties().withResults(Arrays.asList())), - new RuleResultsInner() - .withProperties(new RuleResultsProperties().withResults(Arrays.asList())), - new RuleResultsInner() - .withProperties(new RuleResultsProperties().withResults(Arrays.asList())))); - model = BinaryData.fromObject(model).toObject(RulesResultsInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RulesResultsInputTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RulesResultsInputTests.java deleted file mode 100644 index 5e01764d6ecc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RulesResultsInputTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.RulesResultsInput; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class RulesResultsInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RulesResultsInput model = - BinaryData - .fromString( - "{\"latestScan\":false,\"results\":{\"z\":[[\"fbojxjmcsmyqwix\",\"cp\"],[\"kwywzwofalic\",\"duoiqt\",\"mt\"],[\"sknxrwzawnvsbcf\",\"zagxnvhycvdi\",\"wrzregzgyufu\"],[\"wpwerye\"]],\"hnhjtfvpndpmi\":[[\"meottawj\",\"osxw\"]],\"yyshtuwgmevua\":[[\"nwynudq\"],[\"zsauzp\"],[\"xee\",\"uxiqhzlraymezxl\",\"kihmxrfdsajredn\"]]}}") - .toObject(RulesResultsInput.class); - Assertions.assertEquals(false, model.latestScan()); - Assertions.assertEquals("fbojxjmcsmyqwix", model.results().get("z").get(0).get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RulesResultsInput model = - new RulesResultsInput() - .withLatestScan(false) - .withResults( - mapOf( - "z", - Arrays - .asList( - Arrays.asList("fbojxjmcsmyqwix", "cp"), - Arrays.asList("kwywzwofalic", "duoiqt", "mt"), - Arrays.asList("sknxrwzawnvsbcf", "zagxnvhycvdi", "wrzregzgyufu"), - Arrays.asList("wpwerye")), - "hnhjtfvpndpmi", - Arrays.asList(Arrays.asList("meottawj", "osxw")), - "yyshtuwgmevua", - Arrays - .asList( - Arrays.asList("nwynudq"), - Arrays.asList("zsauzp"), - Arrays.asList("xee", "uxiqhzlraymezxl", "kihmxrfdsajredn")))); - model = BinaryData.fromObject(model).toObject(RulesResultsInput.class); - Assertions.assertEquals(false, model.latestScan()); - Assertions.assertEquals("fbojxjmcsmyqwix", model.results().get("z").get(0).get(0)); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanInnerTests.java deleted file mode 100644 index f6ecb2d2df08..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanInnerTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ScanInner; -import com.azure.resourcemanager.security.models.ScanProperties; -import com.azure.resourcemanager.security.models.ScanState; -import com.azure.resourcemanager.security.models.ScanTriggerType; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ScanInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScanInner model = - BinaryData - .fromString( - "{\"properties\":{\"triggerType\":\"OnDemand\",\"state\":\"FailedToRun\",\"server\":\"scmnlziji\",\"database\":\"ehgmvflnwyv\",\"sqlVersion\":\"xrerlniylylyf\",\"startTime\":\"2021-07-06T13:46:49Z\",\"endTime\":\"2021-10-13T07:30Z\",\"highSeverityFailedRulesCount\":940843916,\"mediumSeverityFailedRulesCount\":1491604791,\"lowSeverityFailedRulesCount\":315348665,\"totalPassedRulesCount\":2049313385,\"totalFailedRulesCount\":1986729733,\"totalRulesCount\":260996663,\"isBaselineApplied\":true,\"lastScanTime\":\"2021-06-25T10:35:09Z\"},\"id\":\"cdxa\",\"name\":\"bujftaben\",\"type\":\"bklqpxz\"}") - .toObject(ScanInner.class); - Assertions.assertEquals(ScanTriggerType.ON_DEMAND, model.properties().triggerType()); - Assertions.assertEquals(ScanState.FAILED_TO_RUN, model.properties().state()); - Assertions.assertEquals("scmnlziji", model.properties().server()); - Assertions.assertEquals("ehgmvflnwyv", model.properties().database()); - Assertions.assertEquals("xrerlniylylyf", model.properties().sqlVersion()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-06T13:46:49Z"), model.properties().startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-13T07:30Z"), model.properties().endTime()); - Assertions.assertEquals(940843916, model.properties().highSeverityFailedRulesCount()); - Assertions.assertEquals(1491604791, model.properties().mediumSeverityFailedRulesCount()); - Assertions.assertEquals(315348665, model.properties().lowSeverityFailedRulesCount()); - Assertions.assertEquals(2049313385, model.properties().totalPassedRulesCount()); - Assertions.assertEquals(1986729733, model.properties().totalFailedRulesCount()); - Assertions.assertEquals(260996663, model.properties().totalRulesCount()); - Assertions.assertEquals(true, model.properties().isBaselineApplied()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-25T10:35:09Z"), model.properties().lastScanTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScanInner model = - new ScanInner() - .withProperties( - new ScanProperties() - .withTriggerType(ScanTriggerType.ON_DEMAND) - .withState(ScanState.FAILED_TO_RUN) - .withServer("scmnlziji") - .withDatabase("ehgmvflnwyv") - .withSqlVersion("xrerlniylylyf") - .withStartTime(OffsetDateTime.parse("2021-07-06T13:46:49Z")) - .withEndTime(OffsetDateTime.parse("2021-10-13T07:30Z")) - .withHighSeverityFailedRulesCount(940843916) - .withMediumSeverityFailedRulesCount(1491604791) - .withLowSeverityFailedRulesCount(315348665) - .withTotalPassedRulesCount(2049313385) - .withTotalFailedRulesCount(1986729733) - .withTotalRulesCount(260996663) - .withIsBaselineApplied(true) - .withLastScanTime(OffsetDateTime.parse("2021-06-25T10:35:09Z"))); - model = BinaryData.fromObject(model).toObject(ScanInner.class); - Assertions.assertEquals(ScanTriggerType.ON_DEMAND, model.properties().triggerType()); - Assertions.assertEquals(ScanState.FAILED_TO_RUN, model.properties().state()); - Assertions.assertEquals("scmnlziji", model.properties().server()); - Assertions.assertEquals("ehgmvflnwyv", model.properties().database()); - Assertions.assertEquals("xrerlniylylyf", model.properties().sqlVersion()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-06T13:46:49Z"), model.properties().startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-13T07:30Z"), model.properties().endTime()); - Assertions.assertEquals(940843916, model.properties().highSeverityFailedRulesCount()); - Assertions.assertEquals(1491604791, model.properties().mediumSeverityFailedRulesCount()); - Assertions.assertEquals(315348665, model.properties().lowSeverityFailedRulesCount()); - Assertions.assertEquals(2049313385, model.properties().totalPassedRulesCount()); - Assertions.assertEquals(1986729733, model.properties().totalFailedRulesCount()); - Assertions.assertEquals(260996663, model.properties().totalRulesCount()); - Assertions.assertEquals(true, model.properties().isBaselineApplied()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-25T10:35:09Z"), model.properties().lastScanTime()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanPropertiesTests.java deleted file mode 100644 index 4a55b76d98a9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanPropertiesTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ScanProperties; -import com.azure.resourcemanager.security.models.ScanState; -import com.azure.resourcemanager.security.models.ScanTriggerType; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ScanPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScanProperties model = - BinaryData - .fromString( - "{\"triggerType\":\"Recurring\",\"state\":\"Failed\",\"server\":\"dwwnl\",\"database\":\"fwxudgnhg\",\"sqlVersion\":\"krtalvn\",\"startTime\":\"2021-10-08T14:43:06Z\",\"endTime\":\"2021-07-31T12:16:21Z\",\"highSeverityFailedRulesCount\":518056276,\"mediumSeverityFailedRulesCount\":408640684,\"lowSeverityFailedRulesCount\":1742020192,\"totalPassedRulesCount\":426542999,\"totalFailedRulesCount\":1442817098,\"totalRulesCount\":1323472014,\"isBaselineApplied\":false,\"lastScanTime\":\"2021-08-28T23:34:11Z\"}") - .toObject(ScanProperties.class); - Assertions.assertEquals(ScanTriggerType.RECURRING, model.triggerType()); - Assertions.assertEquals(ScanState.FAILED, model.state()); - Assertions.assertEquals("dwwnl", model.server()); - Assertions.assertEquals("fwxudgnhg", model.database()); - Assertions.assertEquals("krtalvn", model.sqlVersion()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-08T14:43:06Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T12:16:21Z"), model.endTime()); - Assertions.assertEquals(518056276, model.highSeverityFailedRulesCount()); - Assertions.assertEquals(408640684, model.mediumSeverityFailedRulesCount()); - Assertions.assertEquals(1742020192, model.lowSeverityFailedRulesCount()); - Assertions.assertEquals(426542999, model.totalPassedRulesCount()); - Assertions.assertEquals(1442817098, model.totalFailedRulesCount()); - Assertions.assertEquals(1323472014, model.totalRulesCount()); - Assertions.assertEquals(false, model.isBaselineApplied()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-28T23:34:11Z"), model.lastScanTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScanProperties model = - new ScanProperties() - .withTriggerType(ScanTriggerType.RECURRING) - .withState(ScanState.FAILED) - .withServer("dwwnl") - .withDatabase("fwxudgnhg") - .withSqlVersion("krtalvn") - .withStartTime(OffsetDateTime.parse("2021-10-08T14:43:06Z")) - .withEndTime(OffsetDateTime.parse("2021-07-31T12:16:21Z")) - .withHighSeverityFailedRulesCount(518056276) - .withMediumSeverityFailedRulesCount(408640684) - .withLowSeverityFailedRulesCount(1742020192) - .withTotalPassedRulesCount(426542999) - .withTotalFailedRulesCount(1442817098) - .withTotalRulesCount(1323472014) - .withIsBaselineApplied(false) - .withLastScanTime(OffsetDateTime.parse("2021-08-28T23:34:11Z")); - model = BinaryData.fromObject(model).toObject(ScanProperties.class); - Assertions.assertEquals(ScanTriggerType.RECURRING, model.triggerType()); - Assertions.assertEquals(ScanState.FAILED, model.state()); - Assertions.assertEquals("dwwnl", model.server()); - Assertions.assertEquals("fwxudgnhg", model.database()); - Assertions.assertEquals("krtalvn", model.sqlVersion()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-08T14:43:06Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T12:16:21Z"), model.endTime()); - Assertions.assertEquals(518056276, model.highSeverityFailedRulesCount()); - Assertions.assertEquals(408640684, model.mediumSeverityFailedRulesCount()); - Assertions.assertEquals(1742020192, model.lowSeverityFailedRulesCount()); - Assertions.assertEquals(426542999, model.totalPassedRulesCount()); - Assertions.assertEquals(1442817098, model.totalFailedRulesCount()); - Assertions.assertEquals(1323472014, model.totalRulesCount()); - Assertions.assertEquals(false, model.isBaselineApplied()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-28T23:34:11Z"), model.lastScanTime()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultInnerTests.java deleted file mode 100644 index 37d371369217..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultInnerTests.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ScanResultInner; -import com.azure.resourcemanager.security.models.BaselineAdjustedResult; -import com.azure.resourcemanager.security.models.Remediation; -import com.azure.resourcemanager.security.models.RuleSeverity; -import com.azure.resourcemanager.security.models.RuleStatus; -import com.azure.resourcemanager.security.models.RuleType; -import com.azure.resourcemanager.security.models.ScanResultProperties; -import com.azure.resourcemanager.security.models.VaRule; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScanResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScanResultInner model = - BinaryData - .fromString( - "{\"properties\":{\"ruleId\":\"drrslblxydk\",\"status\":\"InternalError\",\"isTrimmed\":true,\"queryResults\":[[\"wkgfbqljnqkh\",\"chocokulehur\",\"lrqff\"],[\"eyu\",\"kphyjdxrav\",\"uqd\"],[\"xmrgchbapxkiy\",\"jjk\",\"ajb\"]],\"remediation\":{\"description\":\"gd\",\"scripts\":[\"ioycbl\",\"vpmclujyxkyxlz\",\"sjgkzzltafh\",\"zffovwmbjl\"],\"automated\":true,\"portalLink\":\"zpgvdwnapfd\"},\"baselineAdjustedResult\":{\"status\":\"Finding\",\"resultsNotInBaseline\":[[],[],[],[]],\"resultsOnlyInBaseline\":[[]]},\"ruleMetadata\":{\"ruleId\":\"jtks\",\"severity\":\"Medium\",\"category\":\"gqy\",\"ruleType\":\"BaselineExpected\",\"title\":\"eyqrhv\",\"description\":\"ldotjvdkwisws\",\"rationale\":\"kjtasb\",\"benchmarkReferences\":[]}},\"id\":\"pkxkdtxfk\",\"name\":\"dlqvtwknvg\",\"type\":\"mb\"}") - .toObject(ScanResultInner.class); - Assertions.assertEquals("drrslblxydk", model.properties().ruleId()); - Assertions.assertEquals(RuleStatus.INTERNAL_ERROR, model.properties().status()); - Assertions.assertEquals(true, model.properties().isTrimmed()); - Assertions.assertEquals("wkgfbqljnqkh", model.properties().queryResults().get(0).get(0)); - Assertions.assertEquals("gd", model.properties().remediation().description()); - Assertions.assertEquals("ioycbl", model.properties().remediation().scripts().get(0)); - Assertions.assertEquals(true, model.properties().remediation().automated()); - Assertions.assertEquals("zpgvdwnapfd", model.properties().remediation().portalLink()); - Assertions.assertEquals(RuleStatus.FINDING, model.properties().baselineAdjustedResult().status()); - Assertions.assertEquals("jtks", model.properties().ruleMetadata().ruleId()); - Assertions.assertEquals(RuleSeverity.MEDIUM, model.properties().ruleMetadata().severity()); - Assertions.assertEquals("gqy", model.properties().ruleMetadata().category()); - Assertions.assertEquals(RuleType.BASELINE_EXPECTED, model.properties().ruleMetadata().ruleType()); - Assertions.assertEquals("eyqrhv", model.properties().ruleMetadata().title()); - Assertions.assertEquals("ldotjvdkwisws", model.properties().ruleMetadata().description()); - Assertions.assertEquals("kjtasb", model.properties().ruleMetadata().rationale()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScanResultInner model = - new ScanResultInner() - .withProperties( - new ScanResultProperties() - .withRuleId("drrslblxydk") - .withStatus(RuleStatus.INTERNAL_ERROR) - .withIsTrimmed(true) - .withQueryResults( - Arrays - .asList( - Arrays.asList("wkgfbqljnqkh", "chocokulehur", "lrqff"), - Arrays.asList("eyu", "kphyjdxrav", "uqd"), - Arrays.asList("xmrgchbapxkiy", "jjk", "ajb"))) - .withRemediation( - new Remediation() - .withDescription("gd") - .withScripts(Arrays.asList("ioycbl", "vpmclujyxkyxlz", "sjgkzzltafh", "zffovwmbjl")) - .withAutomated(true) - .withPortalLink("zpgvdwnapfd")) - .withBaselineAdjustedResult( - new BaselineAdjustedResult() - .withStatus(RuleStatus.FINDING) - .withResultsNotInBaseline( - Arrays.asList(Arrays.asList(), Arrays.asList(), Arrays.asList(), Arrays.asList())) - .withResultsOnlyInBaseline(Arrays.asList(Arrays.asList()))) - .withRuleMetadata( - new VaRule() - .withRuleId("jtks") - .withSeverity(RuleSeverity.MEDIUM) - .withCategory("gqy") - .withRuleType(RuleType.BASELINE_EXPECTED) - .withTitle("eyqrhv") - .withDescription("ldotjvdkwisws") - .withRationale("kjtasb") - .withBenchmarkReferences(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(ScanResultInner.class); - Assertions.assertEquals("drrslblxydk", model.properties().ruleId()); - Assertions.assertEquals(RuleStatus.INTERNAL_ERROR, model.properties().status()); - Assertions.assertEquals(true, model.properties().isTrimmed()); - Assertions.assertEquals("wkgfbqljnqkh", model.properties().queryResults().get(0).get(0)); - Assertions.assertEquals("gd", model.properties().remediation().description()); - Assertions.assertEquals("ioycbl", model.properties().remediation().scripts().get(0)); - Assertions.assertEquals(true, model.properties().remediation().automated()); - Assertions.assertEquals("zpgvdwnapfd", model.properties().remediation().portalLink()); - Assertions.assertEquals(RuleStatus.FINDING, model.properties().baselineAdjustedResult().status()); - Assertions.assertEquals("jtks", model.properties().ruleMetadata().ruleId()); - Assertions.assertEquals(RuleSeverity.MEDIUM, model.properties().ruleMetadata().severity()); - Assertions.assertEquals("gqy", model.properties().ruleMetadata().category()); - Assertions.assertEquals(RuleType.BASELINE_EXPECTED, model.properties().ruleMetadata().ruleType()); - Assertions.assertEquals("eyqrhv", model.properties().ruleMetadata().title()); - Assertions.assertEquals("ldotjvdkwisws", model.properties().ruleMetadata().description()); - Assertions.assertEquals("kjtasb", model.properties().ruleMetadata().rationale()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultPropertiesTests.java deleted file mode 100644 index 3995b13eb622..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultPropertiesTests.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Baseline; -import com.azure.resourcemanager.security.models.BaselineAdjustedResult; -import com.azure.resourcemanager.security.models.BenchmarkReference; -import com.azure.resourcemanager.security.models.QueryCheck; -import com.azure.resourcemanager.security.models.Remediation; -import com.azure.resourcemanager.security.models.RuleSeverity; -import com.azure.resourcemanager.security.models.RuleStatus; -import com.azure.resourcemanager.security.models.RuleType; -import com.azure.resourcemanager.security.models.ScanResultProperties; -import com.azure.resourcemanager.security.models.VaRule; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScanResultPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScanResultProperties model = - BinaryData - .fromString( - "{\"ruleId\":\"tywatmqaq\",\"status\":\"InternalError\",\"isTrimmed\":false,\"queryResults\":[[\"eshoygzcb\",\"fqxkfaoyteh\",\"puvjmvqmtd\",\"ckygroejnndljdju\"],[\"br\"],[\"qyn\"]],\"remediation\":{\"description\":\"ysfaqegplwrysh\",\"scripts\":[\"kvb\"],\"automated\":true,\"portalLink\":\"usybwptdaca\"},\"baselineAdjustedResult\":{\"baseline\":{\"expectedResults\":[[]],\"updatedTime\":\"2021-11-02T10:29:39Z\"},\"status\":\"NonFinding\",\"resultsNotInBaseline\":[[\"iwenazero\",\"zrsq\",\"lsxkd\",\"wqapfgsdp\"]],\"resultsOnlyInBaseline\":[[\"smzhhkuuipldqqct\",\"kva\",\"blhtjq\"],[\"yvwehtaemxh\"],[\"ysev\",\"sxivzrrryvei\",\"ipsk\"]]},\"ruleMetadata\":{\"ruleId\":\"atvfuzkaftj\",\"severity\":\"High\",\"category\":\"xwigsye\",\"ruleType\":\"BaselineExpected\",\"title\":\"smjtgrqgdg\",\"description\":\"ileplk\",\"rationale\":\"mknhwtbbaedor\",\"queryCheck\":{\"query\":\"qfloygbdgwum\",\"expectedResult\":[[],[],[]],\"columnNames\":[\"hpabgdexjddvjs\"]},\"benchmarkReferences\":[{\"benchmark\":\"tm\",\"reference\":\"llcolsrsxapte\"},{\"benchmark\":\"excgjokjljnhvl\",\"reference\":\"bekpeeksnbksdqhj\"},{\"benchmark\":\"klxesl\",\"reference\":\"hustcpoqmavnwqjw\"},{\"benchmark\":\"knlejjjkxybwfd\",\"reference\":\"jbzten\"}]}}") - .toObject(ScanResultProperties.class); - Assertions.assertEquals("tywatmqaq", model.ruleId()); - Assertions.assertEquals(RuleStatus.INTERNAL_ERROR, model.status()); - Assertions.assertEquals(false, model.isTrimmed()); - Assertions.assertEquals("eshoygzcb", model.queryResults().get(0).get(0)); - Assertions.assertEquals("ysfaqegplwrysh", model.remediation().description()); - Assertions.assertEquals("kvb", model.remediation().scripts().get(0)); - Assertions.assertEquals(true, model.remediation().automated()); - Assertions.assertEquals("usybwptdaca", model.remediation().portalLink()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-11-02T10:29:39Z"), model.baselineAdjustedResult().baseline().updatedTime()); - Assertions.assertEquals(RuleStatus.NON_FINDING, model.baselineAdjustedResult().status()); - Assertions.assertEquals("iwenazero", model.baselineAdjustedResult().resultsNotInBaseline().get(0).get(0)); - Assertions - .assertEquals("smzhhkuuipldqqct", model.baselineAdjustedResult().resultsOnlyInBaseline().get(0).get(0)); - Assertions.assertEquals("atvfuzkaftj", model.ruleMetadata().ruleId()); - Assertions.assertEquals(RuleSeverity.HIGH, model.ruleMetadata().severity()); - Assertions.assertEquals("xwigsye", model.ruleMetadata().category()); - Assertions.assertEquals(RuleType.BASELINE_EXPECTED, model.ruleMetadata().ruleType()); - Assertions.assertEquals("smjtgrqgdg", model.ruleMetadata().title()); - Assertions.assertEquals("ileplk", model.ruleMetadata().description()); - Assertions.assertEquals("mknhwtbbaedor", model.ruleMetadata().rationale()); - Assertions.assertEquals("qfloygbdgwum", model.ruleMetadata().queryCheck().query()); - Assertions.assertEquals("hpabgdexjddvjs", model.ruleMetadata().queryCheck().columnNames().get(0)); - Assertions.assertEquals("tm", model.ruleMetadata().benchmarkReferences().get(0).benchmark()); - Assertions.assertEquals("llcolsrsxapte", model.ruleMetadata().benchmarkReferences().get(0).reference()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScanResultProperties model = - new ScanResultProperties() - .withRuleId("tywatmqaq") - .withStatus(RuleStatus.INTERNAL_ERROR) - .withIsTrimmed(false) - .withQueryResults( - Arrays - .asList( - Arrays.asList("eshoygzcb", "fqxkfaoyteh", "puvjmvqmtd", "ckygroejnndljdju"), - Arrays.asList("br"), - Arrays.asList("qyn"))) - .withRemediation( - new Remediation() - .withDescription("ysfaqegplwrysh") - .withScripts(Arrays.asList("kvb")) - .withAutomated(true) - .withPortalLink("usybwptdaca")) - .withBaselineAdjustedResult( - new BaselineAdjustedResult() - .withBaseline( - new Baseline() - .withExpectedResults(Arrays.asList(Arrays.asList())) - .withUpdatedTime(OffsetDateTime.parse("2021-11-02T10:29:39Z"))) - .withStatus(RuleStatus.NON_FINDING) - .withResultsNotInBaseline( - Arrays.asList(Arrays.asList("iwenazero", "zrsq", "lsxkd", "wqapfgsdp"))) - .withResultsOnlyInBaseline( - Arrays - .asList( - Arrays.asList("smzhhkuuipldqqct", "kva", "blhtjq"), - Arrays.asList("yvwehtaemxh"), - Arrays.asList("ysev", "sxivzrrryvei", "ipsk")))) - .withRuleMetadata( - new VaRule() - .withRuleId("atvfuzkaftj") - .withSeverity(RuleSeverity.HIGH) - .withCategory("xwigsye") - .withRuleType(RuleType.BASELINE_EXPECTED) - .withTitle("smjtgrqgdg") - .withDescription("ileplk") - .withRationale("mknhwtbbaedor") - .withQueryCheck( - new QueryCheck() - .withQuery("qfloygbdgwum") - .withExpectedResult(Arrays.asList(Arrays.asList(), Arrays.asList(), Arrays.asList())) - .withColumnNames(Arrays.asList("hpabgdexjddvjs"))) - .withBenchmarkReferences( - Arrays - .asList( - new BenchmarkReference().withBenchmark("tm").withReference("llcolsrsxapte"), - new BenchmarkReference() - .withBenchmark("excgjokjljnhvl") - .withReference("bekpeeksnbksdqhj"), - new BenchmarkReference().withBenchmark("klxesl").withReference("hustcpoqmavnwqjw"), - new BenchmarkReference().withBenchmark("knlejjjkxybwfd").withReference("jbzten")))); - model = BinaryData.fromObject(model).toObject(ScanResultProperties.class); - Assertions.assertEquals("tywatmqaq", model.ruleId()); - Assertions.assertEquals(RuleStatus.INTERNAL_ERROR, model.status()); - Assertions.assertEquals(false, model.isTrimmed()); - Assertions.assertEquals("eshoygzcb", model.queryResults().get(0).get(0)); - Assertions.assertEquals("ysfaqegplwrysh", model.remediation().description()); - Assertions.assertEquals("kvb", model.remediation().scripts().get(0)); - Assertions.assertEquals(true, model.remediation().automated()); - Assertions.assertEquals("usybwptdaca", model.remediation().portalLink()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-11-02T10:29:39Z"), model.baselineAdjustedResult().baseline().updatedTime()); - Assertions.assertEquals(RuleStatus.NON_FINDING, model.baselineAdjustedResult().status()); - Assertions.assertEquals("iwenazero", model.baselineAdjustedResult().resultsNotInBaseline().get(0).get(0)); - Assertions - .assertEquals("smzhhkuuipldqqct", model.baselineAdjustedResult().resultsOnlyInBaseline().get(0).get(0)); - Assertions.assertEquals("atvfuzkaftj", model.ruleMetadata().ruleId()); - Assertions.assertEquals(RuleSeverity.HIGH, model.ruleMetadata().severity()); - Assertions.assertEquals("xwigsye", model.ruleMetadata().category()); - Assertions.assertEquals(RuleType.BASELINE_EXPECTED, model.ruleMetadata().ruleType()); - Assertions.assertEquals("smjtgrqgdg", model.ruleMetadata().title()); - Assertions.assertEquals("ileplk", model.ruleMetadata().description()); - Assertions.assertEquals("mknhwtbbaedor", model.ruleMetadata().rationale()); - Assertions.assertEquals("qfloygbdgwum", model.ruleMetadata().queryCheck().query()); - Assertions.assertEquals("hpabgdexjddvjs", model.ruleMetadata().queryCheck().columnNames().get(0)); - Assertions.assertEquals("tm", model.ruleMetadata().benchmarkReferences().get(0).benchmark()); - Assertions.assertEquals("llcolsrsxapte", model.ruleMetadata().benchmarkReferences().get(0).reference()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultsInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultsInnerTests.java deleted file mode 100644 index 066c735dc66f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultsInnerTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ScanResultInner; -import com.azure.resourcemanager.security.fluent.models.ScanResultsInner; -import com.azure.resourcemanager.security.models.RuleStatus; -import com.azure.resourcemanager.security.models.ScanResultProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScanResultsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScanResultsInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"ruleId\":\"egthortudawl\",\"status\":\"InternalError\",\"isTrimmed\":true,\"queryResults\":[]},\"id\":\"ptcbgqnzmnh\",\"name\":\"ilialwcjgc\",\"type\":\"bbcccgz\"},{\"properties\":{\"ruleId\":\"oxnyuffatsg\",\"status\":\"InternalError\",\"isTrimmed\":true,\"queryResults\":[]},\"id\":\"ubhiqdxyur\",\"name\":\"pnuhzafccnu\",\"type\":\"iig\"}]}") - .toObject(ScanResultsInner.class); - Assertions.assertEquals("egthortudawl", model.value().get(0).properties().ruleId()); - Assertions.assertEquals(RuleStatus.INTERNAL_ERROR, model.value().get(0).properties().status()); - Assertions.assertEquals(true, model.value().get(0).properties().isTrimmed()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScanResultsInner model = - new ScanResultsInner() - .withValue( - Arrays - .asList( - new ScanResultInner() - .withProperties( - new ScanResultProperties() - .withRuleId("egthortudawl") - .withStatus(RuleStatus.INTERNAL_ERROR) - .withIsTrimmed(true) - .withQueryResults(Arrays.asList())), - new ScanResultInner() - .withProperties( - new ScanResultProperties() - .withRuleId("oxnyuffatsg") - .withStatus(RuleStatus.INTERNAL_ERROR) - .withIsTrimmed(true) - .withQueryResults(Arrays.asList())))); - model = BinaryData.fromObject(model).toObject(ScanResultsInner.class); - Assertions.assertEquals("egthortudawl", model.value().get(0).properties().ruleId()); - Assertions.assertEquals(RuleStatus.INTERNAL_ERROR, model.value().get(0).properties().status()); - Assertions.assertEquals(true, model.value().get(0).properties().isTrimmed()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScansInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScansInnerTests.java deleted file mode 100644 index ca8dd95c4abe..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScansInnerTests.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ScanInner; -import com.azure.resourcemanager.security.fluent.models.ScansInner; -import com.azure.resourcemanager.security.models.ScanProperties; -import com.azure.resourcemanager.security.models.ScanState; -import com.azure.resourcemanager.security.models.ScanTriggerType; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScansInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScansInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"triggerType\":\"Recurring\",\"state\":\"FailedToRun\",\"server\":\"xhqf\",\"database\":\"nvzoqgyipemch\",\"sqlVersion\":\"v\",\"startTime\":\"2021-05-29T11:47:50Z\",\"endTime\":\"2021-06-19T08:23:04Z\",\"highSeverityFailedRulesCount\":734341991,\"mediumSeverityFailedRulesCount\":345092138,\"lowSeverityFailedRulesCount\":791767971,\"totalPassedRulesCount\":1804607166,\"totalFailedRulesCount\":1022480930,\"totalRulesCount\":855952943,\"isBaselineApplied\":true,\"lastScanTime\":\"2021-07-01T01:57:52Z\"},\"id\":\"jjstliuhqawmo\",\"name\":\"ia\",\"type\":\"cz\"}]}") - .toObject(ScansInner.class); - Assertions.assertEquals(ScanTriggerType.RECURRING, model.value().get(0).properties().triggerType()); - Assertions.assertEquals(ScanState.FAILED_TO_RUN, model.value().get(0).properties().state()); - Assertions.assertEquals("xhqf", model.value().get(0).properties().server()); - Assertions.assertEquals("nvzoqgyipemch", model.value().get(0).properties().database()); - Assertions.assertEquals("v", model.value().get(0).properties().sqlVersion()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-05-29T11:47:50Z"), model.value().get(0).properties().startTime()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-06-19T08:23:04Z"), model.value().get(0).properties().endTime()); - Assertions.assertEquals(734341991, model.value().get(0).properties().highSeverityFailedRulesCount()); - Assertions.assertEquals(345092138, model.value().get(0).properties().mediumSeverityFailedRulesCount()); - Assertions.assertEquals(791767971, model.value().get(0).properties().lowSeverityFailedRulesCount()); - Assertions.assertEquals(1804607166, model.value().get(0).properties().totalPassedRulesCount()); - Assertions.assertEquals(1022480930, model.value().get(0).properties().totalFailedRulesCount()); - Assertions.assertEquals(855952943, model.value().get(0).properties().totalRulesCount()); - Assertions.assertEquals(true, model.value().get(0).properties().isBaselineApplied()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-07-01T01:57:52Z"), model.value().get(0).properties().lastScanTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScansInner model = - new ScansInner() - .withValue( - Arrays - .asList( - new ScanInner() - .withProperties( - new ScanProperties() - .withTriggerType(ScanTriggerType.RECURRING) - .withState(ScanState.FAILED_TO_RUN) - .withServer("xhqf") - .withDatabase("nvzoqgyipemch") - .withSqlVersion("v") - .withStartTime(OffsetDateTime.parse("2021-05-29T11:47:50Z")) - .withEndTime(OffsetDateTime.parse("2021-06-19T08:23:04Z")) - .withHighSeverityFailedRulesCount(734341991) - .withMediumSeverityFailedRulesCount(345092138) - .withLowSeverityFailedRulesCount(791767971) - .withTotalPassedRulesCount(1804607166) - .withTotalFailedRulesCount(1022480930) - .withTotalRulesCount(855952943) - .withIsBaselineApplied(true) - .withLastScanTime(OffsetDateTime.parse("2021-07-01T01:57:52Z"))))); - model = BinaryData.fromObject(model).toObject(ScansInner.class); - Assertions.assertEquals(ScanTriggerType.RECURRING, model.value().get(0).properties().triggerType()); - Assertions.assertEquals(ScanState.FAILED_TO_RUN, model.value().get(0).properties().state()); - Assertions.assertEquals("xhqf", model.value().get(0).properties().server()); - Assertions.assertEquals("nvzoqgyipemch", model.value().get(0).properties().database()); - Assertions.assertEquals("v", model.value().get(0).properties().sqlVersion()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-05-29T11:47:50Z"), model.value().get(0).properties().startTime()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-06-19T08:23:04Z"), model.value().get(0).properties().endTime()); - Assertions.assertEquals(734341991, model.value().get(0).properties().highSeverityFailedRulesCount()); - Assertions.assertEquals(345092138, model.value().get(0).properties().mediumSeverityFailedRulesCount()); - Assertions.assertEquals(791767971, model.value().get(0).properties().lowSeverityFailedRulesCount()); - Assertions.assertEquals(1804607166, model.value().get(0).properties().totalPassedRulesCount()); - Assertions.assertEquals(1022480930, model.value().get(0).properties().totalFailedRulesCount()); - Assertions.assertEquals(855952943, model.value().get(0).properties().totalRulesCount()); - Assertions.assertEquals(true, model.value().get(0).properties().isBaselineApplied()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-07-01T01:57:52Z"), model.value().get(0).properties().lastScanTime()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScopeElementTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScopeElementTests.java deleted file mode 100644 index 050808a32ece..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScopeElementTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ScopeElement; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ScopeElementTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScopeElement model = - BinaryData - .fromString( - "{\"field\":\"oldweyuqdu\",\"\":{\"alywjhhgdn\":\"datannrwrbiork\",\"iqndieuzaofj\":\"dataxmsivfomiloxggdu\"}}") - .toObject(ScopeElement.class); - Assertions.assertEquals("oldweyuqdu", model.field()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScopeElement model = new ScopeElement().withField("oldweyuqdu").withAdditionalProperties(mapOf()); - model = BinaryData.fromObject(model).toObject(ScopeElement.class); - Assertions.assertEquals("oldweyuqdu", model.field()); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScoreDetailsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScoreDetailsTests.java deleted file mode 100644 index 96bf91b4d011..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScoreDetailsTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ScoreDetails; - -public final class ScoreDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScoreDetails model = - BinaryData - .fromString("{\"max\":2043134547,\"current\":65.28047122812333,\"percentage\":41.58485561285469}") - .toObject(ScoreDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScoreDetails model = new ScoreDetails(); - model = BinaryData.fromObject(model).toObject(ScoreDetails.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionItemInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionItemInnerTests.java deleted file mode 100644 index 831e1f640460..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionItemInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; - -public final class SecureScoreControlDefinitionItemInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecureScoreControlDefinitionItemInner model = - BinaryData - .fromString( - "{\"properties\":{\"displayName\":\"uyturml\",\"description\":\"owolbaui\",\"maxScore\":79221925,\"source\":{\"sourceType\":\"Custom\"},\"assessmentDefinitions\":[{\"id\":\"nw\"},{\"id\":\"gajinnixjawrtmj\"},{\"id\":\"myccx\"},{\"id\":\"hcoxov\"}]},\"id\":\"ekhenl\",\"name\":\"sfnrdtjxt\",\"type\":\"r\"}") - .toObject(SecureScoreControlDefinitionItemInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecureScoreControlDefinitionItemInner model = new SecureScoreControlDefinitionItemInner(); - model = BinaryData.fromObject(model).toObject(SecureScoreControlDefinitionItemInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionItemPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionItemPropertiesTests.java deleted file mode 100644 index 7a6e97edd051..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionItemPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemProperties; - -public final class SecureScoreControlDefinitionItemPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecureScoreControlDefinitionItemProperties model = - BinaryData - .fromString( - "{\"displayName\":\"qtj\",\"description\":\"dt\",\"maxScore\":695049640,\"source\":{\"sourceType\":\"Custom\"},\"assessmentDefinitions\":[{\"id\":\"jtcvuwkasizies\"},{\"id\":\"ughtuqfecjxeygtu\"}]}") - .toObject(SecureScoreControlDefinitionItemProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecureScoreControlDefinitionItemProperties model = new SecureScoreControlDefinitionItemProperties(); - model = BinaryData.fromObject(model).toObject(SecureScoreControlDefinitionItemProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionListTests.java deleted file mode 100644 index fe64a9e8dd8d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionList; - -public final class SecureScoreControlDefinitionListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecureScoreControlDefinitionList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"sxjb\",\"description\":\"ehgpdohzjqatu\",\"maxScore\":1160823097,\"assessmentDefinitions\":[]},\"id\":\"bxncnwfepbnw\",\"name\":\"fmxjg\",\"type\":\"g\"},{\"properties\":{\"displayName\":\"gdlfgt\",\"description\":\"snaquf\",\"maxScore\":1011075581,\"assessmentDefinitions\":[]},\"id\":\"q\",\"name\":\"amz\",\"type\":\"rwd\"},{\"properties\":{\"displayName\":\"eqyj\",\"description\":\"zi\",\"maxScore\":1622963422,\"assessmentDefinitions\":[]},\"id\":\"fza\",\"name\":\"tkw\",\"type\":\"eg\"}],\"nextLink\":\"mlbnseq\"}") - .toObject(SecureScoreControlDefinitionList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecureScoreControlDefinitionList model = new SecureScoreControlDefinitionList(); - model = BinaryData.fromObject(model).toObject(SecureScoreControlDefinitionList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionSourceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionSourceTests.java deleted file mode 100644 index 44bec5b576bc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionSourceTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ControlType; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionSource; -import org.junit.jupiter.api.Assertions; - -public final class SecureScoreControlDefinitionSourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecureScoreControlDefinitionSource model = - BinaryData.fromString("{\"sourceType\":\"Custom\"}").toObject(SecureScoreControlDefinitionSource.class); - Assertions.assertEquals(ControlType.CUSTOM, model.sourceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecureScoreControlDefinitionSource model = - new SecureScoreControlDefinitionSource().withSourceType(ControlType.CUSTOM); - model = BinaryData.fromObject(model).toObject(SecureScoreControlDefinitionSource.class); - Assertions.assertEquals(ControlType.CUSTOM, model.sourceType()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListBySubscriptionMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListBySubscriptionMockTests.java deleted file mode 100644 index 85272a9cf232..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListBySubscriptionMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionItem; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecureScoreControlDefinitionsListBySubscriptionMockTests { - @Test - public void testListBySubscription() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"ufdmxuq\",\"description\":\"qna\",\"maxScore\":1255416410,\"source\":{\"sourceType\":\"BuiltIn\"},\"assessmentDefinitions\":[]},\"id\":\"q\",\"name\":\"yopbtsixhgvb\",\"type\":\"xmndztgsqjayqmar\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.secureScoreControlDefinitions().listBySubscription(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListMockTests.java deleted file mode 100644 index f6caab929f6c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionItem; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecureScoreControlDefinitionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"faofd\",\"description\":\"htncwmhjobzrfp\",\"maxScore\":694063597,\"source\":{\"sourceType\":\"BuiltIn\"},\"assessmentDefinitions\":[]},\"id\":\"f\",\"name\":\"cvbzwgwhgkgsoa\",\"type\":\"oorssatfy\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.secureScoreControlDefinitions().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDetailsInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDetailsInnerTests.java deleted file mode 100644 index 3b84b05baf4c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDetailsInnerTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDetailsInner; - -public final class SecureScoreControlDetailsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecureScoreControlDetailsInner model = - BinaryData - .fromString( - "{\"properties\":{\"displayName\":\"yefchnm\",\"score\":{\"max\":1660290051,\"current\":18.26434123034213,\"percentage\":71.62987207064346},\"healthyResourceCount\":1375223336,\"unhealthyResourceCount\":1523309198,\"notApplicableResourceCount\":1600818034,\"weight\":4542043090812531924,\"definition\":{\"id\":\"fifhxwrsnew\",\"name\":\"ozqvbubqmam\",\"type\":\"sycxhxzgaz\"}},\"id\":\"taboidvmf\",\"name\":\"hppubowsepdfgkmt\",\"type\":\"herngb\"}") - .toObject(SecureScoreControlDetailsInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecureScoreControlDetailsInner model = - new SecureScoreControlDetailsInner().withDefinition(new SecureScoreControlDefinitionItemInner()); - model = BinaryData.fromObject(model).toObject(SecureScoreControlDetailsInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlListTests.java deleted file mode 100644 index d90dc0823add..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecureScoreControlList; - -public final class SecureScoreControlListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecureScoreControlList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"ttgplucfotangcf\",\"healthyResourceCount\":1254839089,\"unhealthyResourceCount\":1077682035,\"notApplicableResourceCount\":809427492,\"weight\":4429427229457258180},\"id\":\"wlmzqwmvtxnjmxmc\",\"name\":\"qudtcvclx\",\"type\":\"npdkv\"},{\"properties\":{\"displayName\":\"buiyji\",\"healthyResourceCount\":874901455,\"unhealthyResourceCount\":203185987,\"notApplicableResourceCount\":1296462428,\"weight\":7170232891344779001},\"id\":\"n\",\"name\":\"gox\",\"type\":\"jiuqhibtozi\"},{\"properties\":{\"displayName\":\"jedmurrxxgewp\",\"healthyResourceCount\":1212082891,\"unhealthyResourceCount\":538601125,\"notApplicableResourceCount\":1264888765,\"weight\":1955127853962585170},\"id\":\"yhlfb\",\"name\":\"gwgcl\",\"type\":\"xoe\"},{\"properties\":{\"displayName\":\"njipnwjfujql\",\"healthyResourceCount\":1462565656,\"unhealthyResourceCount\":1454671377,\"notApplicableResourceCount\":295372470,\"weight\":5131304404617914310},\"id\":\"o\",\"name\":\"yjwpfilkmkkh\",\"type\":\"l\"}],\"nextLink\":\"ndviauogphuartvt\"}") - .toObject(SecureScoreControlList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecureScoreControlList model = new SecureScoreControlList(); - model = BinaryData.fromObject(model).toObject(SecureScoreControlList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlScoreDetailsInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlScoreDetailsInnerTests.java deleted file mode 100644 index b36dd984ddfd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlScoreDetailsInnerTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlScoreDetailsInner; - -public final class SecureScoreControlScoreDetailsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecureScoreControlScoreDetailsInner model = - BinaryData - .fromString( - "{\"displayName\":\"juahokqto\",\"score\":{\"max\":1988457044,\"current\":94.1893284512417,\"percentage\":92.7505349749972},\"healthyResourceCount\":2026561686,\"unhealthyResourceCount\":738753621,\"notApplicableResourceCount\":1258179211,\"weight\":3760605119106572940,\"definition\":{\"properties\":{\"displayName\":\"e\",\"description\":\"whslwkoj\",\"maxScore\":157420871,\"assessmentDefinitions\":[]},\"id\":\"pdwrpqafgfugsn\",\"name\":\"fhyete\",\"type\":\"ypococtfjgtixr\"}}") - .toObject(SecureScoreControlScoreDetailsInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecureScoreControlScoreDetailsInner model = - new SecureScoreControlScoreDetailsInner().withDefinition(new SecureScoreControlDefinitionItemInner()); - model = BinaryData.fromObject(model).toObject(SecureScoreControlScoreDetailsInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreMockTests.java deleted file mode 100644 index 125c42d66169..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ExpandControlsEnum; -import com.azure.resourcemanager.security.models.SecureScoreControlDetails; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecureScoreControlsListBySecureScoreMockTests { - @Test - public void testListBySecureScore() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"nmtsdixc\",\"score\":{\"max\":960368157,\"current\":2.0148335508080595,\"percentage\":32.94154583908292},\"healthyResourceCount\":653289494,\"unhealthyResourceCount\":623500871,\"notApplicableResourceCount\":807131676,\"weight\":7585046270567652176,\"definition\":{\"id\":\"qzoof\",\"name\":\"nqjsvepfbhtleber\",\"type\":\"yljeknfqnwjjqx\"}},\"id\":\"wkdnjrxgkrhwiehy\",\"name\":\"pnowawonoehrguql\",\"type\":\"fwafbjz\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .secureScoreControls() - .listBySecureScore("lxvhhyqqegatxgrz", ExpandControlsEnum.DEFINITION, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListMockTests.java deleted file mode 100644 index 01ab051c1a6b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ExpandControlsEnum; -import com.azure.resourcemanager.security.models.SecureScoreControlDetails; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecureScoreControlsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"guyfazbkocbygvt\",\"score\":{\"max\":106120688,\"current\":11.396655943253176,\"percentage\":58.146251073289655},\"healthyResourceCount\":1344169378,\"unhealthyResourceCount\":1548281648,\"notApplicableResourceCount\":341199959,\"weight\":7359298779721457095,\"definition\":{\"id\":\"boozflyacagaed\",\"name\":\"oiqclmgdtwgab\",\"type\":\"xfkuzbw\"}},\"id\":\"ecooyvhtuqbp\",\"name\":\"lniibncg\",\"type\":\"gdvcdqhftz\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.secureScoreControls().list(ExpandControlsEnum.DEFINITION, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreItemInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreItemInnerTests.java deleted file mode 100644 index 7f5199ec222e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreItemInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecureScoreItemInner; - -public final class SecureScoreItemInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecureScoreItemInner model = - BinaryData - .fromString( - "{\"properties\":{\"displayName\":\"zhrgmqgjsxvpqc\",\"score\":{\"max\":1162167874,\"current\":21.586870005444514,\"percentage\":87.20432974466105},\"weight\":4486642012912512601},\"id\":\"vriibakclacjfr\",\"name\":\"xousxauzl\",\"type\":\"vsg\"}") - .toObject(SecureScoreItemInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecureScoreItemInner model = new SecureScoreItemInner(); - model = BinaryData.fromObject(model).toObject(SecureScoreItemInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreItemPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreItemPropertiesTests.java deleted file mode 100644 index 357428e2c5f3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreItemPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecureScoreItemProperties; - -public final class SecureScoreItemPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecureScoreItemProperties model = - BinaryData - .fromString( - "{\"displayName\":\"ohqfzizv\",\"score\":{\"max\":290394700,\"current\":79.43221808867246,\"percentage\":47.38718025336222},\"weight\":6456868144716407636}") - .toObject(SecureScoreItemProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecureScoreItemProperties model = new SecureScoreItemProperties(); - model = BinaryData.fromObject(model).toObject(SecureScoreItemProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresGetWithResponseMockTests.java deleted file mode 100644 index 1fe1467db04d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecureScoreItem; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecureScoresGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"trvrkpsab\",\"score\":{\"max\":690664463,\"current\":1.6527198888620198,\"percentage\":57.52426811501905},\"weight\":3311361133230112709},\"id\":\"lpyeu\",\"name\":\"kppdi\",\"type\":\"qb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecureScoreItem response = - manager.secureScores().getWithResponse("qutibhl", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresListMockTests.java deleted file mode 100644 index cab843af5c77..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecureScoreItem; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecureScoresListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"xezm\",\"score\":{\"max\":2036050921,\"current\":41.86944000776085,\"percentage\":66.66233527644464},\"weight\":8245136712632811415},\"id\":\"lokfpmijpdvzv\",\"name\":\"bhwbdqufvcgnrgla\",\"type\":\"rwyambhbafebzxfk\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.secureScores().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresListTests.java deleted file mode 100644 index ba1e9c2e6c89..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecureScoresList; - -public final class SecureScoresListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecureScoresList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"xylrjvmtygjbmz\",\"weight\":1881344816801364450},\"id\":\"p\",\"name\":\"hckfkyjpmspbps\",\"type\":\"df\"},{\"properties\":{\"displayName\":\"ogtieyujtvczkcny\",\"weight\":5566612740154232869},\"id\":\"njdxvglnkvxl\",\"name\":\"paglqivbgk\",\"type\":\"vkhpzvuqdflvo\"},{\"properties\":{\"displayName\":\"pfpubcpzgpx\",\"weight\":206022069404310786},\"id\":\"knidib\",\"name\":\"qjxgpnrhgovfgp\",\"type\":\"kqmhhaowjr\"},{\"properties\":{\"displayName\":\"uporqzdfu\",\"weight\":9046409945705320802},\"id\":\"fvxcnqmxqpswo\",\"name\":\"mvkhlggd\",\"type\":\"bemzqkzszuwi\"}],\"nextLink\":\"glxxhljfpgpic\"}") - .toObject(SecureScoresList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecureScoresList model = new SecureScoresList(); - model = BinaryData.fromObject(model).toObject(SecureScoresList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentListTests.java deleted file mode 100644 index 85b0a4cc17e7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecurityAssessmentList; - -public final class SecurityAssessmentListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityAssessmentList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"clnpkci\",\"additionalData\":{}},\"id\":\"ykhyawfvjlboxqvk\",\"name\":\"lmxhomdyn\",\"type\":\"dwdigumb\"},{\"properties\":{\"displayName\":\"auzzptjazysd\",\"additionalData\":{}},\"id\":\"wva\",\"name\":\"qyuvvfonkp\",\"type\":\"hqyikvy\"},{\"properties\":{\"displayName\":\"yavluwmncstt\",\"additionalData\":{}},\"id\":\"vpo\",\"name\":\"krsgsgb\",\"type\":\"huzqgn\"},{\"properties\":{\"displayName\":\"kynscliqhzv\",\"additionalData\":{}},\"id\":\"mtk\",\"name\":\"bo\",\"type\":\"ppnvdxz\"}],\"nextLink\":\"ihfrbbcevqa\"}") - .toObject(SecurityAssessmentList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityAssessmentList model = new SecurityAssessmentList(); - model = BinaryData.fromObject(model).toObject(SecurityAssessmentList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentMetadataPropertiesResponsePublishDatesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentMetadataPropertiesResponsePublishDatesTests.java deleted file mode 100644 index e8d5fae353e2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentMetadataPropertiesResponsePublishDatesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates; -import org.junit.jupiter.api.Assertions; - -public final class SecurityAssessmentMetadataPropertiesResponsePublishDatesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityAssessmentMetadataPropertiesResponsePublishDates model = - BinaryData - .fromString("{\"GA\":\"f\",\"public\":\"ztcktyh\"}") - .toObject(SecurityAssessmentMetadataPropertiesResponsePublishDates.class); - Assertions.assertEquals("f", model.ga()); - Assertions.assertEquals("ztcktyh", model.publicProperty()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityAssessmentMetadataPropertiesResponsePublishDates model = - new SecurityAssessmentMetadataPropertiesResponsePublishDates().withGa("f").withPublicProperty("ztcktyh"); - model = BinaryData.fromObject(model).toObject(SecurityAssessmentMetadataPropertiesResponsePublishDates.class); - Assertions.assertEquals("f", model.ga()); - Assertions.assertEquals("ztcktyh", model.publicProperty()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentMetadataResponseListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentMetadataResponseListTests.java deleted file mode 100644 index 00ad2c778bc0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentMetadataResponseListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataResponseList; - -public final class SecurityAssessmentMetadataResponseListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityAssessmentMetadataResponseList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"plannedDeprecationDate\":\"fnynszqujizdvoqy\",\"tactics\":[],\"techniques\":[],\"displayName\":\"yo\",\"policyDefinitionId\":\"blgyavutpthj\",\"description\":\"oismsksbpimlqol\",\"remediationDescription\":\"kcgxxlxsffgcvi\",\"categories\":[],\"severity\":\"Low\",\"userImpact\":\"Low\",\"implementationEffort\":\"Low\",\"threats\":[],\"preview\":true,\"assessmentType\":\"CustomPolicy\"},\"id\":\"pfgfbkjub\",\"name\":\"yhgk\",\"type\":\"minsgowzf\"},{\"properties\":{\"plannedDeprecationDate\":\"t\",\"tactics\":[],\"techniques\":[],\"displayName\":\"ahbqactxtgzuk\",\"policyDefinitionId\":\"tmmqtgqqqxhrn\",\"description\":\"xcpjuisavokqdzf\",\"remediationDescription\":\"zivj\",\"categories\":[],\"severity\":\"Medium\",\"userImpact\":\"High\",\"implementationEffort\":\"Moderate\",\"threats\":[],\"preview\":true,\"assessmentType\":\"CustomPolicy\"},\"id\":\"tnwxy\",\"name\":\"opidkqqfkuv\",\"type\":\"cxkdmligovi\"},{\"properties\":{\"plannedDeprecationDate\":\"pmloazuruoc\",\"tactics\":[],\"techniques\":[],\"displayName\":\"orbteoy\",\"policyDefinitionId\":\"hjxa\",\"description\":\"vjgsl\",\"remediationDescription\":\"dilmyww\",\"categories\":[],\"severity\":\"Medium\",\"userImpact\":\"Low\",\"implementationEffort\":\"Low\",\"threats\":[],\"preview\":false,\"assessmentType\":\"BuiltIn\"},\"id\":\"yvudtjuewbci\",\"name\":\"xuuwhcj\",\"type\":\"xccybvpa\"},{\"properties\":{\"plannedDeprecationDate\":\"udzpxgwjplmagstc\",\"tactics\":[],\"techniques\":[],\"displayName\":\"pfkyrkdbdgiogsj\",\"policyDefinitionId\":\"nwqjnoba\",\"description\":\"hdd\",\"remediationDescription\":\"acegfnmntf\",\"categories\":[],\"severity\":\"Low\",\"userImpact\":\"Low\",\"implementationEffort\":\"Low\",\"threats\":[],\"preview\":true,\"assessmentType\":\"CustomPolicy\"},\"id\":\"vvbalx\",\"name\":\"l\",\"type\":\"chp\"}],\"nextLink\":\"bzevwrd\"}") - .toObject(SecurityAssessmentMetadataResponseList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityAssessmentMetadataResponseList model = new SecurityAssessmentMetadataResponseList(); - model = BinaryData.fromObject(model).toObject(SecurityAssessmentMetadataResponseList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 6010b57722cf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.nio.ByteBuffer; -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 org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityConnectorApplicationOperationsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"do\",\"description\":\"fzdgjfcycrsvloy\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[\"datagqkzjuqw\",\"dataajquzxpixhyoi\",\"datanfdbgsoscienezf\"]},\"id\":\"bennmfkbp\",\"name\":\"nrtekw\",\"type\":\"nthropmdudsyiu\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Application response = - manager - .securityConnectorApplicationOperations() - .createOrUpdateWithResponse( - "xplhpeva", - "yntvzjyielbq", - "vvbq", - new ApplicationInner() - .withDisplayName("mpe") - .withDescription("xgiqasifubn") - .withSourceResourceType(ApplicationSourceResourceType.ASSESSMENTS) - .withConditionSets(Arrays.asList("datatlpwqpjnxjkhtups", "datayo")), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("do", response.displayName()); - Assertions.assertEquals("fzdgjfcycrsvloy", response.description()); - Assertions.assertEquals(ApplicationSourceResourceType.ASSESSMENTS, response.sourceResourceType()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsDeleteWithResponseMockTests.java deleted file mode 100644 index 79ac1e156e35..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityConnectorApplicationOperationsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .securityConnectorApplicationOperations() - .deleteWithResponse("ztvktjhffecqko", "youergaghp", "zxkpyehhfdyld", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsGetWithResponseMockTests.java deleted file mode 100644 index 9e78bb598680..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityConnectorApplicationOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"gtqcumecsaaqgoq\",\"description\":\"iuycsbskowk\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[\"datazhrbkhtmqo\",\"dataiuasfgq\",\"dataucyhfaimq\"]},\"id\":\"druozk\",\"name\":\"yfpeoehgfmqmsk\",\"type\":\"ixvlz\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Application response = - manager - .securityConnectorApplicationOperations() - .getWithResponse("hydt", "aczkf", "fatgawphnski", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("gtqcumecsaaqgoq", response.displayName()); - Assertions.assertEquals("iuycsbskowk", response.description()); - Assertions.assertEquals(ApplicationSourceResourceType.ASSESSMENTS, response.sourceResourceType()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsListMockTests.java deleted file mode 100644 index 7441975744f6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsListMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityConnectorApplicationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"stifgufyjf\",\"description\":\"qiyv\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[\"dataokgw\",\"datasymzqhrqpf\",\"datalpe\"]},\"id\":\"tznxlu\",\"name\":\"aujqbbgsimwejlwb\",\"type\":\"bpjzobdwbcpraswk\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.securityConnectorApplications().list("izzn", "uf", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("stifgufyjf", response.iterator().next().displayName()); - Assertions.assertEquals("qiyv", response.iterator().next().description()); - Assertions - .assertEquals(ApplicationSourceResourceType.ASSESSMENTS, response.iterator().next().sourceResourceType()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorInnerTests.java deleted file mode 100644 index d68fa2bcb46b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorInnerTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.CloudOffering; -import com.azure.resourcemanager.security.models.EnvironmentData; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SecurityConnectorInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityConnectorInner model = - BinaryData - .fromString( - "{\"properties\":{\"hierarchyIdentifier\":\"vbrzcdb\",\"hierarchyIdentifierTrialEndDate\":\"2021-09-14T13:57:27Z\",\"environmentName\":\"Github\",\"offerings\":[{\"offeringType\":\"CloudOffering\",\"description\":\"xmxeatkdb\"},{\"offeringType\":\"CloudOffering\",\"description\":\"nrd\"}],\"environmentData\":{\"environmentType\":\"EnvironmentData\"}},\"location\":\"ibqbnaomhjrm\",\"tags\":{\"obcancdexxqcw\":\"maxljalfihcj\",\"fgvaknokzwj\":\"a\",\"tpq\":\"zrltixldzyyf\"},\"id\":\"ixymmpujivyql\",\"name\":\"juvsmbmslzoyovw\",\"type\":\"dbpqvybefgvm\"}") - .toObject(SecurityConnectorInner.class); - Assertions.assertEquals("ibqbnaomhjrm", model.location()); - Assertions.assertEquals("maxljalfihcj", model.tags().get("obcancdexxqcw")); - Assertions.assertEquals("vbrzcdb", model.hierarchyIdentifier()); - Assertions.assertEquals(CloudName.GITHUB, model.environmentName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityConnectorInner model = - new SecurityConnectorInner() - .withLocation("ibqbnaomhjrm") - .withTags(mapOf("obcancdexxqcw", "maxljalfihcj", "fgvaknokzwj", "a", "tpq", "zrltixldzyyf")) - .withHierarchyIdentifier("vbrzcdb") - .withEnvironmentName(CloudName.GITHUB) - .withOfferings(Arrays.asList(new CloudOffering(), new CloudOffering())) - .withEnvironmentData(new EnvironmentData()); - model = BinaryData.fromObject(model).toObject(SecurityConnectorInner.class); - Assertions.assertEquals("ibqbnaomhjrm", model.location()); - Assertions.assertEquals("maxljalfihcj", model.tags().get("obcancdexxqcw")); - Assertions.assertEquals("vbrzcdb", model.hierarchyIdentifier()); - Assertions.assertEquals(CloudName.GITHUB, model.environmentName()); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorPropertiesTests.java deleted file mode 100644 index 5fdc1aa8caaa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorPropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecurityConnectorProperties; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.CloudOffering; -import com.azure.resourcemanager.security.models.EnvironmentData; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SecurityConnectorPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityConnectorProperties model = - BinaryData - .fromString( - "{\"hierarchyIdentifier\":\"okcvtlubses\",\"hierarchyIdentifierTrialEndDate\":\"2021-01-02T05:52:53Z\",\"environmentName\":\"GCP\",\"offerings\":[{\"offeringType\":\"CloudOffering\",\"description\":\"hunlpirykycnd\"}],\"environmentData\":{\"environmentType\":\"EnvironmentData\"}}") - .toObject(SecurityConnectorProperties.class); - Assertions.assertEquals("okcvtlubses", model.hierarchyIdentifier()); - Assertions.assertEquals(CloudName.GCP, model.environmentName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityConnectorProperties model = - new SecurityConnectorProperties() - .withHierarchyIdentifier("okcvtlubses") - .withEnvironmentName(CloudName.GCP) - .withOfferings(Arrays.asList(new CloudOffering())) - .withEnvironmentData(new EnvironmentData()); - model = BinaryData.fromObject(model).toObject(SecurityConnectorProperties.class); - Assertions.assertEquals("okcvtlubses", model.hierarchyIdentifier()); - Assertions.assertEquals(CloudName.GCP, model.environmentName()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 3712030dd800..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.EnvironmentData; -import com.azure.resourcemanager.security.models.SecurityConnector; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityConnectorsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"hierarchyIdentifier\":\"m\",\"hierarchyIdentifierTrialEndDate\":\"2021-06-20T07:23:24Z\",\"environmentName\":\"AWS\",\"offerings\":[],\"environmentData\":{\"environmentType\":\"EnvironmentData\"}},\"location\":\"rpvsgloiovs\",\"tags\":{\"suvw\":\"v\",\"i\":\"enbg\",\"oa\":\"pkhc\"},\"id\":\"xukuicjuftekio\",\"name\":\"anduew\",\"type\":\"hvpxjhxz\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecurityConnector response = - manager - .securityConnectors() - .define("qpqsdoctpzpuj") - .withRegion("hfwlfxzfwugeup") - .withExistingResourceGroup("krjflsgaojb") - .withTags(mapOf("sytqpdzfyxcnwawo", "ecexkgrvfpsjdmn", "bejqfbifopfjx", "cg", "q", "wdrpa")) - .withHierarchyIdentifier("cdsgxceluji") - .withEnvironmentName(CloudName.AWS) - .withOfferings(Arrays.asList()) - .withEnvironmentData(new EnvironmentData()) - .create(); - - Assertions.assertEquals("rpvsgloiovs", response.location()); - Assertions.assertEquals("v", response.tags().get("suvw")); - Assertions.assertEquals("m", response.hierarchyIdentifier()); - Assertions.assertEquals(CloudName.AWS, response.environmentName()); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index bab7d8838a8b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityConnectorsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .securityConnectors() - .deleteByResourceGroupWithResponse("hoksmmculwk", "icruo", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 11366a0154c5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.SecurityConnector; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityConnectorsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"hierarchyIdentifier\":\"j\",\"hierarchyIdentifierTrialEndDate\":\"2021-02-19T19:03:45Z\",\"environmentName\":\"GitLab\",\"offerings\":[],\"environmentData\":{\"environmentType\":\"EnvironmentData\"}},\"location\":\"fcjis\",\"tags\":{\"ampqocl\":\"dbxotfb\"},\"id\":\"nnmxynlsuqbwzstr\",\"name\":\"tgvpatr\",\"type\":\"jjktfin\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecurityConnector response = - manager - .securityConnectors() - .getByResourceGroupWithResponse("rrxyxwjezbfqpl", "yuekdcpvuftrsvjm", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("fcjis", response.location()); - Assertions.assertEquals("dbxotfb", response.tags().get("ampqocl")); - Assertions.assertEquals("j", response.hierarchyIdentifier()); - Assertions.assertEquals(CloudName.GIT_LAB, response.environmentName()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupMockTests.java deleted file mode 100644 index ba8160f90997..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.SecurityConnector; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityConnectorsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"hierarchyIdentifier\":\"ylblfsprr\",\"hierarchyIdentifierTrialEndDate\":\"2021-06-27T02:59:42Z\",\"environmentName\":\"GitLab\",\"offerings\":[],\"environmentData\":{\"environmentType\":\"EnvironmentData\"}},\"location\":\"vvfxrdytzfsl\",\"tags\":{\"mcdiiisk\":\"hqikmgobliq\",\"vtrkfkg\":\"bonxxupj\"},\"id\":\"njqnnpjwkosny\",\"name\":\"igfoujjcxgdqmr\",\"type\":\"hnzkwopswnyinxu\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.securityConnectors().listByResourceGroup("qshixbc", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vvfxrdytzfsl", response.iterator().next().location()); - Assertions.assertEquals("hqikmgobliq", response.iterator().next().tags().get("mcdiiisk")); - Assertions.assertEquals("ylblfsprr", response.iterator().next().hierarchyIdentifier()); - Assertions.assertEquals(CloudName.GIT_LAB, response.iterator().next().environmentName()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListMockTests.java deleted file mode 100644 index 071bb6609f0d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.SecurityConnector; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityConnectorsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"hierarchyIdentifier\":\"pgarpfctw\",\"hierarchyIdentifierTrialEndDate\":\"2021-09-18T04:03Z\",\"environmentName\":\"GCP\",\"offerings\":[],\"environmentData\":{\"environmentType\":\"EnvironmentData\"}},\"location\":\"qyvzesipiysnjq\",\"tags\":{\"ewkaupwhl\":\"aadcndazabundt\",\"sirxxhyr\":\"yckremgjlmsvdo\"},\"id\":\"qakofajf\",\"name\":\"epr\",\"type\":\"vmkinwtey\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.securityConnectors().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("qyvzesipiysnjq", response.iterator().next().location()); - Assertions.assertEquals("aadcndazabundt", response.iterator().next().tags().get("ewkaupwhl")); - Assertions.assertEquals("pgarpfctw", response.iterator().next().hierarchyIdentifier()); - Assertions.assertEquals(CloudName.GCP, response.iterator().next().environmentName()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListTests.java deleted file mode 100644 index afab1e1e80a5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.SecurityConnectorsList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SecurityConnectorsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityConnectorsList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"hierarchyIdentifier\":\"ifrkgwltxeqipx\",\"hierarchyIdentifierTrialEndDate\":\"2021-05-11T17:28:43Z\",\"environmentName\":\"GCP\",\"offerings\":[]},\"location\":\"fayorpravkjoges\",\"tags\":{\"kvwjtqpkevmy\":\"nsmjkwynqxaekqs\",\"gxannnoytzposewx\":\"tjcrspxklurccl\",\"dfaifyzyzeyuube\":\"gpxvkqmaupxvpi\",\"l\":\"ds\"},\"id\":\"ytoithgygvfl\",\"name\":\"gvdihoynkrxwetwk\",\"type\":\"rcyrucpcunnu\"},{\"properties\":{\"hierarchyIdentifier\":\"moenodnaien\",\"hierarchyIdentifierTrialEndDate\":\"2021-09-25T15:40:50Z\",\"environmentName\":\"GCP\",\"offerings\":[]},\"location\":\"nelqkaadl\",\"tags\":{\"vcnrly\":\"foanniyopetx\"},\"id\":\"nucaephblkwqpat\",\"name\":\"bqsdtcjbctvi\",\"type\":\"uzqymtuowog\"}],\"nextLink\":\"it\"}") - .toObject(SecurityConnectorsList.class); - Assertions.assertEquals("fayorpravkjoges", model.value().get(0).location()); - Assertions.assertEquals("nsmjkwynqxaekqs", model.value().get(0).tags().get("kvwjtqpkevmy")); - Assertions.assertEquals("ifrkgwltxeqipx", model.value().get(0).hierarchyIdentifier()); - Assertions.assertEquals(CloudName.GCP, model.value().get(0).environmentName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityConnectorsList model = - new SecurityConnectorsList() - .withValue( - Arrays - .asList( - new SecurityConnectorInner() - .withLocation("fayorpravkjoges") - .withTags( - mapOf( - "kvwjtqpkevmy", - "nsmjkwynqxaekqs", - "gxannnoytzposewx", - "tjcrspxklurccl", - "dfaifyzyzeyuube", - "gpxvkqmaupxvpi", - "l", - "ds")) - .withHierarchyIdentifier("ifrkgwltxeqipx") - .withEnvironmentName(CloudName.GCP) - .withOfferings(Arrays.asList()), - new SecurityConnectorInner() - .withLocation("nelqkaadl") - .withTags(mapOf("vcnrly", "foanniyopetx")) - .withHierarchyIdentifier("moenodnaien") - .withEnvironmentName(CloudName.GCP) - .withOfferings(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(SecurityConnectorsList.class); - Assertions.assertEquals("fayorpravkjoges", model.value().get(0).location()); - Assertions.assertEquals("nsmjkwynqxaekqs", model.value().get(0).tags().get("kvwjtqpkevmy")); - Assertions.assertEquals("ifrkgwltxeqipx", model.value().get(0).hierarchyIdentifier()); - Assertions.assertEquals(CloudName.GCP, model.value().get(0).environmentName()); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactInnerTests.java deleted file mode 100644 index 4a7336f59c21..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactInnerTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecurityContactInner; -import com.azure.resourcemanager.security.models.MinimalSeverity; -import com.azure.resourcemanager.security.models.Roles; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesAlertNotifications; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; -import com.azure.resourcemanager.security.models.State; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SecurityContactInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityContactInner model = - BinaryData - .fromString( - "{\"properties\":{\"emails\":\"swe\",\"phone\":\"qwdxggicc\",\"alertNotifications\":{\"state\":\"Failed\",\"minimalSeverity\":\"High\"},\"notificationsByRole\":{\"state\":\"Unsupported\",\"roles\":[\"Owner\",\"Owner\",\"Contributor\",\"AccountAdmin\"]}},\"id\":\"vlz\",\"name\":\"wem\",\"type\":\"zrncsdt\"}") - .toObject(SecurityContactInner.class); - Assertions.assertEquals("swe", model.emails()); - Assertions.assertEquals("qwdxggicc", model.phone()); - Assertions.assertEquals(State.FAILED, model.alertNotifications().state()); - Assertions.assertEquals(MinimalSeverity.HIGH, model.alertNotifications().minimalSeverity()); - Assertions.assertEquals(State.UNSUPPORTED, model.notificationsByRole().state()); - Assertions.assertEquals(Roles.OWNER, model.notificationsByRole().roles().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityContactInner model = - new SecurityContactInner() - .withEmails("swe") - .withPhone("qwdxggicc") - .withAlertNotifications( - new SecurityContactPropertiesAlertNotifications() - .withState(State.FAILED) - .withMinimalSeverity(MinimalSeverity.HIGH)) - .withNotificationsByRole( - new SecurityContactPropertiesNotificationsByRole() - .withState(State.UNSUPPORTED) - .withRoles(Arrays.asList(Roles.OWNER, Roles.OWNER, Roles.CONTRIBUTOR, Roles.ACCOUNT_ADMIN))); - model = BinaryData.fromObject(model).toObject(SecurityContactInner.class); - Assertions.assertEquals("swe", model.emails()); - Assertions.assertEquals("qwdxggicc", model.phone()); - Assertions.assertEquals(State.FAILED, model.alertNotifications().state()); - Assertions.assertEquals(MinimalSeverity.HIGH, model.alertNotifications().minimalSeverity()); - Assertions.assertEquals(State.UNSUPPORTED, model.notificationsByRole().state()); - Assertions.assertEquals(Roles.OWNER, model.notificationsByRole().roles().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactListTests.java deleted file mode 100644 index 9a52c5ef4a59..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecurityContactList; - -public final class SecurityContactListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityContactList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"emails\":\"ux\",\"phone\":\"q\"},\"id\":\"syuuximerq\",\"name\":\"obwyznkb\",\"type\":\"kutwpf\"},{\"properties\":{\"emails\":\"gmhrskdsnfdsdoak\",\"phone\":\"dlmkkzevdl\"},\"id\":\"pusdstt\",\"name\":\"vogvbbejdcngqqmo\",\"type\":\"kufgmj\"},{\"properties\":{\"emails\":\"rdgrtw\",\"phone\":\"nuuzkopbm\"},\"id\":\"fdwoyuhh\",\"name\":\"iuiefozbhdmsm\",\"type\":\"mzqhoftrmaequi\"},{\"properties\":{\"emails\":\"icslfaoq\",\"phone\":\"iyylhalnswhccsp\"},\"id\":\"ivwitqscywugg\",\"name\":\"oluhczbwemh\",\"type\":\"i\"}],\"nextLink\":\"brgz\"}") - .toObject(SecurityContactList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityContactList model = new SecurityContactList(); - model = BinaryData.fromObject(model).toObject(SecurityContactList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesAlertNotificationsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesAlertNotificationsTests.java deleted file mode 100644 index adc37550902f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesAlertNotificationsTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.MinimalSeverity; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesAlertNotifications; -import com.azure.resourcemanager.security.models.State; -import org.junit.jupiter.api.Assertions; - -public final class SecurityContactPropertiesAlertNotificationsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityContactPropertiesAlertNotifications model = - BinaryData - .fromString("{\"state\":\"Passed\",\"minimalSeverity\":\"Medium\"}") - .toObject(SecurityContactPropertiesAlertNotifications.class); - Assertions.assertEquals(State.PASSED, model.state()); - Assertions.assertEquals(MinimalSeverity.MEDIUM, model.minimalSeverity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityContactPropertiesAlertNotifications model = - new SecurityContactPropertiesAlertNotifications() - .withState(State.PASSED) - .withMinimalSeverity(MinimalSeverity.MEDIUM); - model = BinaryData.fromObject(model).toObject(SecurityContactPropertiesAlertNotifications.class); - Assertions.assertEquals(State.PASSED, model.state()); - Assertions.assertEquals(MinimalSeverity.MEDIUM, model.minimalSeverity()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesNotificationsByRoleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesNotificationsByRoleTests.java deleted file mode 100644 index a0571dec6ede..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesNotificationsByRoleTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Roles; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; -import com.azure.resourcemanager.security.models.State; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SecurityContactPropertiesNotificationsByRoleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityContactPropertiesNotificationsByRole model = - BinaryData - .fromString("{\"state\":\"Failed\",\"roles\":[\"Contributor\"]}") - .toObject(SecurityContactPropertiesNotificationsByRole.class); - Assertions.assertEquals(State.FAILED, model.state()); - Assertions.assertEquals(Roles.CONTRIBUTOR, model.roles().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityContactPropertiesNotificationsByRole model = - new SecurityContactPropertiesNotificationsByRole() - .withState(State.FAILED) - .withRoles(Arrays.asList(Roles.CONTRIBUTOR)); - model = BinaryData.fromObject(model).toObject(SecurityContactPropertiesNotificationsByRole.class); - Assertions.assertEquals(State.FAILED, model.state()); - Assertions.assertEquals(Roles.CONTRIBUTOR, model.roles().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesTests.java deleted file mode 100644 index a8a0de5f1a63..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecurityContactProperties; -import com.azure.resourcemanager.security.models.MinimalSeverity; -import com.azure.resourcemanager.security.models.Roles; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesAlertNotifications; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; -import com.azure.resourcemanager.security.models.State; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SecurityContactPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityContactProperties model = - BinaryData - .fromString( - "{\"emails\":\"u\",\"phone\":\"ypbsfgytguslfead\",\"alertNotifications\":{\"state\":\"Skipped\",\"minimalSeverity\":\"High\"},\"notificationsByRole\":{\"state\":\"Failed\",\"roles\":[\"AccountAdmin\"]}}") - .toObject(SecurityContactProperties.class); - Assertions.assertEquals("u", model.emails()); - Assertions.assertEquals("ypbsfgytguslfead", model.phone()); - Assertions.assertEquals(State.SKIPPED, model.alertNotifications().state()); - Assertions.assertEquals(MinimalSeverity.HIGH, model.alertNotifications().minimalSeverity()); - Assertions.assertEquals(State.FAILED, model.notificationsByRole().state()); - Assertions.assertEquals(Roles.ACCOUNT_ADMIN, model.notificationsByRole().roles().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityContactProperties model = - new SecurityContactProperties() - .withEmails("u") - .withPhone("ypbsfgytguslfead") - .withAlertNotifications( - new SecurityContactPropertiesAlertNotifications() - .withState(State.SKIPPED) - .withMinimalSeverity(MinimalSeverity.HIGH)) - .withNotificationsByRole( - new SecurityContactPropertiesNotificationsByRole() - .withState(State.FAILED) - .withRoles(Arrays.asList(Roles.ACCOUNT_ADMIN))); - model = BinaryData.fromObject(model).toObject(SecurityContactProperties.class); - Assertions.assertEquals("u", model.emails()); - Assertions.assertEquals("ypbsfgytguslfead", model.phone()); - Assertions.assertEquals(State.SKIPPED, model.alertNotifications().state()); - Assertions.assertEquals(MinimalSeverity.HIGH, model.alertNotifications().minimalSeverity()); - Assertions.assertEquals(State.FAILED, model.notificationsByRole().state()); - Assertions.assertEquals(Roles.ACCOUNT_ADMIN, model.notificationsByRole().roles().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsCreateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsCreateWithResponseMockTests.java deleted file mode 100644 index 99fb2a74c579..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsCreateWithResponseMockTests.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.MinimalSeverity; -import com.azure.resourcemanager.security.models.SecurityContact; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesAlertNotifications; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; -import com.azure.resourcemanager.security.models.State; -import java.nio.ByteBuffer; -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 org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityContactsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"emails\":\"ezacfpztga\",\"phone\":\"yqejga\",\"alertNotifications\":{\"state\":\"Unsupported\",\"minimalSeverity\":\"High\"},\"notificationsByRole\":{\"state\":\"Unsupported\",\"roles\":[]}},\"id\":\"kqzkcyzmff\",\"name\":\"gdyfcixrhlcqvhoe\",\"type\":\"goiutgw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecurityContact response = - manager - .securityContacts() - .define("nzsieuscplh") - .withEmails("gxlyzkxitdshezs") - .withPhone("olrupjovm") - .withAlertNotifications( - new SecurityContactPropertiesAlertNotifications() - .withState(State.PASSED) - .withMinimalSeverity(MinimalSeverity.MEDIUM)) - .withNotificationsByRole( - new SecurityContactPropertiesNotificationsByRole() - .withState(State.UNSUPPORTED) - .withRoles(Arrays.asList())) - .create(); - - Assertions.assertEquals("ezacfpztga", response.emails()); - Assertions.assertEquals("yqejga", response.phone()); - Assertions.assertEquals(State.UNSUPPORTED, response.alertNotifications().state()); - Assertions.assertEquals(MinimalSeverity.HIGH, response.alertNotifications().minimalSeverity()); - Assertions.assertEquals(State.UNSUPPORTED, response.notificationsByRole().state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsDeleteWithResponseMockTests.java deleted file mode 100644 index 5f39e5a1eb1f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityContactsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.securityContacts().deleteWithResponse("jsczivfqbqnasdsy", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsGetWithResponseMockTests.java deleted file mode 100644 index a222f10ee0bf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.MinimalSeverity; -import com.azure.resourcemanager.security.models.SecurityContact; -import com.azure.resourcemanager.security.models.State; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityContactsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"emails\":\"glhrfo\",\"phone\":\"wecr\",\"alertNotifications\":{\"state\":\"Passed\",\"minimalSeverity\":\"Medium\"},\"notificationsByRole\":{\"state\":\"Skipped\",\"roles\":[]}},\"id\":\"ovppqibukklvzrlr\",\"name\":\"l\",\"type\":\"cme\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecurityContact response = - manager.securityContacts().getWithResponse("xl", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("glhrfo", response.emails()); - Assertions.assertEquals("wecr", response.phone()); - Assertions.assertEquals(State.PASSED, response.alertNotifications().state()); - Assertions.assertEquals(MinimalSeverity.MEDIUM, response.alertNotifications().minimalSeverity()); - Assertions.assertEquals(State.SKIPPED, response.notificationsByRole().state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsListMockTests.java deleted file mode 100644 index 130d3bfc5427..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsListMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.MinimalSeverity; -import com.azure.resourcemanager.security.models.SecurityContact; -import com.azure.resourcemanager.security.models.State; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityContactsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"emails\":\"tresr\",\"phone\":\"tshuvftwaivm\",\"alertNotifications\":{\"state\":\"Skipped\",\"minimalSeverity\":\"High\"},\"notificationsByRole\":{\"state\":\"Unsupported\",\"roles\":[]}},\"id\":\"anhx\",\"name\":\"pdxxzetwwz\",\"type\":\"wot\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.securityContacts().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("tresr", response.iterator().next().emails()); - Assertions.assertEquals("tshuvftwaivm", response.iterator().next().phone()); - Assertions.assertEquals(State.SKIPPED, response.iterator().next().alertNotifications().state()); - Assertions - .assertEquals(MinimalSeverity.HIGH, response.iterator().next().alertNotifications().minimalSeverity()); - Assertions.assertEquals(State.UNSUPPORTED, response.iterator().next().notificationsByRole().state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorInnerTests.java deleted file mode 100644 index adfd19898c50..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorInnerTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorInner; -import com.azure.resourcemanager.security.models.Identity; -import com.azure.resourcemanager.security.models.ResourceIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class SecurityOperatorInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityOperatorInner model = - BinaryData - .fromString( - "{\"identity\":{\"principalId\":\"qcs\",\"tenantId\":\"chkhufm\",\"type\":\"SystemAssigned\"},\"id\":\"mqyjgy\",\"name\":\"zulo\",\"type\":\"saeuzanhsfnhsenw\"}") - .toObject(SecurityOperatorInner.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityOperatorInner model = - new SecurityOperatorInner().withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)); - model = BinaryData.fromObject(model).toObject(SecurityOperatorInner.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorListInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorListInnerTests.java deleted file mode 100644 index 0a20fb58fb2c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorListInnerTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorInner; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorListInner; -import com.azure.resourcemanager.security.models.Identity; -import com.azure.resourcemanager.security.models.ResourceIdentityType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SecurityOperatorListInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityOperatorListInner model = - BinaryData - .fromString( - "{\"value\":[{\"identity\":{\"principalId\":\"wagltbxoeeonqlnf\",\"tenantId\":\"y\",\"type\":\"SystemAssigned\"},\"id\":\"qdbpbhfckdvezc\",\"name\":\"cssbzhddu\",\"type\":\"bnqfblhk\"},{\"identity\":{\"principalId\":\"hpavawu\",\"tenantId\":\"qjtiogqgdm\",\"type\":\"SystemAssigned\"},\"id\":\"ctteajohi\",\"name\":\"gspnbonhpczykm\",\"type\":\"tp\"}]}") - .toObject(SecurityOperatorListInner.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityOperatorListInner model = - new SecurityOperatorListInner() - .withValue( - Arrays - .asList( - new SecurityOperatorInner() - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)), - new SecurityOperatorInner() - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)))); - model = BinaryData.fromObject(model).toObject(SecurityOperatorListInner.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 921164c93c41..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ResourceIdentityType; -import com.azure.resourcemanager.security.models.SecurityOperator; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityOperatorsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"identity\":{\"principalId\":\"bdveywetkrhl\",\"tenantId\":\"mcnwep\",\"type\":\"SystemAssigned\"},\"id\":\"vbbvaqdljnpetl\",\"name\":\"n\",\"type\":\"detawevxehue\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecurityOperator response = - manager - .securityOperators() - .createOrUpdateWithResponse("micjixxfsf", "crtnuguefxxi", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsDeleteByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index ed4a4d8ad1fb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityOperatorsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .securityOperators() - .deleteByResourceGroupWithResponse("dxljzvdovbrble", "lprdaqccddcbnygd", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsGetWithResponseMockTests.java deleted file mode 100644 index 738f40a84517..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsGetWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ResourceIdentityType; -import com.azure.resourcemanager.security.models.SecurityOperator; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityOperatorsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"identity\":{\"principalId\":\"hyogzmsimeht\",\"tenantId\":\"uwdhtq\",\"type\":\"SystemAssigned\"},\"id\":\"hnimx\",\"name\":\"nsugisn\",\"type\":\"mwnwnghojovkey\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecurityOperator response = - manager.securityOperators().getWithResponse("ezs", "zaymld", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsListWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsListWithResponseMockTests.java deleted file mode 100644 index 48ca22b201ec..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsListWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecurityOperatorList; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityOperatorsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"kixsps\",\"name\":\"igavk\",\"type\":\"vyxzer\"},{\"id\":\"rkpzjbyetjxryop\",\"name\":\"ae\",\"type\":\"twhlbecgih\"},{\"id\":\"pemnrrabo\",\"name\":\"rwwxywpj\",\"type\":\"spboxhifp\"},{\"id\":\"kpeswyhhmifj\",\"name\":\"ajxwwvcmmpegl\",\"type\":\"uqvcmlaexbzbqufp\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecurityOperatorList response = - manager - .securityOperators() - .listWithResponse("bfjzabbwzgvzuaix", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionInnerTests.java deleted file mode 100644 index 26a4ccb5f9d3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionInnerTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionInner; -import com.azure.resourcemanager.security.models.ProvisioningState; -import com.azure.resourcemanager.security.models.SecurityFamily; -import org.junit.jupiter.api.Assertions; - -public final class SecuritySolutionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecuritySolutionInner model = - BinaryData - .fromString( - "{\"properties\":{\"securityFamily\":\"Ngfw\",\"provisioningState\":\"Failed\",\"template\":\"rxhtvso\",\"protectionStatus\":\"hlwntsjgq\"},\"location\":\"xypruuuy\",\"id\":\"nchrszizoyu\",\"name\":\"lyetndnbfqygg\",\"type\":\"g\"}") - .toObject(SecuritySolutionInner.class); - Assertions.assertEquals(SecurityFamily.NGFW, model.securityFamily()); - Assertions.assertEquals(ProvisioningState.FAILED, model.provisioningState()); - Assertions.assertEquals("rxhtvso", model.template()); - Assertions.assertEquals("hlwntsjgq", model.protectionStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecuritySolutionInner model = - new SecuritySolutionInner() - .withSecurityFamily(SecurityFamily.NGFW) - .withProvisioningState(ProvisioningState.FAILED) - .withTemplate("rxhtvso") - .withProtectionStatus("hlwntsjgq"); - model = BinaryData.fromObject(model).toObject(SecuritySolutionInner.class); - Assertions.assertEquals(SecurityFamily.NGFW, model.securityFamily()); - Assertions.assertEquals(ProvisioningState.FAILED, model.provisioningState()); - Assertions.assertEquals("rxhtvso", model.template()); - Assertions.assertEquals("hlwntsjgq", model.protectionStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionListTests.java deleted file mode 100644 index 3156ea8030c7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionListTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionInner; -import com.azure.resourcemanager.security.models.ProvisioningState; -import com.azure.resourcemanager.security.models.SecurityFamily; -import com.azure.resourcemanager.security.models.SecuritySolutionList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SecuritySolutionListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecuritySolutionList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"securityFamily\":\"Ngfw\",\"provisioningState\":\"Updating\",\"template\":\"ilguooqjagmditg\",\"protectionStatus\":\"eiookjbsah\"},\"location\":\"dt\",\"id\":\"delqacslmoto\",\"name\":\"bnfxofvc\",\"type\":\"k\"},{\"properties\":{\"securityFamily\":\"Va\",\"provisioningState\":\"Failed\",\"template\":\"azftxejwabmdujtm\",\"protectionStatus\":\"cope\"},\"location\":\"m\",\"id\":\"urbuhhlkyqltq\",\"name\":\"rogtuwkf\",\"type\":\"djk\"},{\"properties\":{\"securityFamily\":\"SaasWaf\",\"provisioningState\":\"Failed\",\"template\":\"idfv\",\"protectionStatus\":\"lglxnfui\"},\"location\":\"kbusqo\",\"id\":\"sfikayiansharuj\",\"name\":\"ji\",\"type\":\"xfz\"},{\"properties\":{\"securityFamily\":\"Waf\",\"provisioningState\":\"Failed\",\"template\":\"tvwkpqhjpenu\",\"protectionStatus\":\"gbqe\"},\"location\":\"ekewvnqvcdlguauc\",\"id\":\"f\",\"name\":\"jwnlax\",\"type\":\"un\"}],\"nextLink\":\"ikczvvitacgxmf\"}") - .toObject(SecuritySolutionList.class); - Assertions.assertEquals(SecurityFamily.NGFW, model.value().get(0).securityFamily()); - Assertions.assertEquals(ProvisioningState.UPDATING, model.value().get(0).provisioningState()); - Assertions.assertEquals("ilguooqjagmditg", model.value().get(0).template()); - Assertions.assertEquals("eiookjbsah", model.value().get(0).protectionStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecuritySolutionList model = - new SecuritySolutionList() - .withValue( - Arrays - .asList( - new SecuritySolutionInner() - .withSecurityFamily(SecurityFamily.NGFW) - .withProvisioningState(ProvisioningState.UPDATING) - .withTemplate("ilguooqjagmditg") - .withProtectionStatus("eiookjbsah"), - new SecuritySolutionInner() - .withSecurityFamily(SecurityFamily.VA) - .withProvisioningState(ProvisioningState.FAILED) - .withTemplate("azftxejwabmdujtm") - .withProtectionStatus("cope"), - new SecuritySolutionInner() - .withSecurityFamily(SecurityFamily.SAAS_WAF) - .withProvisioningState(ProvisioningState.FAILED) - .withTemplate("idfv") - .withProtectionStatus("lglxnfui"), - new SecuritySolutionInner() - .withSecurityFamily(SecurityFamily.WAF) - .withProvisioningState(ProvisioningState.FAILED) - .withTemplate("tvwkpqhjpenu") - .withProtectionStatus("gbqe"))); - model = BinaryData.fromObject(model).toObject(SecuritySolutionList.class); - Assertions.assertEquals(SecurityFamily.NGFW, model.value().get(0).securityFamily()); - Assertions.assertEquals(ProvisioningState.UPDATING, model.value().get(0).provisioningState()); - Assertions.assertEquals("ilguooqjagmditg", model.value().get(0).template()); - Assertions.assertEquals("eiookjbsah", model.value().get(0).protectionStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionPropertiesTests.java deleted file mode 100644 index 05b7764a19cb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionPropertiesTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionProperties; -import com.azure.resourcemanager.security.models.ProvisioningState; -import com.azure.resourcemanager.security.models.SecurityFamily; -import org.junit.jupiter.api.Assertions; - -public final class SecuritySolutionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecuritySolutionProperties model = - BinaryData - .fromString( - "{\"securityFamily\":\"Waf\",\"provisioningState\":\"Failed\",\"template\":\"lgmtrwahzjmucf\",\"protectionStatus\":\"byrplrohkpig\"}") - .toObject(SecuritySolutionProperties.class); - Assertions.assertEquals(SecurityFamily.WAF, model.securityFamily()); - Assertions.assertEquals(ProvisioningState.FAILED, model.provisioningState()); - Assertions.assertEquals("lgmtrwahzjmucf", model.template()); - Assertions.assertEquals("byrplrohkpig", model.protectionStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecuritySolutionProperties model = - new SecuritySolutionProperties() - .withSecurityFamily(SecurityFamily.WAF) - .withProvisioningState(ProvisioningState.FAILED) - .withTemplate("lgmtrwahzjmucf") - .withProtectionStatus("byrplrohkpig"); - model = BinaryData.fromObject(model).toObject(SecuritySolutionProperties.class); - Assertions.assertEquals(SecurityFamily.WAF, model.securityFamily()); - Assertions.assertEquals(ProvisioningState.FAILED, model.provisioningState()); - Assertions.assertEquals("lgmtrwahzjmucf", model.template()); - Assertions.assertEquals("byrplrohkpig", model.protectionStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetWithResponseMockTests.java deleted file mode 100644 index f7a76de5bcf9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ProvisioningState; -import com.azure.resourcemanager.security.models.SecurityFamily; -import com.azure.resourcemanager.security.models.SecuritySolution; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecuritySolutionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"securityFamily\":\"Ngfw\",\"provisioningState\":\"Updating\",\"template\":\"bzkuastaxklpr\",\"protectionStatus\":\"ulhgltoiz\"},\"location\":\"vscksgfyys\",\"id\":\"yekgafxc\",\"name\":\"vfcck\",\"type\":\"rtwletyves\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecuritySolution response = - manager - .securitySolutions() - .getWithResponse("ucumlddauqml", "feothxu", "rigrjdljlkq", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(SecurityFamily.NGFW, response.securityFamily()); - Assertions.assertEquals(ProvisioningState.UPDATING, response.provisioningState()); - Assertions.assertEquals("bzkuastaxklpr", response.template()); - Assertions.assertEquals("ulhgltoiz", response.protectionStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsListMockTests.java deleted file mode 100644 index 160b71db2ea3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsListMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ProvisioningState; -import com.azure.resourcemanager.security.models.SecurityFamily; -import com.azure.resourcemanager.security.models.SecuritySolution; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecuritySolutionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"securityFamily\":\"Va\",\"provisioningState\":\"Failed\",\"template\":\"bpgb\",\"protectionStatus\":\"hbjdqknhqnmotpu\"},\"location\":\"nohmmzngocfrj\",\"id\":\"ypwyiulayno\",\"name\":\"ugkfhaxttpfsm\",\"type\":\"gsgh\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.securitySolutions().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals(SecurityFamily.VA, response.iterator().next().securityFamily()); - Assertions.assertEquals(ProvisioningState.FAILED, response.iterator().next().provisioningState()); - Assertions.assertEquals("bpgb", response.iterator().next().template()); - Assertions.assertEquals("hbjdqknhqnmotpu", response.iterator().next().protectionStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListInnerTests.java deleted file mode 100644 index 692cbbc733e9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListInnerTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionsReferenceDataListInner; -import com.azure.resourcemanager.security.models.SecurityFamily; -import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceData; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SecuritySolutionsReferenceDataListInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecuritySolutionsReferenceDataListInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"securityFamily\":\"Va\",\"alertVendorName\":\"znnbsoqeqalarvl\",\"packageInfoUrl\":\"gunbtgfebwlnbm\",\"productName\":\"yreeudz\",\"publisher\":\"av\",\"publisherDisplayName\":\"pdqmjxlyyzglgouw\",\"template\":\"lmjjyuo\"},\"location\":\"tob\",\"id\":\"xkjeytunlbfj\",\"name\":\"wrus\",\"type\":\"kqbh\"}]}") - .toObject(SecuritySolutionsReferenceDataListInner.class); - Assertions.assertEquals(SecurityFamily.VA, model.value().get(0).securityFamily()); - Assertions.assertEquals("znnbsoqeqalarvl", model.value().get(0).alertVendorName()); - Assertions.assertEquals("gunbtgfebwlnbm", model.value().get(0).packageInfoUrl()); - Assertions.assertEquals("yreeudz", model.value().get(0).productName()); - Assertions.assertEquals("av", model.value().get(0).publisher()); - Assertions.assertEquals("pdqmjxlyyzglgouw", model.value().get(0).publisherDisplayName()); - Assertions.assertEquals("lmjjyuo", model.value().get(0).template()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecuritySolutionsReferenceDataListInner model = - new SecuritySolutionsReferenceDataListInner() - .withValue( - Arrays - .asList( - new SecuritySolutionsReferenceData() - .withSecurityFamily(SecurityFamily.VA) - .withAlertVendorName("znnbsoqeqalarvl") - .withPackageInfoUrl("gunbtgfebwlnbm") - .withProductName("yreeudz") - .withPublisher("av") - .withPublisherDisplayName("pdqmjxlyyzglgouw") - .withTemplate("lmjjyuo"))); - model = BinaryData.fromObject(model).toObject(SecuritySolutionsReferenceDataListInner.class); - Assertions.assertEquals(SecurityFamily.VA, model.value().get(0).securityFamily()); - Assertions.assertEquals("znnbsoqeqalarvl", model.value().get(0).alertVendorName()); - Assertions.assertEquals("gunbtgfebwlnbm", model.value().get(0).packageInfoUrl()); - Assertions.assertEquals("yreeudz", model.value().get(0).productName()); - Assertions.assertEquals("av", model.value().get(0).publisher()); - Assertions.assertEquals("pdqmjxlyyzglgouw", model.value().get(0).publisherDisplayName()); - Assertions.assertEquals("lmjjyuo", model.value().get(0).template()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataPropertiesTests.java deleted file mode 100644 index a13c6be9d0b0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataPropertiesTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionsReferenceDataProperties; -import com.azure.resourcemanager.security.models.SecurityFamily; -import org.junit.jupiter.api.Assertions; - -public final class SecuritySolutionsReferenceDataPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecuritySolutionsReferenceDataProperties model = - BinaryData - .fromString( - "{\"securityFamily\":\"Ngfw\",\"alertVendorName\":\"ixtmkzjvkviirhgf\",\"packageInfoUrl\":\"rwsdp\",\"productName\":\"ra\",\"publisher\":\"zvzbglbyv\",\"publisherDisplayName\":\"ctctbrxkjz\",\"template\":\"rgxffmshkw\"}") - .toObject(SecuritySolutionsReferenceDataProperties.class); - Assertions.assertEquals(SecurityFamily.NGFW, model.securityFamily()); - Assertions.assertEquals("ixtmkzjvkviirhgf", model.alertVendorName()); - Assertions.assertEquals("rwsdp", model.packageInfoUrl()); - Assertions.assertEquals("ra", model.productName()); - Assertions.assertEquals("zvzbglbyv", model.publisher()); - Assertions.assertEquals("ctctbrxkjz", model.publisherDisplayName()); - Assertions.assertEquals("rgxffmshkw", model.template()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecuritySolutionsReferenceDataProperties model = - new SecuritySolutionsReferenceDataProperties() - .withSecurityFamily(SecurityFamily.NGFW) - .withAlertVendorName("ixtmkzjvkviirhgf") - .withPackageInfoUrl("rwsdp") - .withProductName("ra") - .withPublisher("zvzbglbyv") - .withPublisherDisplayName("ctctbrxkjz") - .withTemplate("rgxffmshkw"); - model = BinaryData.fromObject(model).toObject(SecuritySolutionsReferenceDataProperties.class); - Assertions.assertEquals(SecurityFamily.NGFW, model.securityFamily()); - Assertions.assertEquals("ixtmkzjvkviirhgf", model.alertVendorName()); - Assertions.assertEquals("rwsdp", model.packageInfoUrl()); - Assertions.assertEquals("ra", model.productName()); - Assertions.assertEquals("zvzbglbyv", model.publisher()); - Assertions.assertEquals("ctctbrxkjz", model.publisherDisplayName()); - Assertions.assertEquals("rgxffmshkw", model.template()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataTests.java deleted file mode 100644 index 925233362b40..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecurityFamily; -import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceData; -import org.junit.jupiter.api.Assertions; - -public final class SecuritySolutionsReferenceDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecuritySolutionsReferenceData model = - BinaryData - .fromString( - "{\"properties\":{\"securityFamily\":\"Waf\",\"alertVendorName\":\"rqunjq\",\"packageInfoUrl\":\"denxau\",\"productName\":\"kpak\",\"publisher\":\"kifmjn\",\"publisherDisplayName\":\"awtqabpxuckpgg\",\"template\":\"oweyirdhlis\"},\"location\":\"wfl\",\"id\":\"qmp\",\"name\":\"zruwn\",\"type\":\"qxpxiwfcngjsaa\"}") - .toObject(SecuritySolutionsReferenceData.class); - Assertions.assertEquals(SecurityFamily.WAF, model.securityFamily()); - Assertions.assertEquals("rqunjq", model.alertVendorName()); - Assertions.assertEquals("denxau", model.packageInfoUrl()); - Assertions.assertEquals("kpak", model.productName()); - Assertions.assertEquals("kifmjn", model.publisher()); - Assertions.assertEquals("awtqabpxuckpgg", model.publisherDisplayName()); - Assertions.assertEquals("oweyirdhlis", model.template()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecuritySolutionsReferenceData model = - new SecuritySolutionsReferenceData() - .withSecurityFamily(SecurityFamily.WAF) - .withAlertVendorName("rqunjq") - .withPackageInfoUrl("denxau") - .withProductName("kpak") - .withPublisher("kifmjn") - .withPublisherDisplayName("awtqabpxuckpgg") - .withTemplate("oweyirdhlis"); - model = BinaryData.fromObject(model).toObject(SecuritySolutionsReferenceData.class); - Assertions.assertEquals(SecurityFamily.WAF, model.securityFamily()); - Assertions.assertEquals("rqunjq", model.alertVendorName()); - Assertions.assertEquals("denxau", model.packageInfoUrl()); - Assertions.assertEquals("kpak", model.productName()); - Assertions.assertEquals("kifmjn", model.publisher()); - Assertions.assertEquals("awtqabpxuckpgg", model.publisherDisplayName()); - Assertions.assertEquals("oweyirdhlis", model.template()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDatasListByHomeRegionWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDatasListByHomeRegionWithResponseMockTests.java deleted file mode 100644 index 26fcf5ec13dd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDatasListByHomeRegionWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceDataList; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecuritySolutionsReferenceDatasListByHomeRegionWithResponseMockTests { - @Test - public void testListByHomeRegionWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"ablqgpwbmwhria\",\"id\":\"iwrycgnwplrrb\",\"name\":\"hctsbbibti\",\"type\":\"uhqvums\"},{\"location\":\"fsfeqbbe\",\"id\":\"f\",\"name\":\"uqfpyyxmzrmtm\",\"type\":\"wi\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecuritySolutionsReferenceDataList response = - manager - .securitySolutionsReferenceDatas() - .listByHomeRegionWithResponse("cm", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDatasListWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDatasListWithResponseMockTests.java deleted file mode 100644 index de9e41dd19db..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDatasListWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceDataList; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecuritySolutionsReferenceDatasListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"iljpibk\",\"id\":\"xyxyaux\",\"name\":\"eddobmcnltm\",\"type\":\"ytkujsq\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecuritySolutionsReferenceDataList response = - manager.securitySolutionsReferenceDatas().listWithResponse(com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySubAssessmentListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySubAssessmentListTests.java deleted file mode 100644 index 42478af785bb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySubAssessmentListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecuritySubAssessmentList; - -public final class SecuritySubAssessmentListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecuritySubAssessmentList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"id\":\"vgbmhr\",\"displayName\":\"kw\",\"remediation\":\"jejveg\",\"impact\":\"bpnaixexccbdre\",\"category\":\"hcexdrrvqa\",\"description\":\"kghtpwijnh\",\"timeGenerated\":\"2021-01-19T12:23:33Z\"},\"id\":\"ycxzbfvoo\",\"name\":\"vrvmtgjqppyost\",\"type\":\"on\"},{\"properties\":{\"id\":\"hgfipnsxkmcw\",\"displayName\":\"krrjrea\",\"remediation\":\"sgumhjglikkxwsl\",\"impact\":\"bq\",\"category\":\"uzlm\",\"description\":\"elfk\",\"timeGenerated\":\"2021-02-21T20:32:58Z\"},\"id\":\"rpw\",\"name\":\"xeznoi\",\"type\":\"brnjwmw\"}],\"nextLink\":\"nbsazejjoqkag\"}") - .toObject(SecuritySubAssessmentList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecuritySubAssessmentList model = new SecuritySubAssessmentList(); - model = BinaryData.fromObject(model).toObject(SecuritySubAssessmentList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskInnerTests.java deleted file mode 100644 index 26d89e7606fd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskInnerTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecurityTaskInner; -import com.azure.resourcemanager.security.models.SecurityTaskParameters; -import java.util.HashMap; -import java.util.Map; - -public final class SecurityTaskInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityTaskInner model = - BinaryData - .fromString( - "{\"properties\":{\"state\":\"mabiknsorgjhxb\",\"creationTimeUtc\":\"2021-05-03T07:32:41Z\",\"securityTaskParameters\":{\"name\":\"wrlkdmtn\",\"\":{\"xdy\":\"datakotl\"}},\"lastStateChangeTimeUtc\":\"2021-07-08T09:31:36Z\",\"subState\":\"ocogj\"},\"id\":\"tdtbnnhadooc\",\"name\":\"kvci\",\"type\":\"hnvpamqgxq\"}") - .toObject(SecurityTaskInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityTaskInner model = - new SecurityTaskInner() - .withSecurityTaskParameters( - new SecurityTaskParameters().withAdditionalProperties(mapOf("name", "wrlkdmtn"))); - model = BinaryData.fromObject(model).toObject(SecurityTaskInner.class); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskListTests.java deleted file mode 100644 index 36ba851f6c8a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecurityTaskList; - -public final class SecurityTaskListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityTaskList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"state\":\"mslyzrpzbchckqqz\",\"creationTimeUtc\":\"2021-07-29T22:35:12Z\",\"lastStateChangeTimeUtc\":\"2021-09-28T16:07:34Z\",\"subState\":\"uiizynke\"},\"id\":\"yatrwy\",\"name\":\"q\",\"type\":\"ibzyhwitsmyp\"}],\"nextLink\":\"npcdpumnzgm\"}") - .toObject(SecurityTaskList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityTaskList model = new SecurityTaskList(); - model = BinaryData.fromObject(model).toObject(SecurityTaskList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskParametersTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskParametersTests.java deleted file mode 100644 index 20fc96fa43d2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskParametersTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecurityTaskParameters; -import java.util.HashMap; -import java.util.Map; - -public final class SecurityTaskParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityTaskParameters model = - BinaryData - .fromString( - "{\"name\":\"npkukghimdblx\",\"\":{\"j\":\"datamfnjh\",\"oqreyfkzikfjawn\":\"datawmszkk\",\"vxwc\":\"dataa\"}}") - .toObject(SecurityTaskParameters.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityTaskParameters model = - new SecurityTaskParameters().withAdditionalProperties(mapOf("name", "npkukghimdblx")); - model = BinaryData.fromObject(model).toObject(SecurityTaskParameters.class); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskPropertiesTests.java deleted file mode 100644 index ab0162085e57..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskPropertiesTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecurityTaskProperties; -import com.azure.resourcemanager.security.models.SecurityTaskParameters; -import java.util.HashMap; -import java.util.Map; - -public final class SecurityTaskPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityTaskProperties model = - BinaryData - .fromString( - "{\"state\":\"ezikywggxkal\",\"creationTimeUtc\":\"2021-08-12T08:34:22Z\",\"securityTaskParameters\":{\"name\":\"lwuip\",\"\":{\"gvvcnayrhyr\":\"datajzkzi\",\"rdvstkwqqtch\":\"dataxxmueedn\",\"mtdaa\":\"dataalm\",\"vgpiohgwxrt\":\"datagdv\"}},\"lastStateChangeTimeUtc\":\"2021-04-12T14:57:26Z\",\"subState\":\"epxgyqagvr\"}") - .toObject(SecurityTaskProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityTaskProperties model = - new SecurityTaskProperties() - .withSecurityTaskParameters( - new SecurityTaskParameters().withAdditionalProperties(mapOf("name", "lwuip"))); - model = BinaryData.fromObject(model).toObject(SecurityTaskProperties.class); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SensitivityLabelTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SensitivityLabelTests.java deleted file mode 100644 index 43464cb1dae2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SensitivityLabelTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Rank; -import com.azure.resourcemanager.security.models.SensitivityLabel; -import org.junit.jupiter.api.Assertions; - -public final class SensitivityLabelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SensitivityLabel model = - BinaryData - .fromString( - "{\"displayName\":\"ncormrlxqtvcof\",\"description\":\"f\",\"rank\":\"Low\",\"order\":585875953,\"enabled\":false}") - .toObject(SensitivityLabel.class); - Assertions.assertEquals("ncormrlxqtvcof", model.displayName()); - Assertions.assertEquals("f", model.description()); - Assertions.assertEquals(Rank.LOW, model.rank()); - Assertions.assertEquals(585875953, model.order()); - Assertions.assertEquals(false, model.enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SensitivityLabel model = - new SensitivityLabel() - .withDisplayName("ncormrlxqtvcof") - .withDescription("f") - .withRank(Rank.LOW) - .withOrder(585875953) - .withEnabled(false); - model = BinaryData.fromObject(model).toObject(SensitivityLabel.class); - Assertions.assertEquals("ncormrlxqtvcof", model.displayName()); - Assertions.assertEquals("f", model.description()); - Assertions.assertEquals(Rank.LOW, model.rank()); - Assertions.assertEquals(585875953, model.order()); - Assertions.assertEquals(false, model.enabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentInnerTests.java deleted file mode 100644 index 5b2c5441d614..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentInner; - -public final class ServerVulnerabilityAssessmentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerVulnerabilityAssessmentInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\"},\"id\":\"cimpevfg\",\"name\":\"b\",\"type\":\"rrilbywdxsmic\"}") - .toObject(ServerVulnerabilityAssessmentInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerVulnerabilityAssessmentInner model = new ServerVulnerabilityAssessmentInner(); - model = BinaryData.fromObject(model).toObject(ServerVulnerabilityAssessmentInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentPropertiesTests.java deleted file mode 100644 index 536881f97f6a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentPropertiesTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentProperties; - -public final class ServerVulnerabilityAssessmentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerVulnerabilityAssessmentProperties model = - BinaryData - .fromString("{\"provisioningState\":\"Failed\"}") - .toObject(ServerVulnerabilityAssessmentProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerVulnerabilityAssessmentProperties model = new ServerVulnerabilityAssessmentProperties(); - model = BinaryData.fromObject(model).toObject(ServerVulnerabilityAssessmentProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index c4fdd2117d74..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServerVulnerabilityAssessmentsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Failed\"},\"id\":\"kg\",\"name\":\"sdgzyy\",\"type\":\"zoxlvoc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(202); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerVulnerabilityAssessment response = - manager - .serverVulnerabilityAssessments() - .createOrUpdateWithResponse( - "wgpterdiuw", "i", "kskw", "tsdetjygowifcq", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsDeleteMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsDeleteMockTests.java deleted file mode 100644 index 2ab04b526e40..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsDeleteMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServerVulnerabilityAssessmentsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .serverVulnerabilityAssessments() - .delete("tvdxxhe", "gmlilwzghjhjvmab", "zbwaybfmdafbgym", "tn", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsGetWithResponseMockTests.java deleted file mode 100644 index 5c6e0d5cb329..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsGetWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServerVulnerabilityAssessmentsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Failed\"},\"id\":\"qsdb\",\"name\":\"oksz\",\"type\":\"nm\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerVulnerabilityAssessment response = - manager - .serverVulnerabilityAssessments() - .getWithResponse( - "dabalfdxaglzfytl", "tlqh", "pxouvmr", "iflikyypzkgxfx", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsListByExtendedResourceWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsListByExtendedResourceWithResponseMockTests.java deleted file mode 100644 index 481fd65f1106..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsListByExtendedResourceWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsList; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServerVulnerabilityAssessmentsListByExtendedResourceWithResponseMockTests { - @Test - public void testListByExtendedResourceWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"trdxri\",\"name\":\"agbbgia\",\"type\":\"ksykpgdqxwabzrw\"},{\"id\":\"rxhaclcdosqkp\",\"name\":\"jqgkifmmainwhe\",\"type\":\"xkpbqwun\"},{\"id\":\"buizazzelwg\",\"name\":\"ydjufbnklbl\",\"type\":\"xpegj\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerVulnerabilityAssessmentsList response = - manager - .serverVulnerabilityAssessments() - .listByExtendedResourceWithResponse( - "iichgjsysmvxodgw", "f", "zsifcuvbdujgcwx", "ec", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsListInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsListInnerTests.java deleted file mode 100644 index 31961ebd5ca4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsListInnerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentInner; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsListInner; -import java.util.Arrays; - -public final class ServerVulnerabilityAssessmentsListInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerVulnerabilityAssessmentsListInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Deprovisioning\"},\"id\":\"ys\",\"name\":\"gdotcubiipuipwo\",\"type\":\"onmacjekniz\"}]}") - .toObject(ServerVulnerabilityAssessmentsListInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerVulnerabilityAssessmentsListInner model = - new ServerVulnerabilityAssessmentsListInner() - .withValue(Arrays.asList(new ServerVulnerabilityAssessmentInner())); - model = BinaryData.fromObject(model).toObject(ServerVulnerabilityAssessmentsListInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityPropertiesTests.java deleted file mode 100644 index 455357802825..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ServerVulnerabilityProperties; - -public final class ServerVulnerabilityPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerVulnerabilityProperties model = - BinaryData - .fromString( - "{\"assessedResourceType\":\"ServerVulnerabilityAssessment\",\"type\":\"q\",\"cvss\":{\"rgmqso\":{\"base\":67.92354},\"ekxgn\":{\"base\":47.863705},\"mxcpwzvmdoks\":{\"base\":9.420771}},\"patchable\":true,\"cve\":[{\"title\":\"wxlboncqbazqicq\",\"link\":\"ygtvxbyjanepub\"},{\"title\":\"kxyqvgxiaodetv\",\"link\":\"kxdxuwsaifmcwn\"},{\"title\":\"bzlehgc\",\"link\":\"bcknjolgj\"},{\"title\":\"xpvelszerqzevxo\",\"link\":\"intxwa\"}],\"threat\":\"glzoblqwa\",\"publishedTime\":\"2021-06-14T23:06:53Z\",\"vendorReferences\":[{\"title\":\"hmzyqbhdvafjrqpj\",\"link\":\"r\"},{\"title\":\"crgaxwmzwdf\",\"link\":\"nrzorpd\"}]}") - .toObject(ServerVulnerabilityProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerVulnerabilityProperties model = new ServerVulnerabilityProperties(); - model = BinaryData.fromObject(model).toObject(ServerVulnerabilityProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingInnerTests.java deleted file mode 100644 index 274dc0faefc1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SettingInner; - -public final class SettingInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SettingInner model = - BinaryData - .fromString("{\"kind\":\"Setting\",\"id\":\"gddpq\",\"name\":\"hehnmnaoya\",\"type\":\"kcoeqswank\"}") - .toObject(SettingInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SettingInner model = new SettingInner(); - model = BinaryData.fromObject(model).toObject(SettingInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsGetWithResponseMockTests.java deleted file mode 100644 index 0aba89c50575..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Setting; -import com.azure.resourcemanager.security.models.SettingName; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SettingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"kind\":\"Setting\",\"id\":\"oykdno\",\"name\":\"aaxwmgzr\",\"type\":\"jlqcwny\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Setting response = - manager - .settings() - .getWithResponse(SettingName.WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW, com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsListMockTests.java deleted file mode 100644 index 1018c003ebc9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Setting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SettingsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"kind\":\"Setting\",\"id\":\"i\",\"name\":\"zbkuckgkdsksw\",\"type\":\"iiqqcqikclsmalns\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.settings().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsListTests.java deleted file mode 100644 index 8f367ef1368f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsListTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SettingInner; -import com.azure.resourcemanager.security.models.SettingsList; -import java.util.Arrays; - -public final class SettingsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SettingsList model = - BinaryData - .fromString( - "{\"value\":[{\"kind\":\"Setting\",\"id\":\"sqowxwc\",\"name\":\"mlikytw\",\"type\":\"czcswka\"}],\"nextLink\":\"ejyfdvlvhbwrnfx\"}") - .toObject(SettingsList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SettingsList model = new SettingsList().withValue(Arrays.asList(new SettingInner())); - model = BinaryData.fromObject(model).toObject(SettingsList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsUpdateWithResponseMockTests.java deleted file mode 100644 index 4e2bfc09b885..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsUpdateWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.fluent.models.SettingInner; -import com.azure.resourcemanager.security.models.Setting; -import com.azure.resourcemanager.security.models.SettingName; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SettingsUpdateWithResponseMockTests { - @Test - public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"kind\":\"Setting\",\"id\":\"hxuvjhxm\",\"name\":\"rqstjcme\",\"type\":\"wmlgicvnpv\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Setting response = - manager - .settings() - .updateWithResponse( - SettingName.WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW, - new SettingInner(), - com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInnerTests.java deleted file mode 100644 index ffbdd98a417e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInnerTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SoftwareInner; -import com.azure.resourcemanager.security.models.EndOfSupportStatus; -import org.junit.jupiter.api.Assertions; - -public final class SoftwareInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SoftwareInner model = - BinaryData - .fromString( - "{\"properties\":{\"deviceId\":\"gm\",\"osPlatform\":\"fjlrxwtoauk\",\"vendor\":\"kvci\",\"softwareName\":\"zmoaeds\",\"version\":\"wuived\",\"endOfSupportStatus\":\"noLongerSupported\",\"endOfSupportDate\":\"eewxeiqbpsmg\",\"numberOfKnownVulnerabilities\":1437777352,\"firstSeenAt\":\"amljdlrgmsplzgau\"},\"id\":\"cshhv\",\"name\":\"ewgnxkympqanxrj\",\"type\":\"ixt\"}") - .toObject(SoftwareInner.class); - Assertions.assertEquals("gm", model.deviceId()); - Assertions.assertEquals("fjlrxwtoauk", model.osPlatform()); - Assertions.assertEquals("kvci", model.vendor()); - Assertions.assertEquals("zmoaeds", model.softwareName()); - Assertions.assertEquals("wuived", model.version()); - Assertions.assertEquals(EndOfSupportStatus.NO_LONGER_SUPPORTED, model.endOfSupportStatus()); - Assertions.assertEquals("eewxeiqbpsmg", model.endOfSupportDate()); - Assertions.assertEquals(1437777352, model.numberOfKnownVulnerabilities()); - Assertions.assertEquals("amljdlrgmsplzgau", model.firstSeenAt()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SoftwareInner model = - new SoftwareInner() - .withDeviceId("gm") - .withOsPlatform("fjlrxwtoauk") - .withVendor("kvci") - .withSoftwareName("zmoaeds") - .withVersion("wuived") - .withEndOfSupportStatus(EndOfSupportStatus.NO_LONGER_SUPPORTED) - .withEndOfSupportDate("eewxeiqbpsmg") - .withNumberOfKnownVulnerabilities(1437777352) - .withFirstSeenAt("amljdlrgmsplzgau"); - model = BinaryData.fromObject(model).toObject(SoftwareInner.class); - Assertions.assertEquals("gm", model.deviceId()); - Assertions.assertEquals("fjlrxwtoauk", model.osPlatform()); - Assertions.assertEquals("kvci", model.vendor()); - Assertions.assertEquals("zmoaeds", model.softwareName()); - Assertions.assertEquals("wuived", model.version()); - Assertions.assertEquals(EndOfSupportStatus.NO_LONGER_SUPPORTED, model.endOfSupportStatus()); - Assertions.assertEquals("eewxeiqbpsmg", model.endOfSupportDate()); - Assertions.assertEquals(1437777352, model.numberOfKnownVulnerabilities()); - Assertions.assertEquals("amljdlrgmsplzgau", model.firstSeenAt()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesGetWithResponseMockTests.java deleted file mode 100644 index fe3f0f527438..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesGetWithResponseMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.EndOfSupportStatus; -import com.azure.resourcemanager.security.models.Software; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SoftwareInventoriesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"deviceId\":\"dtlri\",\"osPlatform\":\"ooy\",\"vendor\":\"uxdtzcq\",\"softwareName\":\"sdudgcoz\",\"version\":\"meh\",\"endOfSupportStatus\":\"None\",\"endOfSupportDate\":\"tolamlbijuxkq\",\"numberOfKnownVulnerabilities\":769039646,\"firstSeenAt\":\"i\"},\"id\":\"vwdtgckzdqiqdl\",\"name\":\"atrkwxoauwxs\",\"type\":\"ykznhrfgslglhp\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Software response = - manager - .softwareInventories() - .getWithResponse( - "wahoyiyaxqvjw", "i", "tcz", "ddnvovbooqbmdq", "xyglaetscflw", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("dtlri", response.deviceId()); - Assertions.assertEquals("ooy", response.osPlatform()); - Assertions.assertEquals("uxdtzcq", response.vendor()); - Assertions.assertEquals("sdudgcoz", response.softwareName()); - Assertions.assertEquals("meh", response.version()); - Assertions.assertEquals(EndOfSupportStatus.NONE, response.endOfSupportStatus()); - Assertions.assertEquals("tolamlbijuxkq", response.endOfSupportDate()); - Assertions.assertEquals(769039646, response.numberOfKnownVulnerabilities()); - Assertions.assertEquals("i", response.firstSeenAt()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListByExtendedResourceMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListByExtendedResourceMockTests.java deleted file mode 100644 index 002a0109fba1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListByExtendedResourceMockTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.EndOfSupportStatus; -import com.azure.resourcemanager.security.models.Software; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SoftwareInventoriesListByExtendedResourceMockTests { - @Test - public void testListByExtendedResource() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"deviceId\":\"movsfbpbvz\",\"osPlatform\":\"axmfmvsmcwoxfa\",\"vendor\":\"tnq\",\"softwareName\":\"bsat\",\"version\":\"iauesugmocpcjy\",\"endOfSupportStatus\":\"noLongerSupported\",\"endOfSupportDate\":\"lrgttwfldsiuor\",\"numberOfKnownVulnerabilities\":1814755827,\"firstSeenAt\":\"cedpksriwmmtmqrx\"},\"id\":\"zqv\",\"name\":\"yczyayubtgm\",\"type\":\"xiqahr\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .softwareInventories() - .listByExtendedResource( - "ovanyrva", "rtgelg", "ewikfyaqandmym", "qoq", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("movsfbpbvz", response.iterator().next().deviceId()); - Assertions.assertEquals("axmfmvsmcwoxfa", response.iterator().next().osPlatform()); - Assertions.assertEquals("tnq", response.iterator().next().vendor()); - Assertions.assertEquals("bsat", response.iterator().next().softwareName()); - Assertions.assertEquals("iauesugmocpcjy", response.iterator().next().version()); - Assertions - .assertEquals(EndOfSupportStatus.NO_LONGER_SUPPORTED, response.iterator().next().endOfSupportStatus()); - Assertions.assertEquals("lrgttwfldsiuor", response.iterator().next().endOfSupportDate()); - Assertions.assertEquals(1814755827, response.iterator().next().numberOfKnownVulnerabilities()); - Assertions.assertEquals("cedpksriwmmtmqrx", response.iterator().next().firstSeenAt()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListMockTests.java deleted file mode 100644 index 6e5334067749..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.EndOfSupportStatus; -import com.azure.resourcemanager.security.models.Software; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SoftwareInventoriesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"deviceId\":\"pxmib\",\"osPlatform\":\"nupoyryefqmwovyz\",\"vendor\":\"lnomfpb\",\"softwareName\":\"eegvyieztkutnj\",\"version\":\"l\",\"endOfSupportStatus\":\"noLongerSupported\",\"endOfSupportDate\":\"ehyh\",\"numberOfKnownVulnerabilities\":1937548392,\"firstSeenAt\":\"dui\"},\"id\":\"vulxfar\",\"name\":\"rvjlgd\",\"type\":\"zvj\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.softwareInventories().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("pxmib", response.iterator().next().deviceId()); - Assertions.assertEquals("nupoyryefqmwovyz", response.iterator().next().osPlatform()); - Assertions.assertEquals("lnomfpb", response.iterator().next().vendor()); - Assertions.assertEquals("eegvyieztkutnj", response.iterator().next().softwareName()); - Assertions.assertEquals("l", response.iterator().next().version()); - Assertions - .assertEquals(EndOfSupportStatus.NO_LONGER_SUPPORTED, response.iterator().next().endOfSupportStatus()); - Assertions.assertEquals("ehyh", response.iterator().next().endOfSupportDate()); - Assertions.assertEquals(1937548392, response.iterator().next().numberOfKnownVulnerabilities()); - Assertions.assertEquals("dui", response.iterator().next().firstSeenAt()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwarePropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwarePropertiesTests.java deleted file mode 100644 index 54a412a8401b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwarePropertiesTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SoftwareProperties; -import com.azure.resourcemanager.security.models.EndOfSupportStatus; -import org.junit.jupiter.api.Assertions; - -public final class SoftwarePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SoftwareProperties model = - BinaryData - .fromString( - "{\"deviceId\":\"taoypnyghshxc\",\"osPlatform\":\"hkgmnsg\",\"vendor\":\"xycphdrwjjkh\",\"softwareName\":\"omacluzvxnqmhr\",\"version\":\"pd\",\"endOfSupportStatus\":\"upcomingVersionNoLongerSupported\",\"endOfSupportDate\":\"oi\",\"numberOfKnownVulnerabilities\":785692524,\"firstSeenAt\":\"sffxui\"}") - .toObject(SoftwareProperties.class); - Assertions.assertEquals("taoypnyghshxc", model.deviceId()); - Assertions.assertEquals("hkgmnsg", model.osPlatform()); - Assertions.assertEquals("xycphdrwjjkh", model.vendor()); - Assertions.assertEquals("omacluzvxnqmhr", model.softwareName()); - Assertions.assertEquals("pd", model.version()); - Assertions.assertEquals(EndOfSupportStatus.UPCOMING_VERSION_NO_LONGER_SUPPORTED, model.endOfSupportStatus()); - Assertions.assertEquals("oi", model.endOfSupportDate()); - Assertions.assertEquals(785692524, model.numberOfKnownVulnerabilities()); - Assertions.assertEquals("sffxui", model.firstSeenAt()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SoftwareProperties model = - new SoftwareProperties() - .withDeviceId("taoypnyghshxc") - .withOsPlatform("hkgmnsg") - .withVendor("xycphdrwjjkh") - .withSoftwareName("omacluzvxnqmhr") - .withVersion("pd") - .withEndOfSupportStatus(EndOfSupportStatus.UPCOMING_VERSION_NO_LONGER_SUPPORTED) - .withEndOfSupportDate("oi") - .withNumberOfKnownVulnerabilities(785692524) - .withFirstSeenAt("sffxui"); - model = BinaryData.fromObject(model).toObject(SoftwareProperties.class); - Assertions.assertEquals("taoypnyghshxc", model.deviceId()); - Assertions.assertEquals("hkgmnsg", model.osPlatform()); - Assertions.assertEquals("xycphdrwjjkh", model.vendor()); - Assertions.assertEquals("omacluzvxnqmhr", model.softwareName()); - Assertions.assertEquals("pd", model.version()); - Assertions.assertEquals(EndOfSupportStatus.UPCOMING_VERSION_NO_LONGER_SUPPORTED, model.endOfSupportStatus()); - Assertions.assertEquals("oi", model.endOfSupportDate()); - Assertions.assertEquals(785692524, model.numberOfKnownVulnerabilities()); - Assertions.assertEquals("sffxui", model.firstSeenAt()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwaresListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwaresListTests.java deleted file mode 100644 index 0f39ca4eab08..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwaresListTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SoftwareInner; -import com.azure.resourcemanager.security.models.EndOfSupportStatus; -import com.azure.resourcemanager.security.models.SoftwaresList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SoftwaresListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SoftwaresList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"deviceId\":\"ubkmifo\",\"osPlatform\":\"ku\",\"vendor\":\"phavpmhbrb\",\"softwareName\":\"vgovpbbttefjokn\",\"version\":\"qyzqedikdfrdb\",\"endOfSupportStatus\":\"upcomingNoLongerSupported\",\"endOfSupportDate\":\"jgeihfqlggwfi\",\"numberOfKnownVulnerabilities\":864537987,\"firstSeenAt\":\"mjpb\"},\"id\":\"ephmgtvljvrcmyfq\",\"name\":\"pgxh\",\"type\":\"pomyqwcabvnuile\"}],\"nextLink\":\"aswlp\"}") - .toObject(SoftwaresList.class); - Assertions.assertEquals("ubkmifo", model.value().get(0).deviceId()); - Assertions.assertEquals("ku", model.value().get(0).osPlatform()); - Assertions.assertEquals("phavpmhbrb", model.value().get(0).vendor()); - Assertions.assertEquals("vgovpbbttefjokn", model.value().get(0).softwareName()); - Assertions.assertEquals("qyzqedikdfrdb", model.value().get(0).version()); - Assertions - .assertEquals(EndOfSupportStatus.UPCOMING_NO_LONGER_SUPPORTED, model.value().get(0).endOfSupportStatus()); - Assertions.assertEquals("jgeihfqlggwfi", model.value().get(0).endOfSupportDate()); - Assertions.assertEquals(864537987, model.value().get(0).numberOfKnownVulnerabilities()); - Assertions.assertEquals("mjpb", model.value().get(0).firstSeenAt()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SoftwaresList model = - new SoftwaresList() - .withValue( - Arrays - .asList( - new SoftwareInner() - .withDeviceId("ubkmifo") - .withOsPlatform("ku") - .withVendor("phavpmhbrb") - .withSoftwareName("vgovpbbttefjokn") - .withVersion("qyzqedikdfrdb") - .withEndOfSupportStatus(EndOfSupportStatus.UPCOMING_NO_LONGER_SUPPORTED) - .withEndOfSupportDate("jgeihfqlggwfi") - .withNumberOfKnownVulnerabilities(864537987) - .withFirstSeenAt("mjpb"))); - model = BinaryData.fromObject(model).toObject(SoftwaresList.class); - Assertions.assertEquals("ubkmifo", model.value().get(0).deviceId()); - Assertions.assertEquals("ku", model.value().get(0).osPlatform()); - Assertions.assertEquals("phavpmhbrb", model.value().get(0).vendor()); - Assertions.assertEquals("vgovpbbttefjokn", model.value().get(0).softwareName()); - Assertions.assertEquals("qyzqedikdfrdb", model.value().get(0).version()); - Assertions - .assertEquals(EndOfSupportStatus.UPCOMING_NO_LONGER_SUPPORTED, model.value().get(0).endOfSupportStatus()); - Assertions.assertEquals("jgeihfqlggwfi", model.value().get(0).endOfSupportDate()); - Assertions.assertEquals(864537987, model.value().get(0).numberOfKnownVulnerabilities()); - Assertions.assertEquals("mjpb", model.value().get(0).firstSeenAt()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlServerVulnerabilityPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlServerVulnerabilityPropertiesTests.java deleted file mode 100644 index 5b7dccfffcf8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlServerVulnerabilityPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SqlServerVulnerabilityProperties; - -public final class SqlServerVulnerabilityPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SqlServerVulnerabilityProperties model = - BinaryData - .fromString( - "{\"assessedResourceType\":\"SqlServerVulnerability\",\"type\":\"r\",\"query\":\"uuatvlmbjwcol\"}") - .toObject(SqlServerVulnerabilityProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SqlServerVulnerabilityProperties model = new SqlServerVulnerabilityProperties(); - model = BinaryData.fromObject(model).toObject(SqlServerVulnerabilityProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddWithResponseMockTests.java deleted file mode 100644 index fdd1ddad84be..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddWithResponseMockTests.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RulesResults; -import com.azure.resourcemanager.security.models.RulesResultsInput; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SqlVulnerabilityAssessmentBaselineRulesAddWithResponseMockTests { - @Test - public void testAddWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"re\",\"name\":\"sfepgckncjmg\",\"type\":\"snvbtqdxfm\"},{\"id\":\"mjnhjlu\",\"name\":\"llbsupubdxc\",\"type\":\"dlhzwhcu\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RulesResults response = - manager - .sqlVulnerabilityAssessmentBaselineRules() - .addWithResponse( - "jeufj", - "flpd", - new RulesResultsInput() - .withLatestScan(true) - .withResults( - mapOf( - "uninttlnrjdszd", - Arrays - .asList(Arrays.asList("iyuxlvrh"), Arrays.asList("rvbwonleq", "lvtlrvbst", "huy")), - "oxuo", - Arrays.asList(Arrays.asList("iciqppo", "vgp", "e", "uhwfwj")))), - com.azure.core.util.Context.NONE) - .getValue(); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 3ad1d857c8eb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RuleResults; -import java.nio.ByteBuffer; -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 org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"results\":[[\"yrudmahswtvd\"],[\"bqssgfen\",\"fdxbvwfqjchiv\",\"r\",\"j\"]]},\"id\":\"nxndmuvardlmzjo\",\"name\":\"p\",\"type\":\"rmuhcuhtuzlx\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RuleResults response = - manager - .sqlVulnerabilityAssessmentBaselineRules() - .define("vbosjj") - .withExistingResourceId("kcgn") - .withLatestScan(true) - .withResults( - Arrays - .asList( - Arrays.asList("jiwgsxfaio", "wd", "ujjgnfgrzxbarc"), - Arrays.asList("aefzqsy", "jwenjcytesmf"), - Arrays.asList("r", "fodqhuauzmzi", "rtrfzh", "ezvhj"))) - .withWorkspaceId("dizhrjqfyaytvsly") - .create(); - - Assertions.assertEquals("yrudmahswtvd", response.properties().results().get(0).get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesDeleteWithResponseMockTests.java deleted file mode 100644 index 31076ada85b1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SqlVulnerabilityAssessmentBaselineRulesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .sqlVulnerabilityAssessmentBaselineRules() - .deleteWithResponse("qzssl", "mgw", "nivrxpfduio", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesGetWithResponseMockTests.java deleted file mode 100644 index dc1d8ef44b64..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RuleResults; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SqlVulnerabilityAssessmentBaselineRulesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"results\":[[\"lobha\",\"qmomfe\"],[\"rkfrocgbmxldj\"],[\"ezb\",\"esylslur\"],[\"fygpnyhgd\",\"uqs\"]]},\"id\":\"a\",\"name\":\"qyvoupr\",\"type\":\"y\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RuleResults response = - manager - .sqlVulnerabilityAssessmentBaselineRules() - .getWithResponse("rtux", "prhfcaeo", "ifq", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("lobha", response.properties().results().get(0).get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesListWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesListWithResponseMockTests.java deleted file mode 100644 index 527d1fff55d6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesListWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RulesResults; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SqlVulnerabilityAssessmentBaselineRulesListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"ormvh\",\"name\":\"zielbprnq\",\"type\":\"jywzcqyg\"},{\"id\":\"nwsvhbngqiwye\",\"name\":\"tobdrrpnre\",\"type\":\"kunsbfjhhlwtpkv\"},{\"id\":\"eattbzkgtzqnw\",\"name\":\"s\",\"type\":\"tewuvcy\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RulesResults response = - manager - .sqlVulnerabilityAssessmentBaselineRules() - .listWithResponse("hgyqvpbfj", "oqzucfzluczdq", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsGetWithResponseMockTests.java deleted file mode 100644 index 853d0773c5fa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsGetWithResponseMockTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RuleSeverity; -import com.azure.resourcemanager.security.models.RuleStatus; -import com.azure.resourcemanager.security.models.RuleType; -import com.azure.resourcemanager.security.models.ScanResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SqlVulnerabilityAssessmentScanResultsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"ruleId\":\"scle\",\"status\":\"InternalError\",\"isTrimmed\":true,\"queryResults\":[[\"qlmfdg\",\"n\",\"buypwovvv\"],[\"leev\",\"oqayrehjuqwv\"],[\"xrlzhpziha\"],[\"nqqz\",\"xnq\",\"ubfonfdbgmkf\"]],\"remediation\":{\"description\":\"cwtewfhxwyrkb\",\"scripts\":[],\"automated\":false,\"portalLink\":\"rynjpc\"},\"baselineAdjustedResult\":{\"status\":\"InternalError\",\"resultsNotInBaseline\":[],\"resultsOnlyInBaseline\":[]},\"ruleMetadata\":{\"ruleId\":\"ajubo\",\"severity\":\"Low\",\"category\":\"e\",\"ruleType\":\"BaselineExpected\",\"title\":\"ieikmwlaoklfnis\",\"description\":\"gucbmt\",\"rationale\":\"dscnns\",\"benchmarkReferences\":[]}},\"id\":\"yyuvtzrxzhclec\",\"name\":\"wtzqzcloyhy\",\"type\":\"pgidhzgyresgzsdt\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ScanResult response = - manager - .sqlVulnerabilityAssessmentScanResults() - .getWithResponse("akmhz", "hwahfbw", "hbnnxemv", "nuqqkotauratnicp", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("scle", response.properties().ruleId()); - Assertions.assertEquals(RuleStatus.INTERNAL_ERROR, response.properties().status()); - Assertions.assertEquals(true, response.properties().isTrimmed()); - Assertions.assertEquals("qlmfdg", response.properties().queryResults().get(0).get(0)); - Assertions.assertEquals("cwtewfhxwyrkb", response.properties().remediation().description()); - Assertions.assertEquals(false, response.properties().remediation().automated()); - Assertions.assertEquals("rynjpc", response.properties().remediation().portalLink()); - Assertions.assertEquals(RuleStatus.INTERNAL_ERROR, response.properties().baselineAdjustedResult().status()); - Assertions.assertEquals("ajubo", response.properties().ruleMetadata().ruleId()); - Assertions.assertEquals(RuleSeverity.LOW, response.properties().ruleMetadata().severity()); - Assertions.assertEquals("e", response.properties().ruleMetadata().category()); - Assertions.assertEquals(RuleType.BASELINE_EXPECTED, response.properties().ruleMetadata().ruleType()); - Assertions.assertEquals("ieikmwlaoklfnis", response.properties().ruleMetadata().title()); - Assertions.assertEquals("gucbmt", response.properties().ruleMetadata().description()); - Assertions.assertEquals("dscnns", response.properties().ruleMetadata().rationale()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsListWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsListWithResponseMockTests.java deleted file mode 100644 index f2797e4b665f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsListWithResponseMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ScanResults; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SqlVulnerabilityAssessmentScanResultsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"value\":[{\"id\":\"pmaxfnzlpqmpf\",\"name\":\"xef\",\"type\":\"ulbl\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ScanResults response = - manager - .sqlVulnerabilityAssessmentScanResults() - .listWithResponse("wbyorjplbchych", "kvy", "fbqvumkxqj", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetWithResponseMockTests.java deleted file mode 100644 index 603ffbe7c33f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetWithResponseMockTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Scan; -import com.azure.resourcemanager.security.models.ScanState; -import com.azure.resourcemanager.security.models.ScanTriggerType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SqlVulnerabilityAssessmentScansGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"triggerType\":\"OnDemand\",\"state\":\"InProgress\",\"server\":\"us\",\"database\":\"gqrnt\",\"sqlVersion\":\"mdrcjlvkrkegtyc\",\"startTime\":\"2021-08-13T12:29:36Z\",\"endTime\":\"2021-01-04T09:23:29Z\",\"highSeverityFailedRulesCount\":405343249,\"mediumSeverityFailedRulesCount\":659260002,\"lowSeverityFailedRulesCount\":1028016104,\"totalPassedRulesCount\":791044616,\"totalFailedRulesCount\":156375863,\"totalRulesCount\":882589849,\"isBaselineApplied\":true,\"lastScanTime\":\"2021-09-21T16:49:09Z\"},\"id\":\"bm\",\"name\":\"vsexduetb\",\"type\":\"pfczewxtrl\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Scan response = - manager - .sqlVulnerabilityAssessmentScans() - .getWithResponse("mkuuyiuy", "afixlxicwgpthd", "fmfzcfasfodropa", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ScanTriggerType.ON_DEMAND, response.properties().triggerType()); - Assertions.assertEquals(ScanState.IN_PROGRESS, response.properties().state()); - Assertions.assertEquals("us", response.properties().server()); - Assertions.assertEquals("gqrnt", response.properties().database()); - Assertions.assertEquals("mdrcjlvkrkegtyc", response.properties().sqlVersion()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-13T12:29:36Z"), response.properties().startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-04T09:23:29Z"), response.properties().endTime()); - Assertions.assertEquals(405343249, response.properties().highSeverityFailedRulesCount()); - Assertions.assertEquals(659260002, response.properties().mediumSeverityFailedRulesCount()); - Assertions.assertEquals(1028016104, response.properties().lowSeverityFailedRulesCount()); - Assertions.assertEquals(791044616, response.properties().totalPassedRulesCount()); - Assertions.assertEquals(156375863, response.properties().totalFailedRulesCount()); - Assertions.assertEquals(882589849, response.properties().totalRulesCount()); - Assertions.assertEquals(true, response.properties().isBaselineApplied()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-21T16:49:09Z"), response.properties().lastScanTime()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansListWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansListWithResponseMockTests.java deleted file mode 100644 index 5edd68000c75..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansListWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Scans; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SqlVulnerabilityAssessmentScansListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"bthmsritj\",\"name\":\"uiggruno\",\"type\":\"fvua\"},{\"id\":\"thoivsdwsngk\",\"name\":\"f\",\"type\":\"hscj\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Scans response = - manager - .sqlVulnerabilityAssessmentScans() - .listWithResponse("bpxya", "kjpirgzxvbczw", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SuppressionAlertsScopeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SuppressionAlertsScopeTests.java deleted file mode 100644 index 0a6103a002fd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SuppressionAlertsScopeTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ScopeElement; -import com.azure.resourcemanager.security.models.SuppressionAlertsScope; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SuppressionAlertsScopeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SuppressionAlertsScope model = - BinaryData - .fromString( - "{\"allOf\":[{\"field\":\"pnnbjc\",\"\":{\"orsukokwbqp\":\"dataibbdaxconfoza\",\"hw\":\"datahlvnuuepzlr\"}}]}") - .toObject(SuppressionAlertsScope.class); - Assertions.assertEquals("pnnbjc", model.allOf().get(0).field()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SuppressionAlertsScope model = - new SuppressionAlertsScope() - .withAllOf(Arrays.asList(new ScopeElement().withField("pnnbjc").withAdditionalProperties(mapOf()))); - model = BinaryData.fromObject(model).toObject(SuppressionAlertsScope.class); - Assertions.assertEquals("pnnbjc", model.allOf().get(0).field()); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TagsResourceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TagsResourceTests.java deleted file mode 100644 index 714e9f1a31f6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TagsResourceTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.TagsResource; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TagsResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TagsResource model = - BinaryData - .fromString("{\"tags\":{\"yoxgvcltbgsnc\":\"dokgjl\",\"htxfvgxbfsmxnehm\":\"hkjeszzhbi\"}}") - .toObject(TagsResource.class); - Assertions.assertEquals("dokgjl", model.tags().get("yoxgvcltbgsnc")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TagsResource model = - new TagsResource().withTags(mapOf("yoxgvcltbgsnc", "dokgjl", "htxfvgxbfsmxnehm", "hkjeszzhbi")); - model = BinaryData.fromObject(model).toObject(TagsResource.class); - Assertions.assertEquals("dokgjl", model.tags().get("yoxgvcltbgsnc")); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TagsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TagsTests.java deleted file mode 100644 index 0c1961837789..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TagsTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Tags; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TagsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Tags model = - BinaryData.fromString("{\"tags\":{\"vpkjpr\":\"qioknssxmojm\",\"ql\":\"kwcf\"}}").toObject(Tags.class); - Assertions.assertEquals("qioknssxmojm", model.tags().get("vpkjpr")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Tags model = new Tags().withTags(mapOf("vpkjpr", "qioknssxmojm", "ql", "kwcf")); - model = BinaryData.fromObject(model).toObject(Tags.class); - Assertions.assertEquals("qioknssxmojm", model.tags().get("vpkjpr")); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksGetResourceGroupLevelTaskWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksGetResourceGroupLevelTaskWithResponseMockTests.java deleted file mode 100644 index 0529913c20fb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksGetResourceGroupLevelTaskWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecurityTask; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TasksGetResourceGroupLevelTaskWithResponseMockTests { - @Test - public void testGetResourceGroupLevelTaskWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"state\":\"disnuepywyjln\",\"creationTimeUtc\":\"2021-05-30T04:46:23Z\",\"securityTaskParameters\":{\"name\":\"ttdiia\",\"\":{}},\"lastStateChangeTimeUtc\":\"2021-04-13T20:18:06Z\",\"subState\":\"zjihweebiphr\"},\"id\":\"vcjwqwoqsratj\",\"name\":\"dhzybsp\",\"type\":\"jhfrzgdkkagv\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecurityTask response = - manager - .tasks() - .getResourceGroupLevelTaskWithResponse( - "yvliq", "ipsejbsvsia", "eswhd", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksGetSubscriptionLevelTaskWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksGetSubscriptionLevelTaskWithResponseMockTests.java deleted file mode 100644 index be090fd559ea..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksGetSubscriptionLevelTaskWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecurityTask; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TasksGetSubscriptionLevelTaskWithResponseMockTests { - @Test - public void testGetSubscriptionLevelTaskWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"state\":\"uxweyslandkd\",\"creationTimeUtc\":\"2021-04-27T10:17:51Z\",\"securityTaskParameters\":{\"name\":\"nhghcga\",\"\":{}},\"lastStateChangeTimeUtc\":\"2021-10-31T20:43:11Z\",\"subState\":\"quox\"},\"id\":\"otire\",\"name\":\"mseobfsxstcyilbv\",\"type\":\"m\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecurityTask response = - manager - .tasks() - .getSubscriptionLevelTaskWithResponse("fm", "fgvqcpdw", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListByHomeRegionMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListByHomeRegionMockTests.java deleted file mode 100644 index b34da88b652c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListByHomeRegionMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecurityTask; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TasksListByHomeRegionMockTests { - @Test - public void testListByHomeRegion() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"state\":\"f\",\"creationTimeUtc\":\"2021-08-20T00:28:15Z\",\"securityTaskParameters\":{\"name\":\"pmomihz\",\"\":{}},\"lastStateChangeTimeUtc\":\"2021-03-14T23:39:17Z\",\"subState\":\"pkcdpreyxely\"},\"id\":\"cghf\",\"name\":\"rufssjyg\",\"type\":\"sfxrkbhammgm\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.tasks().listByHomeRegion("cdgzseznux", "euairaabmdlqjb", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListByResourceGroupMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListByResourceGroupMockTests.java deleted file mode 100644 index 2430bfaaed61..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListByResourceGroupMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecurityTask; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TasksListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"state\":\"aqidoyzltgiomqo\",\"creationTimeUtc\":\"2021-08-16T07:59:27Z\",\"securityTaskParameters\":{\"name\":\"aeapfsergd\",\"\":{}},\"lastStateChangeTimeUtc\":\"2021-04-15T19:12:02Z\",\"subState\":\"acyh\"},\"id\":\"qwbp\",\"name\":\"qncjubkhjozfymcw\",\"type\":\"bupyv\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.tasks().listByResourceGroup("n", "abwmvogljsv", "pgidnw", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListMockTests.java deleted file mode 100644 index 032957052d88..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecurityTask; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TasksListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"state\":\"ewuyqa\",\"creationTimeUtc\":\"2021-07-02T03:18:38Z\",\"securityTaskParameters\":{\"name\":\"hgejkbvhhdaurgh\",\"\":{}},\"lastStateChangeTimeUtc\":\"2021-10-08T07:27:35Z\",\"subState\":\"xb\"},\"id\":\"hxjxjoezlqxrkdkn\",\"name\":\"obektmbozo\",\"type\":\"tzamicbig\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.tasks().list("ycqsxr", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksUpdateResourceGroupLevelTaskStateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksUpdateResourceGroupLevelTaskStateWithResponseMockTests.java deleted file mode 100644 index 7244dcfdbd3f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksUpdateResourceGroupLevelTaskStateWithResponseMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.TaskUpdateActionType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TasksUpdateResourceGroupLevelTaskStateWithResponseMockTests { - @Test - public void testUpdateResourceGroupLevelTaskStateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .tasks() - .updateResourceGroupLevelTaskStateWithResponse( - "ukhsusmmorf", "zhwilzzh", "ijmri", TaskUpdateActionType.ACTIVATE, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksUpdateSubscriptionLevelTaskStateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksUpdateSubscriptionLevelTaskStateWithResponseMockTests.java deleted file mode 100644 index 624767ae25a9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksUpdateSubscriptionLevelTaskStateWithResponseMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.TaskUpdateActionType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TasksUpdateSubscriptionLevelTaskStateWithResponseMockTests { - @Test - public void testUpdateSubscriptionLevelTaskStateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .tasks() - .updateSubscriptionLevelTaskStateWithResponse( - "xcjzlquze", "okjxebjvb", TaskUpdateActionType.START, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ThresholdCustomAlertRuleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ThresholdCustomAlertRuleTests.java deleted file mode 100644 index 62d6d2eb3584..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ThresholdCustomAlertRuleTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ThresholdCustomAlertRule; -import org.junit.jupiter.api.Assertions; - -public final class ThresholdCustomAlertRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ThresholdCustomAlertRule model = - BinaryData - .fromString( - "{\"ruleType\":\"ThresholdCustomAlertRule\",\"minThreshold\":1382683860,\"maxThreshold\":1200482188,\"displayName\":\"yktz\",\"description\":\"u\",\"isEnabled\":false}") - .toObject(ThresholdCustomAlertRule.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1382683860, model.minThreshold()); - Assertions.assertEquals(1200482188, model.maxThreshold()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ThresholdCustomAlertRule model = - new ThresholdCustomAlertRule() - .withIsEnabled(false) - .withMinThreshold(1382683860) - .withMaxThreshold(1200482188); - model = BinaryData.fromObject(model).toObject(ThresholdCustomAlertRule.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1382683860, model.minThreshold()); - Assertions.assertEquals(1200482188, model.maxThreshold()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TimeWindowCustomAlertRuleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TimeWindowCustomAlertRuleTests.java deleted file mode 100644 index ccde4814428a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TimeWindowCustomAlertRuleTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.TimeWindowCustomAlertRule; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class TimeWindowCustomAlertRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TimeWindowCustomAlertRule model = - BinaryData - .fromString( - "{\"ruleType\":\"TimeWindowCustomAlertRule\",\"timeWindowSize\":\"PT137H35S\",\"minThreshold\":80244831,\"maxThreshold\":925016585,\"displayName\":\"oo\",\"description\":\"xlzevgbmqjqabcy\",\"isEnabled\":true}") - .toObject(TimeWindowCustomAlertRule.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(80244831, model.minThreshold()); - Assertions.assertEquals(925016585, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT137H35S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TimeWindowCustomAlertRule model = - new TimeWindowCustomAlertRule() - .withIsEnabled(true) - .withMinThreshold(80244831) - .withMaxThreshold(925016585) - .withTimeWindowSize(Duration.parse("PT137H35S")); - model = BinaryData.fromObject(model).toObject(TimeWindowCustomAlertRule.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(80244831, model.minThreshold()); - Assertions.assertEquals(925016585, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT137H35S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesGetWithResponseMockTests.java deleted file mode 100644 index 35d234d6d6d7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.TopologyResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TopologiesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"calculatedDateTime\":\"2021-08-30T18:57:53Z\",\"topologyResources\":[]},\"location\":\"dclacroczfmun\",\"id\":\"rkeluxzshxzezbzu\",\"name\":\"udl\",\"type\":\"vzske\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - TopologyResource response = - manager - .topologies() - .getWithResponse("vmuw", "xlniwmcpm", "rdlhvdvmiphbe", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesListByHomeRegionMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesListByHomeRegionMockTests.java deleted file mode 100644 index 4b6459828c6c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesListByHomeRegionMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.TopologyResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TopologiesListByHomeRegionMockTests { - @Test - public void testListByHomeRegion() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"calculatedDateTime\":\"2021-07-06T20:42:46Z\",\"topologyResources\":[]},\"location\":\"henigbeqngubab\",\"id\":\"jdeayscse\",\"name\":\"d\",\"type\":\"jemexmnv\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.topologies().listByHomeRegion("ptgongruat", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesListMockTests.java deleted file mode 100644 index 1287368ad914..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.TopologyResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TopologiesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"calculatedDateTime\":\"2021-05-08T00:20:23Z\",\"topologyResources\":[]},\"location\":\"hpqvcts\",\"id\":\"aeuhwwsknstvz\",\"name\":\"zhasupmlppdpgzvz\",\"type\":\"azvbkar\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.topologies().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyListTests.java deleted file mode 100644 index 25e1bcf5bbb7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.TopologyList; - -public final class TopologyListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopologyList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"calculatedDateTime\":\"2021-03-01T23:44:24Z\",\"topologyResources\":[]},\"location\":\"tuodxeszabbelaw\",\"id\":\"muaslzkw\",\"name\":\"rwoycqucwyh\",\"type\":\"hnomdrkywuh\"},{\"properties\":{\"calculatedDateTime\":\"2021-05-02T07:59:23Z\",\"topologyResources\":[]},\"location\":\"rutlwexxwlalniex\",\"id\":\"srzpgepqtybbww\",\"name\":\"gdakchz\",\"type\":\"vl\"},{\"properties\":{\"calculatedDateTime\":\"2021-05-06T06:22:36Z\",\"topologyResources\":[]},\"location\":\"cxkjibnxmysuxswq\",\"id\":\"ntvlwijpsttexo\",\"name\":\"qpwcyyufmh\",\"type\":\"uncuw\"},{\"properties\":{\"calculatedDateTime\":\"2021-11-18T23:48:24Z\",\"topologyResources\":[]},\"location\":\"dqzh\",\"id\":\"ctddun\",\"name\":\"ndy\",\"type\":\"pchrqbn\"}],\"nextLink\":\"rcgegydcwboxjum\"}") - .toObject(TopologyList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopologyList model = new TopologyList(); - model = BinaryData.fromObject(model).toObject(TopologyList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyResourceInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyResourceInnerTests.java deleted file mode 100644 index ed749716283b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyResourceInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.TopologyResourceInner; - -public final class TopologyResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopologyResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"calculatedDateTime\":\"2021-09-17T20:28:14Z\",\"topologyResources\":[{\"resourceId\":\"r\",\"severity\":\"iouaubrjt\",\"recommendationsExist\":true,\"networkZones\":\"fuojrngif\",\"topologyScore\":193344927,\"location\":\"asccbiui\",\"parents\":[],\"children\":[]},{\"resourceId\":\"yjdfqwmky\",\"severity\":\"ufdvruz\",\"recommendationsExist\":true,\"networkZones\":\"j\",\"topologyScore\":617076882,\"location\":\"fnmdxotn\",\"parents\":[],\"children\":[]},{\"resourceId\":\"ugeyzihgrkyuiza\",\"severity\":\"nmfpp\",\"recommendationsExist\":false,\"networkZones\":\"evy\",\"topologyScore\":1052982888,\"location\":\"gzfc\",\"parents\":[],\"children\":[]}]},\"location\":\"mfg\",\"id\":\"eglqgleohibetn\",\"name\":\"uankrrfxeeeb\",\"type\":\"ij\"}") - .toObject(TopologyResourceInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopologyResourceInner model = new TopologyResourceInner(); - model = BinaryData.fromObject(model).toObject(TopologyResourceInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyResourcePropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyResourcePropertiesTests.java deleted file mode 100644 index 84c62b3758b6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyResourcePropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.TopologyResourceProperties; - -public final class TopologyResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopologyResourceProperties model = - BinaryData - .fromString( - "{\"calculatedDateTime\":\"2020-12-30T06:35:30Z\",\"topologyResources\":[{\"resourceId\":\"qzbqqxlajrnwxa\",\"severity\":\"veh\",\"recommendationsExist\":false,\"networkZones\":\"xoafgaoqltfae\",\"topologyScore\":420432271,\"location\":\"mfgvxirpghriypo\",\"parents\":[],\"children\":[]},{\"resourceId\":\"h\",\"severity\":\"prlpy\",\"recommendationsExist\":false,\"networkZones\":\"iq\",\"topologyScore\":593641633,\"location\":\"xiitdfuxt\",\"parents\":[],\"children\":[]},{\"resourceId\":\"miybnn\",\"severity\":\"tgnljhnmgixhcmav\",\"recommendationsExist\":false,\"networkZones\":\"udorh\",\"topologyScore\":256597525,\"location\":\"prot\",\"parents\":[],\"children\":[]},{\"resourceId\":\"mbxhugcmjkav\",\"severity\":\"or\",\"recommendationsExist\":true,\"networkZones\":\"pmdtz\",\"topologyScore\":1527890487,\"location\":\"fvnz\",\"parents\":[],\"children\":[]}]}") - .toObject(TopologyResourceProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopologyResourceProperties model = new TopologyResourceProperties(); - model = BinaryData.fromObject(model).toObject(TopologyResourceProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceChildTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceChildTests.java deleted file mode 100644 index 3d4f4a528773..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceChildTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.TopologySingleResourceChild; - -public final class TopologySingleResourceChildTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopologySingleResourceChild model = - BinaryData.fromString("{\"resourceId\":\"wxeqocljmygvkzqk\"}").toObject(TopologySingleResourceChild.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopologySingleResourceChild model = new TopologySingleResourceChild(); - model = BinaryData.fromObject(model).toObject(TopologySingleResourceChild.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceParentTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceParentTests.java deleted file mode 100644 index dae0912a3db5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceParentTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.TopologySingleResourceParent; - -public final class TopologySingleResourceParentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopologySingleResourceParent model = - BinaryData.fromString("{\"resourceId\":\"inkfkbgbz\"}").toObject(TopologySingleResourceParent.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopologySingleResourceParent model = new TopologySingleResourceParent(); - model = BinaryData.fromObject(model).toObject(TopologySingleResourceParent.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceTests.java deleted file mode 100644 index 143697e2f7fa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.TopologySingleResource; - -public final class TopologySingleResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopologySingleResource model = - BinaryData - .fromString( - "{\"resourceId\":\"p\",\"severity\":\"pvpbdbzqgqqiheds\",\"recommendationsExist\":false,\"networkZones\":\"hmkyibc\",\"topologyScore\":1158410329,\"location\":\"sgqcwdho\",\"parents\":[{\"resourceId\":\"mcdzsufcohdxbz\"},{\"resourceId\":\"cmuapcvhd\"}],\"children\":[{\"resourceId\":\"qqxeyskon\"}]}") - .toObject(TopologySingleResource.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopologySingleResource model = new TopologySingleResource(); - model = BinaryData.fromObject(model).toObject(TopologySingleResource.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TrackedResourceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TrackedResourceTests.java deleted file mode 100644 index 8cffc9562c84..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TrackedResourceTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.TrackedResource; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TrackedResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TrackedResource model = - BinaryData - .fromString( - "{\"location\":\"rykqgaifmvikl\",\"kind\":\"dvk\",\"etag\":\"ejd\",\"tags\":{\"volvtn\":\"cvdsrhnj\"},\"id\":\"v\",\"name\":\"fzg\",\"type\":\"mjdftu\"}") - .toObject(TrackedResource.class); - Assertions.assertEquals("rykqgaifmvikl", model.location()); - Assertions.assertEquals("dvk", model.kind()); - Assertions.assertEquals("ejd", model.etag()); - Assertions.assertEquals("cvdsrhnj", model.tags().get("volvtn")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TrackedResource model = - new TrackedResource() - .withLocation("rykqgaifmvikl") - .withKind("dvk") - .withEtag("ejd") - .withTags(mapOf("volvtn", "cvdsrhnj")); - model = BinaryData.fromObject(model).toObject(TrackedResource.class); - Assertions.assertEquals("rykqgaifmvikl", model.location()); - Assertions.assertEquals("dvk", model.kind()); - Assertions.assertEquals("ejd", model.etag()); - Assertions.assertEquals("cvdsrhnj", model.tags().get("volvtn")); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TwinUpdatesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TwinUpdatesNotInAllowedRangeTests.java deleted file mode 100644 index 08890053d5e6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TwinUpdatesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.TwinUpdatesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class TwinUpdatesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TwinUpdatesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"TwinUpdatesNotInAllowedRange\",\"timeWindowSize\":\"PT111H16M9S\",\"minThreshold\":2122337466,\"maxThreshold\":634264746,\"displayName\":\"ntrpcaqkiof\",\"description\":\"tfmhklbnldpvcb\",\"isEnabled\":false}") - .toObject(TwinUpdatesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(2122337466, model.minThreshold()); - Assertions.assertEquals(634264746, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT111H16M9S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TwinUpdatesNotInAllowedRange model = - new TwinUpdatesNotInAllowedRange() - .withIsEnabled(false) - .withMinThreshold(2122337466) - .withMaxThreshold(634264746) - .withTimeWindowSize(Duration.parse("PT111H16M9S")); - model = BinaryData.fromObject(model).toObject(TwinUpdatesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(2122337466, model.minThreshold()); - Assertions.assertEquals(634264746, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT111H16M9S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UnauthorizedOperationsNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UnauthorizedOperationsNotInAllowedRangeTests.java deleted file mode 100644 index bababf25f422..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UnauthorizedOperationsNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.UnauthorizedOperationsNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class UnauthorizedOperationsNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UnauthorizedOperationsNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"UnauthorizedOperationsNotInAllowedRange\",\"timeWindowSize\":\"PT231H33M53S\",\"minThreshold\":1033707853,\"maxThreshold\":395818123,\"displayName\":\"u\",\"description\":\"sqxutr\",\"isEnabled\":true}") - .toObject(UnauthorizedOperationsNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1033707853, model.minThreshold()); - Assertions.assertEquals(395818123, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT231H33M53S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UnauthorizedOperationsNotInAllowedRange model = - new UnauthorizedOperationsNotInAllowedRange() - .withIsEnabled(true) - .withMinThreshold(1033707853) - .withMaxThreshold(395818123) - .withTimeWindowSize(Duration.parse("PT231H33M53S")); - model = BinaryData.fromObject(model).toObject(UnauthorizedOperationsNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1033707853, model.minThreshold()); - Assertions.assertEquals(395818123, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT231H33M53S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UpdateIoTSecuritySolutionPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UpdateIoTSecuritySolutionPropertiesTests.java deleted file mode 100644 index 57d80398cf96..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UpdateIoTSecuritySolutionPropertiesTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.UpdateIoTSecuritySolutionProperties; -import com.azure.resourcemanager.security.models.RecommendationConfigStatus; -import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.RecommendationType; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UpdateIoTSecuritySolutionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateIoTSecuritySolutionProperties model = - BinaryData - .fromString( - "{\"userDefinedResources\":{\"query\":\"xdbabphlwr\",\"querySubscriptions\":[\"fkts\",\"hsucoc\"]},\"recommendationsConfiguration\":[{\"recommendationType\":\"IoT_PrivilegedDockerOptions\",\"name\":\"zt\",\"status\":\"Disabled\"},{\"recommendationType\":\"IoT_InconsistentModuleSettings\",\"name\":\"wrqpue\",\"status\":\"Enabled\"}]}") - .toObject(UpdateIoTSecuritySolutionProperties.class); - Assertions.assertEquals("xdbabphlwr", model.userDefinedResources().query()); - Assertions.assertEquals("fkts", model.userDefinedResources().querySubscriptions().get(0)); - Assertions - .assertEquals( - RecommendationType.IO_T_PRIVILEGED_DOCKER_OPTIONS, - model.recommendationsConfiguration().get(0).recommendationType()); - Assertions - .assertEquals(RecommendationConfigStatus.DISABLED, model.recommendationsConfiguration().get(0).status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateIoTSecuritySolutionProperties model = - new UpdateIoTSecuritySolutionProperties() - .withUserDefinedResources( - new UserDefinedResourcesProperties() - .withQuery("xdbabphlwr") - .withQuerySubscriptions(Arrays.asList("fkts", "hsucoc"))) - .withRecommendationsConfiguration( - Arrays - .asList( - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_PRIVILEGED_DOCKER_OPTIONS) - .withStatus(RecommendationConfigStatus.DISABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_INCONSISTENT_MODULE_SETTINGS) - .withStatus(RecommendationConfigStatus.ENABLED))); - model = BinaryData.fromObject(model).toObject(UpdateIoTSecuritySolutionProperties.class); - Assertions.assertEquals("xdbabphlwr", model.userDefinedResources().query()); - Assertions.assertEquals("fkts", model.userDefinedResources().querySubscriptions().get(0)); - Assertions - .assertEquals( - RecommendationType.IO_T_PRIVILEGED_DOCKER_OPTIONS, - model.recommendationsConfiguration().get(0).recommendationType()); - Assertions - .assertEquals(RecommendationConfigStatus.DISABLED, model.recommendationsConfiguration().get(0).status()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UpdateIotSecuritySolutionDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UpdateIotSecuritySolutionDataTests.java deleted file mode 100644 index 75a581c136e3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UpdateIotSecuritySolutionDataTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.RecommendationConfigStatus; -import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.RecommendationType; -import com.azure.resourcemanager.security.models.UpdateIotSecuritySolutionData; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class UpdateIotSecuritySolutionDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateIotSecuritySolutionData model = - BinaryData - .fromString( - "{\"properties\":{\"userDefinedResources\":{\"query\":\"cxgod\",\"querySubscriptions\":[\"fqkkr\",\"mpukgriw\"]},\"recommendationsConfiguration\":[{\"recommendationType\":\"IoT_PermissiveOutputFirewallRules\",\"name\":\"bxzpuzycisp\",\"status\":\"Enabled\"},{\"recommendationType\":\"IoT_VulnerableTLSCipherSuite\",\"name\":\"hmgkbrpyy\",\"status\":\"Enabled\"},{\"recommendationType\":\"IoT_OpenPorts\",\"name\":\"nuqqkpikadrgvt\",\"status\":\"Disabled\"},{\"recommendationType\":\"IoT_EdgeLoggingOptions\",\"name\":\"buynhijggm\",\"status\":\"Disabled\"}]},\"tags\":{\"zmhjrunmp\":\"iarbutrcvpna\",\"nkxmyskpbhenbtk\":\"ttdbhrbnl\",\"yxczfclh\":\"xywnytnrsynlqidy\"}}") - .toObject(UpdateIotSecuritySolutionData.class); - Assertions.assertEquals("iarbutrcvpna", model.tags().get("zmhjrunmp")); - Assertions.assertEquals("cxgod", model.userDefinedResources().query()); - Assertions.assertEquals("fqkkr", model.userDefinedResources().querySubscriptions().get(0)); - Assertions - .assertEquals( - RecommendationType.IO_T_PERMISSIVE_OUTPUT_FIREWALL_RULES, - model.recommendationsConfiguration().get(0).recommendationType()); - Assertions - .assertEquals(RecommendationConfigStatus.ENABLED, model.recommendationsConfiguration().get(0).status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateIotSecuritySolutionData model = - new UpdateIotSecuritySolutionData() - .withTags( - mapOf("zmhjrunmp", "iarbutrcvpna", "nkxmyskpbhenbtk", "ttdbhrbnl", "yxczfclh", "xywnytnrsynlqidy")) - .withUserDefinedResources( - new UserDefinedResourcesProperties() - .withQuery("cxgod") - .withQuerySubscriptions(Arrays.asList("fqkkr", "mpukgriw"))) - .withRecommendationsConfiguration( - Arrays - .asList( - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_PERMISSIVE_OUTPUT_FIREWALL_RULES) - .withStatus(RecommendationConfigStatus.ENABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_VULNERABLE_TLSCIPHER_SUITE) - .withStatus(RecommendationConfigStatus.ENABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_OPEN_PORTS) - .withStatus(RecommendationConfigStatus.DISABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_EDGE_LOGGING_OPTIONS) - .withStatus(RecommendationConfigStatus.DISABLED))); - model = BinaryData.fromObject(model).toObject(UpdateIotSecuritySolutionData.class); - Assertions.assertEquals("iarbutrcvpna", model.tags().get("zmhjrunmp")); - Assertions.assertEquals("cxgod", model.userDefinedResources().query()); - Assertions.assertEquals("fqkkr", model.userDefinedResources().querySubscriptions().get(0)); - Assertions - .assertEquals( - RecommendationType.IO_T_PERMISSIVE_OUTPUT_FIREWALL_RULES, - model.recommendationsConfiguration().get(0).recommendationType()); - Assertions - .assertEquals(RecommendationConfigStatus.ENABLED, model.recommendationsConfiguration().get(0).status()); - } - - @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/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UserDefinedResourcesPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UserDefinedResourcesPropertiesTests.java deleted file mode 100644 index 46cdd8de9e60..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UserDefinedResourcesPropertiesTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UserDefinedResourcesPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserDefinedResourcesProperties model = - BinaryData - .fromString( - "{\"query\":\"lqdqgbiqylihka\",\"querySubscriptions\":[\"cktvfcivfsnkymuc\",\"qhjfbebr\",\"cxerf\",\"wutttxfvjrbi\"]}") - .toObject(UserDefinedResourcesProperties.class); - Assertions.assertEquals("lqdqgbiqylihka", model.query()); - Assertions.assertEquals("cktvfcivfsnkymuc", model.querySubscriptions().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserDefinedResourcesProperties model = - new UserDefinedResourcesProperties() - .withQuery("lqdqgbiqylihka") - .withQuerySubscriptions(Arrays.asList("cktvfcivfsnkymuc", "qhjfbebr", "cxerf", "wutttxfvjrbi")); - model = BinaryData.fromObject(model).toObject(UserDefinedResourcesProperties.class); - Assertions.assertEquals("lqdqgbiqylihka", model.query()); - Assertions.assertEquals("cktvfcivfsnkymuc", model.querySubscriptions().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UserRecommendationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UserRecommendationTests.java deleted file mode 100644 index abb76e3d819a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UserRecommendationTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.RecommendationAction; -import com.azure.resourcemanager.security.models.UserRecommendation; -import org.junit.jupiter.api.Assertions; - -public final class UserRecommendationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserRecommendation model = - BinaryData - .fromString("{\"username\":\"iv\",\"recommendationAction\":\"Remove\"}") - .toObject(UserRecommendation.class); - Assertions.assertEquals("iv", model.username()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.recommendationAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserRecommendation model = - new UserRecommendation().withUsername("iv").withRecommendationAction(RecommendationAction.REMOVE); - model = BinaryData.fromObject(model).toObject(UserRecommendation.class); - Assertions.assertEquals("iv", model.username()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.recommendationAction()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VaRuleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VaRuleTests.java deleted file mode 100644 index 0421aa4e967c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VaRuleTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.BenchmarkReference; -import com.azure.resourcemanager.security.models.QueryCheck; -import com.azure.resourcemanager.security.models.RuleSeverity; -import com.azure.resourcemanager.security.models.RuleType; -import com.azure.resourcemanager.security.models.VaRule; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VaRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VaRule model = - BinaryData - .fromString( - "{\"ruleId\":\"knaqlnuwig\",\"severity\":\"Low\",\"category\":\"ykwphvxzcwxhmpe\",\"ruleType\":\"NegativeList\",\"title\":\"exaonwivkcq\",\"description\":\"xhxknlc\",\"rationale\":\"mmkyu\",\"queryCheck\":{\"query\":\"ubyqj\",\"expectedResult\":[[\"fqfrkemyildudxja\"],[\"owvfdjkpdxph\",\"kk\",\"nmgzvyfijdkzuqnw\"],[\"thuqolyahluq\"],[\"ulsutrjbhxy\",\"fhyqezvqqugdrft\",\"cvexreuqu\",\"wtl\"]],\"columnNames\":[\"whreagkhyxvrq\",\"vbczsulmdg\",\"lmepjpf\"]},\"benchmarkReferences\":[{\"benchmark\":\"g\",\"reference\":\"ngpszngafpg\"},{\"benchmark\":\"kvec\",\"reference\":\"jcngoadyed\"},{\"benchmark\":\"rgjfoknubnoi\",\"reference\":\"kpztrgd\"}]}") - .toObject(VaRule.class); - Assertions.assertEquals("knaqlnuwig", model.ruleId()); - Assertions.assertEquals(RuleSeverity.LOW, model.severity()); - Assertions.assertEquals("ykwphvxzcwxhmpe", model.category()); - Assertions.assertEquals(RuleType.NEGATIVE_LIST, model.ruleType()); - Assertions.assertEquals("exaonwivkcq", model.title()); - Assertions.assertEquals("xhxknlc", model.description()); - Assertions.assertEquals("mmkyu", model.rationale()); - Assertions.assertEquals("ubyqj", model.queryCheck().query()); - Assertions.assertEquals("fqfrkemyildudxja", model.queryCheck().expectedResult().get(0).get(0)); - Assertions.assertEquals("whreagkhyxvrq", model.queryCheck().columnNames().get(0)); - Assertions.assertEquals("g", model.benchmarkReferences().get(0).benchmark()); - Assertions.assertEquals("ngpszngafpg", model.benchmarkReferences().get(0).reference()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VaRule model = - new VaRule() - .withRuleId("knaqlnuwig") - .withSeverity(RuleSeverity.LOW) - .withCategory("ykwphvxzcwxhmpe") - .withRuleType(RuleType.NEGATIVE_LIST) - .withTitle("exaonwivkcq") - .withDescription("xhxknlc") - .withRationale("mmkyu") - .withQueryCheck( - new QueryCheck() - .withQuery("ubyqj") - .withExpectedResult( - Arrays - .asList( - Arrays.asList("fqfrkemyildudxja"), - Arrays.asList("owvfdjkpdxph", "kk", "nmgzvyfijdkzuqnw"), - Arrays.asList("thuqolyahluq"), - Arrays.asList("ulsutrjbhxy", "fhyqezvqqugdrft", "cvexreuqu", "wtl"))) - .withColumnNames(Arrays.asList("whreagkhyxvrq", "vbczsulmdg", "lmepjpf"))) - .withBenchmarkReferences( - Arrays - .asList( - new BenchmarkReference().withBenchmark("g").withReference("ngpszngafpg"), - new BenchmarkReference().withBenchmark("kvec").withReference("jcngoadyed"), - new BenchmarkReference().withBenchmark("rgjfoknubnoi").withReference("kpztrgd"))); - model = BinaryData.fromObject(model).toObject(VaRule.class); - Assertions.assertEquals("knaqlnuwig", model.ruleId()); - Assertions.assertEquals(RuleSeverity.LOW, model.severity()); - Assertions.assertEquals("ykwphvxzcwxhmpe", model.category()); - Assertions.assertEquals(RuleType.NEGATIVE_LIST, model.ruleType()); - Assertions.assertEquals("exaonwivkcq", model.title()); - Assertions.assertEquals("xhxknlc", model.description()); - Assertions.assertEquals("mmkyu", model.rationale()); - Assertions.assertEquals("ubyqj", model.queryCheck().query()); - Assertions.assertEquals("fqfrkemyildudxja", model.queryCheck().expectedResult().get(0).get(0)); - Assertions.assertEquals("whreagkhyxvrq", model.queryCheck().columnNames().get(0)); - Assertions.assertEquals("g", model.benchmarkReferences().get(0).benchmark()); - Assertions.assertEquals("ngpszngafpg", model.benchmarkReferences().get(0).reference()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VendorReferenceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VendorReferenceTests.java deleted file mode 100644 index 94a4ee055518..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VendorReferenceTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.VendorReference; - -public final class VendorReferenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VendorReference model = - BinaryData.fromString("{\"title\":\"vgjcodkkg\",\"link\":\"iytssikizbc\"}").toObject(VendorReference.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VendorReference model = new VendorReference(); - model = BinaryData.fromObject(model).toObject(VendorReference.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VmRecommendationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VmRecommendationTests.java deleted file mode 100644 index d4bec69cb11a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VmRecommendationTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ConfigurationStatus; -import com.azure.resourcemanager.security.models.EnforcementSupport; -import com.azure.resourcemanager.security.models.RecommendationAction; -import com.azure.resourcemanager.security.models.VmRecommendation; -import org.junit.jupiter.api.Assertions; - -public final class VmRecommendationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VmRecommendation model = - BinaryData - .fromString( - "{\"configurationStatus\":\"Configured\",\"recommendationAction\":\"Remove\",\"resourceId\":\"euvyinzqodfvpgs\",\"enforcementSupport\":\"NotSupported\"}") - .toObject(VmRecommendation.class); - Assertions.assertEquals(ConfigurationStatus.CONFIGURED, model.configurationStatus()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.recommendationAction()); - Assertions.assertEquals("euvyinzqodfvpgs", model.resourceId()); - Assertions.assertEquals(EnforcementSupport.NOT_SUPPORTED, model.enforcementSupport()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VmRecommendation model = - new VmRecommendation() - .withConfigurationStatus(ConfigurationStatus.CONFIGURED) - .withRecommendationAction(RecommendationAction.REMOVE) - .withResourceId("euvyinzqodfvpgs") - .withEnforcementSupport(EnforcementSupport.NOT_SUPPORTED); - model = BinaryData.fromObject(model).toObject(VmRecommendation.class); - Assertions.assertEquals(ConfigurationStatus.CONFIGURED, model.configurationStatus()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.recommendationAction()); - Assertions.assertEquals("euvyinzqodfvpgs", model.resourceId()); - Assertions.assertEquals(EnforcementSupport.NOT_SUPPORTED, model.enforcementSupport()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingInnerTests.java deleted file mode 100644 index 6ca716b83905..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingInnerTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.WorkspaceSettingInner; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceSettingInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceSettingInner model = - BinaryData - .fromString( - "{\"properties\":{\"workspaceId\":\"fgbvfvpdbo\",\"scope\":\"acizsjqlhkrr\"},\"id\":\"bdeibqipqk\",\"name\":\"hvxndzwmkrefajpj\",\"type\":\"rwkq\"}") - .toObject(WorkspaceSettingInner.class); - Assertions.assertEquals("fgbvfvpdbo", model.workspaceId()); - Assertions.assertEquals("acizsjqlhkrr", model.scope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceSettingInner model = - new WorkspaceSettingInner().withWorkspaceId("fgbvfvpdbo").withScope("acizsjqlhkrr"); - model = BinaryData.fromObject(model).toObject(WorkspaceSettingInner.class); - Assertions.assertEquals("fgbvfvpdbo", model.workspaceId()); - Assertions.assertEquals("acizsjqlhkrr", model.scope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingListTests.java deleted file mode 100644 index b7a826ba15b6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingListTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.WorkspaceSettingInner; -import com.azure.resourcemanager.security.models.WorkspaceSettingList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceSettingListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceSettingList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"workspaceId\":\"pv\",\"scope\":\"srp\"},\"id\":\"vu\",\"name\":\"zraehtwd\",\"type\":\"r\"},{\"properties\":{\"workspaceId\":\"swibyr\",\"scope\":\"dl\"},\"id\":\"h\",\"name\":\"hfwpracstwit\",\"type\":\"khevxccedc\"},{\"properties\":{\"workspaceId\":\"md\",\"scope\":\"odn\"},\"id\":\"zxltjcvn\",\"name\":\"ltiugcxnavv\",\"type\":\"xqi\"}],\"nextLink\":\"qunyowxwlmdjr\"}") - .toObject(WorkspaceSettingList.class); - Assertions.assertEquals("pv", model.value().get(0).workspaceId()); - Assertions.assertEquals("srp", model.value().get(0).scope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceSettingList model = - new WorkspaceSettingList() - .withValue( - Arrays - .asList( - new WorkspaceSettingInner().withWorkspaceId("pv").withScope("srp"), - new WorkspaceSettingInner().withWorkspaceId("swibyr").withScope("dl"), - new WorkspaceSettingInner().withWorkspaceId("md").withScope("odn"))); - model = BinaryData.fromObject(model).toObject(WorkspaceSettingList.class); - Assertions.assertEquals("pv", model.value().get(0).workspaceId()); - Assertions.assertEquals("srp", model.value().get(0).scope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingPropertiesTests.java deleted file mode 100644 index 25a68a0b242d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.WorkspaceSettingProperties; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceSettingPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceSettingProperties model = - BinaryData - .fromString("{\"workspaceId\":\"yhgbijtjivfx\",\"scope\":\"sjabibs\"}") - .toObject(WorkspaceSettingProperties.class); - Assertions.assertEquals("yhgbijtjivfx", model.workspaceId()); - Assertions.assertEquals("sjabibs", model.scope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceSettingProperties model = - new WorkspaceSettingProperties().withWorkspaceId("yhgbijtjivfx").withScope("sjabibs"); - model = BinaryData.fromObject(model).toObject(WorkspaceSettingProperties.class); - Assertions.assertEquals("yhgbijtjivfx", model.workspaceId()); - Assertions.assertEquals("sjabibs", model.scope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsCreateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsCreateWithResponseMockTests.java deleted file mode 100644 index 129bd2d29e50..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsCreateWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.WorkspaceSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspaceSettingsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"workspaceId\":\"pu\",\"scope\":\"zfe\"},\"id\":\"zjljmphfk\",\"name\":\"ezolgjzm\",\"type\":\"cuydoccnxshanz\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - WorkspaceSetting response = - manager - .workspaceSettings() - .define("aciq") - .withWorkspaceId("jrlhiqlwixvtboug") - .withScope("xtndopgjttbasua") - .create(); - - Assertions.assertEquals("pu", response.workspaceId()); - Assertions.assertEquals("zfe", response.scope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsDeleteWithResponseMockTests.java deleted file mode 100644 index a7e527344cbc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspaceSettingsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.workspaceSettings().deleteWithResponse("zvdajfwnncf", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetWithResponseMockTests.java deleted file mode 100644 index 54afbfaa0002..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.WorkspaceSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspaceSettingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"workspaceId\":\"dfj\",\"scope\":\"i\"},\"id\":\"socwiqbuout\",\"name\":\"py\",\"type\":\"gleofjsbgbw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - WorkspaceSetting response = - manager.workspaceSettings().getWithResponse("eaqgrvgpomxpupd", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("dfj", response.workspaceId()); - Assertions.assertEquals("i", response.scope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListMockTests.java deleted file mode 100644 index 63dac69d660d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.WorkspaceSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspaceSettingsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"workspaceId\":\"kahpqhazynta\",\"scope\":\"ihnco\"},\"id\":\"mip\",\"name\":\"mliqmvlb\",\"type\":\"i\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.workspaceSettings().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("kahpqhazynta", response.iterator().next().workspaceId()); - Assertions.assertEquals("ihnco", response.iterator().next().scope()); - } -}