From 6c7af74f688c9ba870f39d677a337be07d85c0be Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 16 Dec 2021 06:38:46 +0000 Subject: [PATCH] CodeGen from PR 17107 in Azure/azure-rest-api-specs Merge 3a346e90635dcaccb1532c364fa02fdcbe905870 into d600759c3516b61a7c353bc8682bccbab85a6f65 --- .../CHANGELOG.md | 3 +- .../azure-resourcemanager-security/README.md | 2 +- .../azure-resourcemanager-security/SAMPLE.md | 5709 ++++++++++++++++- .../security/SecurityManager.java | 201 +- .../AdaptiveNetworkHardeningsClient.java | 4 +- .../security/fluent/AlertsClient.java | 4 +- .../security/fluent/AssessmentsClient.java | 23 +- .../fluent/AssessmentsMetadatasClient.java | 30 +- .../CustomAssessmentAutomationsClient.java | 163 + .../CustomEntityStoreAssignmentsClient.java | 163 + .../security/fluent/DevicesClient.java | 41 - .../security/fluent/DevicesForHubsClient.java | 44 - .../fluent/DevicesForSubscriptionsClient.java | 41 - .../security/fluent/IotAlertsClient.java | 88 - .../fluent/IotDefenderSettingsClient.java | 153 - .../fluent/IotRecommendationTypesClient.java | 62 - .../fluent/IotRecommendationsClient.java | 76 - .../security/fluent/IotSensorsClient.java | 209 - .../security/fluent/IotSitesClient.java | 117 - ...sClient.java => MdeOnboardingsClient.java} | 35 +- .../fluent/OnPremiseIotSensorsClient.java | 167 - .../security/fluent/OperationsClient.java | 4 +- .../security/fluent/SecurityCenter.java | 105 +- .../fluent/SecurityConnectorsClient.java | 200 + .../ServerVulnerabilityAssessmentsClient.java | 4 +- .../AdaptiveApplicationControlGroupData.java | 215 + .../AdaptiveApplicationControlGroupInner.java | 135 +- .../models/AdaptiveNetworkHardeningInner.java | 56 +- .../AdaptiveNetworkHardeningProperties.java | 116 + .../AdvancedThreatProtectionProperties.java | 50 + .../AdvancedThreatProtectionSettingInner.java | 29 +- .../security/fluent/models/AlertInner.java | 218 +- .../fluent/models/AlertProperties.java | 419 ++ ...r.java => AlertSyncSettingProperties.java} | 34 +- .../models/AlertsSuppressionRuleInner.java | 101 +- .../AlertsSuppressionRuleProperties.java | 223 + .../AllowedConnectionsResourceInner.java | 51 +- .../AllowedConnectionsResourceProperties.java | 60 + .../models/AutoProvisioningSettingInner.java | 29 +- .../AutoProvisioningSettingProperties.java | 57 + .../fluent/models/AutomationInner.java | 113 +- .../fluent/models/AutomationProperties.java | 183 + .../fluent/models/ComplianceInner.java | 43 +- .../fluent/models/ComplianceProperties.java | 82 + .../fluent/models/ComplianceResultInner.java | 28 +- ...r.java => ComplianceResultProperties.java} | 25 +- .../fluent/models/ConnectorSettingInner.java | 44 +- .../models/ConnectorSettingProperties.java | 90 + .../CustomAssessmentAutomationInner.java | 229 + .../CustomAssessmentAutomationProperties.java | 220 + ...AssessmentAutomationRequestProperties.java | 193 + .../CustomEntityStoreAssignmentInner.java | 108 + ...CustomEntityStoreAssignmentProperties.java | 79 + ...ntityStoreAssignmentRequestProperties.java | 55 + .../models/DataExportSettingProperties.java | 50 + .../security/fluent/models/DeviceInner.java | 493 -- .../models/DeviceSecurityGroupInner.java | 74 +- .../models/DeviceSecurityGroupProperties.java | 145 + .../DiscoveredSecuritySolutionInner.java | 105 +- .../DiscoveredSecuritySolutionProperties.java | 153 + .../InformationProtectionPolicyInner.java | 72 +- ...InformationProtectionPolicyProperties.java | 133 + .../IoTSecurityAggregatedAlertInner.java | 158 +- .../IoTSecurityAggregatedAlertProperties.java | 228 + ...SecurityAggregatedRecommendationInner.java | 137 +- ...ityAggregatedRecommendationProperties.java | 187 + ...oTSecuritySolutionAnalyticsModelInner.java | 88 +- ...uritySolutionAnalyticsModelProperties.java | 171 + .../models/IoTSecuritySolutionModelInner.java | 211 +- .../models/IoTSecuritySolutionProperties.java | 333 + .../fluent/models/IotAlertModelInner.java | 161 - .../fluent/models/IotAlertTypeInner.java | 167 - .../models/IotDefenderSettingsListInner.java | 43 - .../models/IotDefenderSettingsModelInner.java | 126 - .../models/IotRecommendationModelInner.java | 98 - .../models/IotRecommendationTypeInner.java | 166 - .../fluent/models/IotSensorsModelInner.java | 228 - .../fluent/models/IotSitesListInner.java | 43 - .../fluent/models/IotSitesModelInner.java | 80 - .../models/JitNetworkAccessPolicyInner.java | 114 +- .../JitNetworkAccessPolicyProperties.java | 105 + .../fluent/models/MdeOnboardingDataInner.java | 95 + ...r.java => MdeOnboardingDataListInner.java} | 21 +- .../models/MdeOnboardingDataProperties.java | 85 + .../models/OnPremiseIotSensorInner.java | 51 - .../models/OnPremiseIotSensorsListInner.java | 43 - .../fluent/models/PackageDownloadsInner.java | 154 - .../security/fluent/models/PricingInner.java | 37 +- .../fluent/models/PricingProperties.java | 81 + .../RegulatoryComplianceAssessmentInner.java | 82 +- ...ulatoryComplianceAssessmentProperties.java | 158 + .../RegulatoryComplianceControlInner.java | 60 +- ...RegulatoryComplianceControlProperties.java | 117 + .../RegulatoryComplianceStandardInner.java | 61 +- ...egulatoryComplianceStandardProperties.java | 119 + .../security/fluent/models/ScoreDetails.java | 71 + ...SecureScoreControlDefinitionItemInner.java | 61 +- ...eScoreControlDefinitionItemProperties.java | 110 + .../SecureScoreControlDetailsInner.java | 93 +- .../SecureScoreControlScoreDetailsInner.java | 177 + .../fluent/models/SecureScoreItemInner.java | 54 +- .../models/SecureScoreItemProperties.java | 102 + .../SecurityAssessmentMetadataInner.java | 347 - .../SecurityAssessmentMetadataProperties.java | 11 +- ...yAssessmentMetadataPropertiesResponse.java | 225 + ...curityAssessmentMetadataResponseInner.java | 414 ++ .../models/SecurityAssessmentProperties.java | 93 + .../SecurityAssessmentPropertiesResponse.java | 93 + .../SecurityAssessmentResponseInner.java | 181 + .../fluent/models/SecurityConnectorInner.java | 172 + .../models/SecurityConnectorProperties.java | 140 + .../fluent/models/SecurityContactInner.java | 64 +- .../models/SecurityContactProperties.java | 147 + .../fluent/models/SecuritySolutionInner.java | 84 +- .../models/SecuritySolutionProperties.java | 154 + ...uritySolutionsReferenceDataProperties.java | 250 + .../models/SecuritySubAssessmentInner.java | 118 +- .../SecuritySubAssessmentProperties.java | 220 + .../fluent/models/SecurityTaskInner.java | 59 +- .../fluent/models/SecurityTaskProperties.java | 118 + .../ServerVulnerabilityAssessmentInner.java | 29 +- ...rverVulnerabilityAssessmentProperties.java | 41 + .../security/fluent/models/SoftwareInner.java | 133 +- .../fluent/models/SoftwareProperties.java | 259 + .../fluent/models/TopologyResourceInner.java | 51 +- .../models/TopologyResourceProperties.java | 60 + .../UpdateIoTSecuritySolutionProperties.java | 87 + .../fluent/models/WorkspaceSettingInner.java | 39 +- .../models/WorkspaceSettingProperties.java | 91 + .../AdaptiveApplicationControlGroupImpl.java | 8 +- .../AdaptiveApplicationControlsImpl.java | 2 +- .../AdaptiveNetworkHardeningsClientImpl.java | 11 +- .../implementation/AlertsClientImpl.java | 11 +- .../AllowedConnectionsResourceImpl.java | 8 +- .../implementation/AssessmentsClientImpl.java | 95 +- .../implementation/AssessmentsImpl.java | 38 +- .../AssessmentsMetadatasClientImpl.java | 143 +- .../AssessmentsMetadatasImpl.java | 63 +- .../implementation/AutomationsImpl.java | 2 +- .../implementation/ConnectorsImpl.java | 2 +- .../CustomAssessmentAutomationImpl.java | 172 + ...CustomAssessmentAutomationsClientImpl.java | 1139 ++++ .../CustomAssessmentAutomationsImpl.java | 196 + .../CustomEntityStoreAssignmentImpl.java | 128 + ...ustomEntityStoreAssignmentsClientImpl.java | 1135 ++++ .../CustomEntityStoreAssignmentsImpl.java | 196 + .../security/implementation/DeviceImpl.java | 170 - .../DeviceSecurityGroupsImpl.java | 2 +- .../implementation/DevicesClientImpl.java | 185 - .../DevicesForHubsClientImpl.java | 354 - .../implementation/DevicesForHubsImpl.java | 49 - .../DevicesForSubscriptionsClientImpl.java | 351 - .../DevicesForSubscriptionsImpl.java | 48 - .../security/implementation/DevicesImpl.java | 58 - .../DiscoveredSecuritySolutionImpl.java | 8 +- .../implementation/IngestionSettingsImpl.java | 2 +- .../IoTSecurityAggregatedAlertImpl.java | 18 +- ...TSecurityAggregatedRecommendationImpl.java | 18 +- .../IoTSecuritySolutionModelImpl.java | 18 +- .../implementation/IotAlertModelImpl.java | 75 - .../implementation/IotAlertTypeImpl.java | 84 - .../implementation/IotAlertTypesImpl.java | 83 - .../implementation/IotAlertsClientImpl.java | 620 -- .../implementation/IotAlertsImpl.java | 92 - .../IotDefenderSettingsClientImpl.java | 819 --- .../IotDefenderSettingsImpl.java | 149 - .../IotDefenderSettingsListImpl.java | 47 - .../IotDefenderSettingsModelImpl.java | 65 - .../IotRecommendationModelImpl.java | 56 - .../IotRecommendationTypeImpl.java | 84 - .../IotRecommendationTypeListImpl.java | 47 - .../IotRecommendationTypesClientImpl.java | 330 - .../IotRecommendationTypesImpl.java | 84 - .../IotRecommendationsClientImpl.java | 509 -- .../IotRecommendationsImpl.java | 73 - .../IotSecuritySolutionsImpl.java | 2 +- .../implementation/IotSensorsClientImpl.java | 1026 --- .../implementation/IotSensorsImpl.java | 219 - .../implementation/IotSensorsListImpl.java | 47 - .../implementation/IotSensorsModelImpl.java | 216 - .../implementation/IotSitesClientImpl.java | 537 -- .../security/implementation/IotSitesImpl.java | 114 - .../implementation/IotSitesListImpl.java | 46 - .../implementation/IotSitesModelImpl.java | 55 - .../JitNetworkAccessPoliciesImpl.java | 2 +- .../JitNetworkAccessPolicyImpl.java | 24 +- ...orImpl.java => MdeOnboardingDataImpl.java} | 22 +- ...pl.java => MdeOnboardingDataListImpl.java} | 24 +- ...mpl.java => MdeOnboardingsClientImpl.java} | 146 +- .../implementation/MdeOnboardingsImpl.java | 83 + .../OnPremiseIotSensorsClientImpl.java | 971 --- .../OnPremiseIotSensorsImpl.java | 134 - .../OnPremiseIotSensorsListImpl.java | 47 - .../implementation/OperationsClientImpl.java | 16 +- .../implementation/PackageDownloadsImpl.java | 86 - .../SecureScoreControlScoreDetailsImpl.java | 72 + ...curityAssessmentMetadataResponseImpl.java} | 101 +- ...va => SecurityAssessmentResponseImpl.java} | 120 +- .../implementation/SecurityCenterImpl.java | 210 +- .../implementation/SecurityConnectorImpl.java | 213 + .../SecurityConnectorsClientImpl.java | 1315 ++++ .../SecurityConnectorsImpl.java | 180 + .../implementation/SecurityContactsImpl.java | 2 +- .../implementation/SecuritySolutionImpl.java | 8 +- ...verVulnerabilityAssessmentsClientImpl.java | 11 +- .../implementation/SettingsClientImpl.java | 12 +- .../implementation/TopologyResourceImpl.java | 8 +- .../implementation/WorkspaceSettingsImpl.java | 2 +- .../security/models/AadConnectivityState.java | 53 +- .../AadConnectivityStateAutoGenerated.java | 50 + .../models/AadConnectivityStateValue.java | 37 - .../models/AadSolutionProperties.java | 6 +- .../AdaptiveApplicationControlGroup.java | 14 +- .../security/models/AlertIntent.java | 76 - .../security/models/AlertSyncSettings.java | 30 +- .../models/AllowedConnectionsResource.java | 14 +- .../security/models/AssessmentStatus.java | 2 +- .../models/AssessmentStatusResponse.java | 82 + .../security/models/Assessments.java | 18 +- .../security/models/AssessmentsMetadatas.java | 27 +- .../security/models/AuthorizationState.java | 34 - .../security/models/CloudErrorBody.java | 106 - .../security/models/CloudName.java | 37 + .../security/models/CloudOffering.java | 53 + ...tainerRegistryVulnerabilityProperties.java | 2 + .../models/CspmMonitorAwsOffering.java | 60 + ...nitorAwsOfferingNativeCloudConnection.java | 50 + .../models/CustomAssessmentAutomation.java | 228 + .../CustomAssessmentAutomationRequest.java | 188 + .../models/CustomAssessmentAutomations.java | 164 + ...CustomAssessmentAutomationsListResult.java | 70 + .../models/CustomEntityStoreAssignment.java | 130 + .../CustomEntityStoreAssignmentRequest.java | 68 + .../models/CustomEntityStoreAssignments.java | 165 + ...ustomEntityStoreAssignmentsListResult.java | 70 + .../security/models/DataExportSettings.java | 30 +- .../DefenderForContainersAwsOffering.java | 149 + ...tainersAwsOfferingCloudWatchToKinesis.java | 51 + ...erForContainersAwsOfferingKinesisToS3.java | 50 + ...inersAwsOfferingKubernetesScubaReader.java | 51 + ...ontainersAwsOfferingKubernetesService.java | 51 + .../models/DefenderForServersAwsOffering.java | 90 + ...ServersAwsOfferingArcAutoProvisioning.java | 83 + ...sioningServicePrincipalSecretMetadata.java | 107 + ...rServersAwsOfferingDefenderForServers.java | 51 + .../security/models/Device.java | 208 - .../security/models/DeviceCriticality.java | 34 - .../security/models/DeviceStatus.java | 34 - .../security/models/Devices.java | 36 - .../security/models/DevicesForHubs.java | 38 - .../models/DevicesForSubscriptions.java | 34 - .../models/DiscoveredSecuritySolution.java | 14 +- .../security/models/ErrorAdditionalInfo.java | 54 - .../security/models/EventSource.java | 6 + .../models/ExternalSecuritySolutionKind.java | 37 + .../ExternalSecuritySolutionKindValue.java | 37 - .../security/models/Firmware.java | 129 - .../models/IoTSecurityAggregatedAlert.java | 14 +- .../IoTSecurityAggregatedRecommendation.java | 14 +- .../models/IoTSecuritySolutionModel.java | 14 +- .../security/models/IotAlertListModel.java | 59 - .../security/models/IotAlertModel.java | 91 - .../security/models/IotAlertType.java | 103 - .../security/models/IotAlertTypeList.java | 25 - .../security/models/IotAlerts.java | 80 - .../security/models/IotDefenderSettings.java | 137 - .../models/IotDefenderSettingsList.java | 25 - .../models/IotDefenderSettingsModel.java | 69 - .../models/IotRecommendationListModel.java | 59 - .../models/IotRecommendationModel.java | 66 - .../models/IotRecommendationType.java | 103 - .../models/IotRecommendationTypeList.java | 25 - .../models/IotRecommendationTypes.java | 54 - .../security/models/IotRecommendations.java | 69 - .../security/models/IotSensors.java | 215 - .../security/models/IotSensorsList.java | 25 - .../security/models/IotSensorsModel.java | 325 - .../security/models/IotSites.java | 105 - .../security/models/IotSitesList.java | 25 - .../security/models/IotSitesModel.java | 53 - .../security/models/IpAddress.java | 100 - .../models/JitNetworkAccessPolicy.java | 72 +- .../models/JitNetworkAccessPortRule.java | 6 +- .../resourcemanager/security/models/Kind.java | 51 +- ...swordInput.java => KindAutoGenerated.java} | 30 +- .../security/models/KindValue.java | 31 - .../security/models/MacAddress.java | 88 - .../security/models/MacSignificance.java | 34 - .../security/models/ManagementState.java | 34 - .../security/models/MdeOnboardingData.java | 54 + .../models/MdeOnboardingDataList.java | 25 + ...IotAlertTypes.java => MdeOnboardings.java} | 31 +- .../security/models/NetworkInterface.java | 98 - .../security/models/OfferingType.java | 37 + .../security/models/OnPremiseIotSensor.java | 45 - .../models/OnPremiseIotSensorsList.java | 25 - .../security/models/OnboardingKind.java | 40 - .../security/models/Operations.java | 4 +- .../models/OrganizationMembershipType.java | 34 + .../security/models/PackageDownloadInfo.java | 69 - .../security/models/PackageDownloads.java | 67 - .../PackageDownloadsCentralManager.java | 61 - .../PackageDownloadsCentralManagerFull.java | 61 - ...PackageDownloadsCentralManagerFullOvf.java | 97 - .../models/PackageDownloadsSensor.java | 72 - .../models/PackageDownloadsSensorFull.java | 72 - .../models/PackageDownloadsSensorFullOvf.java | 79 - .../security/models/ProgrammingState.java | 34 - .../security/models/Protocol.java | 68 +- .../security/models/ProtocolValue.java | 37 - .../security/models/PurdueLevel.java | 37 - .../models/RecommendationSeverity.java | 49 - .../security/models/RelationToIpStatus.java | 34 - .../security/models/RulesResultsInput.java | 2 + .../models/ScanningFunctionality.java | 34 - .../SecureScoreControlScoreDetails.java | 82 + .../security/models/SecurityAssessment.java | 325 +- .../models/SecurityAssessmentList.java | 6 +- ...etadataPropertiesResponsePublishDates.java | 85 + ...> SecurityAssessmentMetadataResponse.java} | 128 +- ...curityAssessmentMetadataResponseList.java} | 10 +- .../SecurityAssessmentPropertiesBase.java} | 83 +- .../models/SecurityAssessmentResponse.java | 281 + .../security/models/SecurityConnector.java | 322 + ...ConnectorPropertiesOrganizationalData.java | 140 + ...otSensors.java => SecurityConnectors.java} | 118 +- ...eList.java => SecurityConnectorsList.java} | 29 +- .../security/models/SecuritySolution.java | 14 +- .../SecuritySolutionsReferenceData.java | 163 +- .../security/models/Sensor.java | 54 - .../security/models/SensorStatus.java | 37 - .../security/models/SensorType.java | 34 - .../models/ServerVulnerabilityProperties.java | 2 + .../security/models/SettingsSettingName.java | 4 + .../security/models/SeverityEnum.java | 37 + .../resourcemanager/security/models/Site.java | 39 - .../security/models/SupportedCloudEnum.java | 31 + .../security/models/Tactics.java | 70 + .../resourcemanager/security/models/Tags.java | 2 + .../security/models/TagsResource.java | 2 + .../security/models/Techniques.java | 349 + .../security/models/TiStatus.java | 40 - .../security/models/TopologyResource.java | 14 +- .../security/models/TrackedResource.java | 2 + .../models/UpdateIotSecuritySolutionData.java | 57 +- .../models/UpgradePackageDownloadInfo.java | 41 - .../security/models/VersionKind.java | 37 - ...ptiveApplicationControlsDeleteSamples.java | 21 - ...AdaptiveApplicationControlsGetSamples.java | 21 - .../AlertsListByResourceGroupSamples.java | 21 - .../security/AlertsListSamples.java | 21 - .../AlertsSuppressionRulesDeleteSamples.java | 21 - .../AlertsSuppressionRulesGetSamples.java | 21 - .../AlertsSuppressionRulesListSamples.java | 32 - .../AlertsSuppressionRulesUpdateSamples.java | 44 - .../security/AssessmentsListSamples.java | 20 - .../AssessmentsMetadataGetSamples.java | 21 - .../AssessmentsMetadataListSamples.java | 21 - .../AutoProvisioningSettingsGetSamples.java | 21 - .../security/AutomationsDeleteSamples.java | 20 - .../AutomationsGetByResourceGroupSamples.java | 22 - .../ComplianceResultsListSamples.java | 21 - .../security/CompliancesListSamples.java | 21 - .../security/ConnectorsGetSamples.java | 21 - .../security/DeviceGetSamples.java | 25 - .../security/DevicesForHubListSamples.java | 27 - .../DevicesForSubscriptionListSamples.java | 20 - ...DiscoveredSecuritySolutionsGetSamples.java | 21 - ...iscoveredSecuritySolutionsListSamples.java | 21 - .../IngestionSettingsCreateSamples.java | 19 - .../security/IngestionSettingsGetSamples.java | 21 - .../IngestionSettingsListSamples.java | 21 - .../security/IotAlertTypesGetSamples.java | 20 - .../security/IotAlertTypesListSamples.java | 20 - .../security/IotAlertsGetSamples.java | 25 - .../security/IotAlertsListSamples.java | 31 - ...DefenderSettingsCreateOrUpdateSamples.java | 34 - .../IotDefenderSettingsDeleteSamples.java | 20 - ...tingsDownloadManagerActivationSamples.java | 21 - .../IotDefenderSettingsGetSamples.java | 20 - .../IotDefenderSettingsListSamples.java | 20 - ...fenderSettingsPackageDownloadsSamples.java | 20 - .../IotRecommendationTypesGetSamples.java | 20 - .../IotRecommendationTypesListSamples.java | 20 - .../IotRecommendationsGetSamples.java | 25 - .../IotRecommendationsListSamples.java | 28 - ...otSecuritySolutionAnalyticsGetSamples.java | 21 - ...tSecuritySolutionAnalyticsListSamples.java | 21 - .../IotSensorsCreateOrUpdateSamples.java | 28 - .../security/IotSensorsDeleteSamples.java | 25 - .../IotSensorsDownloadActivationSamples.java | 25 - ...otSensorsDownloadResetPasswordSamples.java | 28 - .../security/IotSensorsGetSamples.java | 25 - .../security/IotSensorsListSamples.java | 24 - ...tSensorsTriggerTiPackageUpdateSamples.java | 26 - .../IotSitesCreateOrUpdateSamples.java | 41 - .../security/IotSitesDeleteSamples.java | 24 - .../security/IotSitesGetSamples.java | 24 - .../security/IotSitesListSamples.java | 24 - ...JitNetworkAccessPoliciesDeleteSamples.java | 21 - .../JitNetworkAccessPoliciesGetSamples.java | 20 - ...remiseIotSensorsCreateOrUpdateSamples.java | 21 - .../OnPremiseIotSensorsDeleteSamples.java | 20 - ...seIotSensorsDownloadActivationSamples.java | 20 - ...otSensorsDownloadResetPasswordSamples.java | 25 - .../OnPremiseIotSensorsGetSamples.java | 20 - .../OnPremiseIotSensorsListSamples.java | 20 - ...ureScoreControlDefinitionsListSamples.java | 21 - ...ScoreControlsListBySecureScoreSamples.java | 36 - .../security/SecurityContactsGetSamples.java | 31 - .../security/SecurityContactsListSamples.java | 32 - .../SecurityContactsUpdateSamples.java | 37 - .../security/SecuritySolutionsGetSamples.java | 21 - ...sReferenceDataListByHomeRegionSamples.java | 21 - .../SubAssessmentsListAllSamples.java | 20 - .../security/TasksListSamples.java | 21 - .../security/TopologyGetSamples.java | 20 - .../security/WorkspaceSettingsGetSamples.java | 21 - .../WorkspaceSettingsListSamples.java | 21 - ...ptiveApplicationControlsDeleteSamples.java | 23 + ...AdaptiveApplicationControlsGetSamples.java | 23 + ...daptiveApplicationControlsListSamples.java | 12 +- ...AdaptiveApplicationControlsPutSamples.java | 15 +- ...aptiveNetworkHardeningsEnforceSamples.java | 12 +- .../AdaptiveNetworkHardeningsGetSamples.java | 12 +- ...rdeningsListByExtendedResourceSamples.java | 12 +- ...AdvancedThreatProtectionCreateSamples.java | 12 +- .../AdvancedThreatProtectionGetSamples.java | 12 +- .../AlertsGetResourceGroupLevelSamples.java | 12 +- .../AlertsGetSubscriptionLevelSamples.java | 12 +- .../AlertsListByResourceGroupSamples.java | 22 + ...ListResourceGroupLevelByRegionSamples.java | 12 +- .../security/generated/AlertsListSamples.java | 22 + ...sListSubscriptionLevelByRegionSamples.java | 12 +- .../AlertsSimulateSamples.java | 12 +- .../AlertsSuppressionRulesDeleteSamples.java | 23 + .../AlertsSuppressionRulesGetSamples.java | 23 + .../AlertsSuppressionRulesListSamples.java | 35 + .../AlertsSuppressionRulesUpdateSamples.java | 74 + ...ourceGroupLevelStateToActivateSamples.java | 12 +- ...sourceGroupLevelStateToDismissSamples.java | 12 +- ...sourceGroupLevelStateToResolveSamples.java | 12 +- ...bscriptionLevelStateToActivateSamples.java | 12 +- ...ubscriptionLevelStateToDismissSamples.java | 12 +- ...ubscriptionLevelStateToResolveSamples.java | 12 +- .../AllowedConnectionsGetSamples.java | 12 +- ...wedConnectionsListByHomeRegionSamples.java | 12 +- .../AllowedConnectionsListSamples.java | 12 +- .../AssessmentsCreateOrUpdateSamples.java | 14 +- .../AssessmentsDeleteSamples.java | 12 +- .../AssessmentsGetSamples.java | 22 +- .../generated/AssessmentsListSamples.java | 22 + ...tsMetadataCreateInSubscriptionSamples.java | 12 +- ...tsMetadataDeleteInSubscriptionSamples.java | 12 +- ...mentsMetadataGetInSubscriptionSamples.java | 12 +- .../AssessmentsMetadataGetSamples.java | 22 + ...entsMetadataListBySubscriptionSamples.java | 12 +- .../AssessmentsMetadataListSamples.java | 22 + ...AutoProvisioningSettingsCreateSamples.java | 12 +- .../AutoProvisioningSettingsGetSamples.java | 23 + .../AutoProvisioningSettingsListSamples.java | 12 +- .../AutomationsCreateOrUpdateSamples.java | 37 +- .../generated/AutomationsDeleteSamples.java | 22 + .../AutomationsGetByResourceGroupSamples.java | 22 + ...AutomationsListByResourceGroupSamples.java | 12 +- .../AutomationsListSamples.java | 12 +- .../AutomationsValidateSamples.java | 12 +- .../ComplianceResultsGetSamples.java | 13 +- .../ComplianceResultsListSamples.java | 22 + .../CompliancesGetSamples.java | 13 +- .../generated/CompliancesListSamples.java | 22 + .../ConnectorsCreateOrUpdateSamples.java | 32 +- .../ConnectorsDeleteSamples.java | 12 +- .../generated/ConnectorsGetSamples.java | 23 + .../ConnectorsListSamples.java | 12 +- ...tomAssessmentAutomationsCreateSamples.java | 34 + ...tomAssessmentAutomationsDeleteSamples.java | 24 + ...tAutomationsGetByResourceGroupSamples.java | 24 + ...AutomationsListByResourceGroupSamples.java | 23 + ...ustomAssessmentAutomationsListSamples.java | 23 + ...omEntityStoreAssignmentsCreateSamples.java | 25 + ...omEntityStoreAssignmentsDeleteSamples.java | 24 + ...eAssignmentsGetByResourceGroupSamples.java | 24 + ...AssignmentsListByResourceGroupSamples.java | 23 + ...stomEntityStoreAssignmentsListSamples.java | 23 + ...ceSecurityGroupsCreateOrUpdateSamples.java | 12 +- .../DeviceSecurityGroupsDeleteSamples.java | 12 +- .../DeviceSecurityGroupsGetSamples.java | 12 +- .../DeviceSecurityGroupsListSamples.java | 12 +- ...DiscoveredSecuritySolutionsGetSamples.java | 23 + ...uritySolutionsListByHomeRegionSamples.java | 12 +- ...iscoveredSecuritySolutionsListSamples.java | 22 + .../ExternalSecuritySolutionsGetSamples.java | 12 +- ...uritySolutionsListByHomeRegionSamples.java | 12 +- .../ExternalSecuritySolutionsListSamples.java | 12 +- ...otectionPoliciesCreateOrUpdateSamples.java | 12 +- ...formationProtectionPoliciesGetSamples.java | 22 +- ...ormationProtectionPoliciesListSamples.java | 13 +- .../IngestionSettingsCreateSamples.java | 21 + .../IngestionSettingsDeleteSamples.java | 12 +- .../IngestionSettingsGetSamples.java | 22 + ...nSettingsListConnectionStringsSamples.java | 12 +- .../IngestionSettingsListSamples.java | 22 + .../IngestionSettingsListTokensSamples.java | 12 +- ...otSecuritySolutionAnalyticsGetSamples.java | 22 + ...tSecuritySolutionAnalyticsListSamples.java | 22 + ...SecuritySolutionCreateOrUpdateSamples.java | 13 +- .../IotSecuritySolutionDeleteSamples.java | 12 +- ...ritySolutionGetByResourceGroupSamples.java | 12 +- ...itySolutionListByResourceGroupSamples.java | 22 +- .../IotSecuritySolutionListSamples.java | 23 +- .../IotSecuritySolutionUpdateSamples.java | 15 +- ...nalyticsAggregatedAlertDismissSamples.java | 12 +- ...onsAnalyticsAggregatedAlertGetSamples.java | 12 +- ...nsAnalyticsAggregatedAlertListSamples.java | 12 +- ...ionsAnalyticsRecommendationGetSamples.java | 12 +- ...onsAnalyticsRecommendationListSamples.java | 14 +- ...rkAccessPoliciesCreateOrUpdateSamples.java | 21 +- ...JitNetworkAccessPoliciesDeleteSamples.java | 22 + .../JitNetworkAccessPoliciesGetSamples.java | 22 + ...tNetworkAccessPoliciesInitiateSamples.java | 12 +- ...workAccessPoliciesListByRegionSamples.java | 12 +- ...esListByResourceGroupAndRegionSamples.java | 12 +- ...essPoliciesListByResourceGroupSamples.java | 12 +- .../JitNetworkAccessPoliciesListSamples.java | 12 +- .../{ => generated}/LocationsGetSamples.java | 12 +- .../{ => generated}/LocationsListSamples.java | 12 +- .../generated/MdeOnboardingsGetSamples.java | 23 + .../generated/MdeOnboardingsListSamples.java | 23 + .../{ => generated}/PricingsGetSamples.java | 12 +- .../{ => generated}/PricingsListSamples.java | 12 +- .../PricingsUpdateSamples.java | 12 +- ...latoryComplianceAssessmentsGetSamples.java | 12 +- ...atoryComplianceAssessmentsListSamples.java | 12 +- ...egulatoryComplianceControlsGetSamples.java | 12 +- ...gulatoryComplianceControlsListSamples.java | 12 +- ...gulatoryComplianceStandardsGetSamples.java | 12 +- ...ulatoryComplianceStandardsListSamples.java | 12 +- ...lDefinitionsListBySubscriptionSamples.java | 12 +- ...ureScoreControlDefinitionsListSamples.java | 22 + ...ScoreControlsListBySecureScoreSamples.java | 38 + .../SecureScoreControlsListSamples.java | 12 +- .../SecureScoresGetSamples.java | 12 +- .../SecureScoresListSamples.java | 12 +- ...curityConnectorsCreateOrUpdateSamples.java | 53 + .../SecurityConnectorsDeleteSamples.java | 22 + ...tyConnectorsGetByResourceGroupSamples.java | 24 + ...yConnectorsListByResourceGroupSamples.java | 23 + .../SecurityConnectorsListSamples.java | 23 + .../SecurityConnectorsUpdateSamples.java | 57 + .../SecurityContactsCreateSamples.java | 24 +- .../SecurityContactsDeleteSamples.java | 12 +- .../generated/SecurityContactsGetSamples.java | 34 + .../SecurityContactsListSamples.java | 34 + .../SecurityContactsUpdateSamples.java | 38 + .../SecuritySolutionsGetSamples.java | 23 + .../SecuritySolutionsListSamples.java | 12 +- ...sReferenceDataListByHomeRegionSamples.java | 23 + ...ritySolutionsReferenceDataListSamples.java | 12 +- ...bilityAssessmentCreateOrUpdateSamples.java | 12 +- ...rVulnerabilityAssessmentDeleteSamples.java | 12 +- ...rverVulnerabilityAssessmentGetSamples.java | 12 +- ...sessmentListByExtendedResourceSamples.java | 12 +- .../{ => generated}/SettingsGetSamples.java | 12 +- .../{ => generated}/SettingsListSamples.java | 12 +- .../SettingsUpdateSamples.java | 13 +- .../SoftwareInventoriesGetSamples.java | 12 +- ...entoriesListByExtendedResourceSamples.java | 12 +- .../SoftwareInventoriesListSamples.java | 12 +- ...lityAssessmentBaselineRulesAddSamples.java | 22 +- ...entBaselineRulesCreateOrUpdateSamples.java | 22 +- ...yAssessmentBaselineRulesDeleteSamples.java | 12 +- ...lityAssessmentBaselineRulesGetSamples.java | 12 +- ...ityAssessmentBaselineRulesListSamples.java | 12 +- ...bilityAssessmentScanResultsGetSamples.java | 23 +- ...ilityAssessmentScanResultsListSamples.java | 23 +- ...ulnerabilityAssessmentScansGetSamples.java | 23 +- ...lnerabilityAssessmentScansListSamples.java | 12 +- .../SubAssessmentsGetSamples.java | 12 +- .../SubAssessmentsListAllSamples.java | 22 + .../SubAssessmentsListSamples.java | 12 +- ...TasksGetResourceGroupLevelTaskSamples.java | 12 +- .../TasksGetSubscriptionLevelTaskSamples.java | 12 +- .../TasksListByHomeRegionSamples.java | 12 +- .../TasksListByResourceGroupSamples.java | 12 +- .../security/generated/TasksListSamples.java | 22 + ...ateResourceGroupLevelTaskStateSamples.java | 12 +- ...dateSubscriptionLevelTaskStateSamples.java | 12 +- .../generated/TopologyGetSamples.java | 22 + .../TopologyListByHomeRegionSamples.java | 12 +- .../{ => generated}/TopologyListSamples.java | 12 +- .../WorkspaceSettingsCreateSamples.java | 12 +- .../WorkspaceSettingsDeleteSamples.java | 12 +- .../WorkspaceSettingsGetSamples.java | 22 + .../WorkspaceSettingsListSamples.java | 22 + .../WorkspaceSettingsUpdateSamples.java | 13 +- 596 files changed, 27246 insertions(+), 21281 deletions(-) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomAssessmentAutomationsClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomEntityStoreAssignmentsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesForHubsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesForSubscriptionsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotAlertsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotDefenderSettingsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotRecommendationTypesClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotRecommendationsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSensorsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSitesClient.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/{IotAlertTypesClient.java => MdeOnboardingsClient.java} (64%) delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OnPremiseIotSensorsClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorsClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupData.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveNetworkHardeningProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertProperties.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/{IotAlertTypeListInner.java => AlertSyncSettingProperties.java} (51%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceProperties.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/{IotSensorsListInner.java => ComplianceResultProperties.java} (54%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationRequestProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentRequestProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DataExportSettingProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotAlertModelInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotAlertTypeInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotDefenderSettingsListInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotDefenderSettingsModelInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotRecommendationModelInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotRecommendationTypeInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSensorsModelInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSitesListInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSitesModelInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataInner.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/{IotRecommendationTypeListInner.java => MdeOnboardingDataListInner.java} (58%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OnPremiseIotSensorInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OnPremiseIotSensorsListInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PackageDownloadsInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScoreDetails.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlScoreDetailsInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataInner.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/{ => fluent}/models/SecurityAssessmentMetadataProperties.java (95%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataPropertiesResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataResponseInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentPropertiesResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentResponseInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionsReferenceDataProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SoftwareProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/UpdateIoTSecuritySolutionProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForHubsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForHubsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForSubscriptionsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForSubscriptionsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertModelImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypeImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypesImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsListImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsModelImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationModelImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypeImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypeListImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypesClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypesImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsListImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsModelImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesListImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesModelImpl.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/{OnPremiseIotSensorImpl.java => MdeOnboardingDataImpl.java} (53%) rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/{IotAlertTypeListImpl.java => MdeOnboardingDataListImpl.java} (52%) rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/{IotAlertTypesClientImpl.java => MdeOnboardingsClientImpl.java} (68%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorsListImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PackageDownloadsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlScoreDetailsImpl.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/{SecurityAssessmentMetadataImpl.java => SecurityAssessmentMetadataResponseImpl.java} (58%) rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/{SecurityAssessmentImpl.java => SecurityAssessmentResponseImpl.java} (57%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityStateAutoGenerated.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityStateValue.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertIntent.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatusResponse.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthorizationState.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudErrorBody.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudName.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudOffering.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOffering.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOfferingNativeCloudConnection.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomation.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationRequest.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomations.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationsListResult.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignment.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentRequest.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignments.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentsListResult.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOffering.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingCloudWatchToKinesis.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKinesisToS3.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesScubaReader.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesService.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOffering.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioning.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingDefenderForServers.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Device.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceCriticality.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceStatus.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Devices.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevicesForHubs.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevicesForSubscriptions.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ErrorAdditionalInfo.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKind.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKindValue.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Firmware.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertListModel.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertModel.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertTypeList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlerts.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettings.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettingsList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettingsModel.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationListModel.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationModel.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationTypeList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationTypes.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendations.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensors.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensorsList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensorsModel.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSites.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSitesList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSitesModel.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IpAddress.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/{ResetPasswordInput.java => KindAutoGenerated.java} (52%) delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/KindValue.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MacAddress.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MacSignificance.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementState.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardingData.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardingDataList.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/{IotAlertTypes.java => MdeOnboardings.java} (63%) delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/NetworkInterface.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OfferingType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseIotSensor.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseIotSensorsList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnboardingKind.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OrganizationMembershipType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadInfo.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloads.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManager.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManagerFull.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManagerFullOvf.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensor.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensorFull.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensorFullOvf.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProgrammingState.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProtocolValue.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PurdueLevel.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationSeverity.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RelationToIpStatus.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanningFunctionality.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlScoreDetails.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataPropertiesResponsePublishDates.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/{SecurityAssessmentMetadata.java => SecurityAssessmentMetadataResponse.java} (64%) rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/{SecurityAssessmentMetadataList.java => SecurityAssessmentMetadataResponseList.java} (84%) rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/{fluent/models/SecurityAssessmentInner.java => models/SecurityAssessmentPropertiesBase.java} (61%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnector.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorPropertiesOrganizationalData.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/{OnPremiseIotSensors.java => SecurityConnectors.java} (52%) rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/{DeviceList.java => SecurityConnectorsList.java} (63%) delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Sensor.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensorStatus.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensorType.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SeverityEnum.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Site.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SupportedCloudEnum.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tactics.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Techniques.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TiStatus.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpgradePackageDownloadInfo.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VersionKind.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsDeleteSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListByResourceGroupSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesDeleteSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesUpdateSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsDeleteSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsGetByResourceGroupSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ComplianceResultsListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/CompliancesListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DevicesForHubListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DevicesForSubscriptionListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsCreateSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertTypesGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertTypesListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertsGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertsListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsCreateOrUpdateSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsDeleteSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsDownloadManagerActivationSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsPackageDownloadsSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationTypesGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationTypesListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationsGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationsListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionAnalyticsGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionAnalyticsListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsCreateOrUpdateSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDeleteSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDownloadActivationSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDownloadResetPasswordSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsTriggerTiPackageUpdateSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesCreateOrUpdateSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesDeleteSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesDeleteSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsCreateOrUpdateSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDeleteSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDownloadActivationSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDownloadResetPasswordSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlDefinitionsListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlsListBySecureScoreSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsUpdateSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsReferenceDataListByHomeRegionSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsListAllSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsDeleteSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsGetSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AdaptiveApplicationControlsListSamples.java (52%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AdaptiveApplicationControlsPutSamples.java (93%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AdaptiveNetworkHardeningsEnforceSamples.java (86%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AdaptiveNetworkHardeningsGetSamples.java (61%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AdaptiveNetworkHardeningsListByExtendedResourceSamples.java (62%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AdvancedThreatProtectionCreateSamples.java (67%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AdvancedThreatProtectionGetSamples.java (66%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AlertsGetResourceGroupLevelSamples.java (64%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AlertsGetSubscriptionLevelSamples.java (64%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListByResourceGroupSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AlertsListResourceGroupLevelByRegionSamples.java (53%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AlertsListSubscriptionLevelByRegionSamples.java (54%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AlertsSimulateSamples.java (81%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesDeleteSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AlertsUpdateResourceGroupLevelStateToActivateSamples.java (66%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AlertsUpdateResourceGroupLevelStateToDismissSamples.java (66%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AlertsUpdateResourceGroupLevelStateToResolveSamples.java (66%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AlertsUpdateSubscriptionLevelStateToActivateSamples.java (66%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AlertsUpdateSubscriptionLevelStateToDismissSamples.java (66%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AlertsUpdateSubscriptionLevelStateToResolveSamples.java (65%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AllowedConnectionsGetSamples.java (64%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AllowedConnectionsListByHomeRegionSamples.java (53%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AllowedConnectionsListSamples.java (50%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AssessmentsCreateOrUpdateSamples.java (74%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AssessmentsDeleteSamples.java (67%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AssessmentsGetSamples.java (67%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsListSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AssessmentsMetadataCreateInSubscriptionSamples.java (84%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AssessmentsMetadataDeleteInSubscriptionSamples.java (61%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AssessmentsMetadataGetInSubscriptionSamples.java (61%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AssessmentsMetadataListBySubscriptionSamples.java (52%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AutoProvisioningSettingsCreateSamples.java (50%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsGetSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AutoProvisioningSettingsListSamples.java (50%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AutomationsCreateOrUpdateSamples.java (87%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsDeleteSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AutomationsListByResourceGroupSamples.java (51%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AutomationsListSamples.java (52%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/AutomationsValidateSamples.java (92%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/ComplianceResultsGetSamples.java (56%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsListSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/CompliancesGetSamples.java (54%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesListSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/ConnectorsCreateOrUpdateSamples.java (86%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/ConnectorsDeleteSamples.java (50%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsGetSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/ConnectorsListSamples.java (51%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsCreateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsDeleteSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsGetByResourceGroupSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListByResourceGroupSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsCreateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsDeleteSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsGetByResourceGroupSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListByResourceGroupSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/DeviceSecurityGroupsCreateOrUpdateSamples.java (77%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/DeviceSecurityGroupsDeleteSamples.java (67%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/DeviceSecurityGroupsGetSamples.java (66%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/DeviceSecurityGroupsListSamples.java (65%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/DiscoveredSecuritySolutionsListByHomeRegionSamples.java (51%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/ExternalSecuritySolutionsGetSamples.java (65%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/ExternalSecuritySolutionsListByHomeRegionSamples.java (53%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/ExternalSecuritySolutionsListSamples.java (51%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/InformationProtectionPoliciesCreateOrUpdateSamples.java (89%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/InformationProtectionPoliciesGetSamples.java (65%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/InformationProtectionPoliciesListSamples.java (55%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsCreateSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/IngestionSettingsDeleteSamples.java (50%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/IngestionSettingsListConnectionStringsSamples.java (52%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/IngestionSettingsListTokensSamples.java (50%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/IotSecuritySolutionCreateOrUpdateSamples.java (87%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/IotSecuritySolutionDeleteSamples.java (50%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/IotSecuritySolutionGetByResourceGroupSamples.java (51%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/IotSecuritySolutionListByResourceGroupSamples.java (55%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/IotSecuritySolutionListSamples.java (50%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/IotSecuritySolutionUpdateSamples.java (82%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java (62%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples.java (66%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java (51%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/IotSecuritySolutionsAnalyticsRecommendationGetSamples.java (64%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/IotSecuritySolutionsAnalyticsRecommendationListSamples.java (53%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/JitNetworkAccessPoliciesCreateOrUpdateSamples.java (88%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/JitNetworkAccessPoliciesInitiateSamples.java (83%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/JitNetworkAccessPoliciesListByRegionSamples.java (53%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java (53%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/JitNetworkAccessPoliciesListByResourceGroupSamples.java (51%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/JitNetworkAccessPoliciesListSamples.java (51%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/LocationsGetSamples.java (50%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/LocationsListSamples.java (52%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/PricingsGetSamples.java (50%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/PricingsListSamples.java (52%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/PricingsUpdateSamples.java (67%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/RegulatoryComplianceAssessmentsGetSamples.java (62%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/RegulatoryComplianceAssessmentsListSamples.java (51%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/RegulatoryComplianceControlsGetSamples.java (50%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/RegulatoryComplianceControlsListSamples.java (53%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/RegulatoryComplianceStandardsGetSamples.java (51%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/RegulatoryComplianceStandardsListSamples.java (52%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SecureScoreControlDefinitionsListBySubscriptionSamples.java (51%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SecureScoreControlsListSamples.java (52%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SecureScoresGetSamples.java (50%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SecureScoresListSamples.java (52%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsCreateOrUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsUpdateSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SecurityContactsCreateSamples.java (57%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SecurityContactsDeleteSamples.java (50%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SecuritySolutionsListSamples.java (51%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListByHomeRegionSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SecuritySolutionsReferenceDataListSamples.java (50%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java (70%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/ServerVulnerabilityAssessmentDeleteSamples.java (68%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/ServerVulnerabilityAssessmentGetSamples.java (66%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java (69%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SettingsGetSamples.java (54%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SettingsListSamples.java (53%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SettingsUpdateSamples.java (61%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SoftwareInventoriesGetSamples.java (66%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SoftwareInventoriesListByExtendedResourceSamples.java (61%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SoftwareInventoriesListSamples.java (53%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java (75%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.java (68%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SqlVulnerabilityAssessmentBaselineRulesDeleteSamples.java (68%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SqlVulnerabilityAssessmentBaselineRulesGetSamples.java (68%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SqlVulnerabilityAssessmentBaselineRulesListSamples.java (67%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SqlVulnerabilityAssessmentScanResultsGetSamples.java (63%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SqlVulnerabilityAssessmentScanResultsListSamples.java (62%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SqlVulnerabilityAssessmentScansGetSamples.java (62%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SqlVulnerabilityAssessmentScansListSamples.java (68%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SubAssessmentsGetSamples.java (68%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListAllSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/SubAssessmentsListSamples.java (64%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/TasksGetResourceGroupLevelTaskSamples.java (63%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/TasksGetSubscriptionLevelTaskSamples.java (62%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/TasksListByHomeRegionSamples.java (52%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/TasksListByResourceGroupSamples.java (51%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/TasksUpdateResourceGroupLevelTaskStateSamples.java (68%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/TasksUpdateSubscriptionLevelTaskStateSamples.java (66%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyGetSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/TopologyListByHomeRegionSamples.java (52%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/TopologyListSamples.java (52%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/WorkspaceSettingsCreateSamples.java (66%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/WorkspaceSettingsDeleteSamples.java (50%) create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/{ => generated}/WorkspaceSettingsUpdateSamples.java (61%) diff --git a/sdk/security/azure-resourcemanager-security/CHANGELOG.md b/sdk/security/azure-resourcemanager-security/CHANGELOG.md index 33b7843e8f5ec..2d0ea95056d59 100644 --- a/sdk/security/azure-resourcemanager-security/CHANGELOG.md +++ b/sdk/security/azure-resourcemanager-security/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2021-12-16) +- 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). ## 1.0.0-beta.1 (2021-07-14) diff --git a/sdk/security/azure-resourcemanager-security/README.md b/sdk/security/azure-resourcemanager-security/README.md index dae5056f7c71c..5049f5e61582c 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.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/security/azure-resourcemanager-security/SAMPLE.md b/sdk/security/azure-resourcemanager-security/SAMPLE.md index 0fe03d7c6216b..2e7428b570710 100644 --- a/sdk/security/azure-resourcemanager-security/SAMPLE.md +++ b/sdk/security/azure-resourcemanager-security/SAMPLE.md @@ -1,360 +1,5573 @@ # Code snippets and samples -### AdaptiveApplicationControls +## AdaptiveApplicationControls -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsDeleteSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsListSamples.java) -- [Put](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsPutSamples.java) +- [Delete](#adaptiveapplicationcontrols_delete) +- [Get](#adaptiveapplicationcontrols_get) +- [List](#adaptiveapplicationcontrols_list) +- [Put](#adaptiveapplicationcontrols_put) -### AdaptiveNetworkHardenings +## AdaptiveNetworkHardenings -- [Enforce](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsEnforceSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsGetSamples.java) -- [ListByExtendedResource](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsListByExtendedResourceSamples.java) +- [Enforce](#adaptivenetworkhardenings_enforce) +- [Get](#adaptivenetworkhardenings_get) +- [ListByExtendedResource](#adaptivenetworkhardenings_listbyextendedresource) -### AdvancedThreatProtection +## AdvancedThreatProtection -- [Create](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdvancedThreatProtectionCreateSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdvancedThreatProtectionGetSamples.java) +- [Create](#advancedthreatprotection_create) +- [Get](#advancedthreatprotection_get) -### Alerts +## Alerts -- [GetResourceGroupLevel](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsGetResourceGroupLevelSamples.java) -- [GetSubscriptionLevel](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsGetSubscriptionLevelSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListSamples.java) -- [ListByResourceGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListByResourceGroupSamples.java) -- [ListResourceGroupLevelByRegion](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListResourceGroupLevelByRegionSamples.java) -- [ListSubscriptionLevelByRegion](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListSubscriptionLevelByRegionSamples.java) -- [Simulate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSimulateSamples.java) -- [UpdateResourceGroupLevelStateToActivate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToActivateSamples.java) -- [UpdateResourceGroupLevelStateToDismiss](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToDismissSamples.java) -- [UpdateResourceGroupLevelStateToResolve](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToResolveSamples.java) -- [UpdateSubscriptionLevelStateToActivate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToActivateSamples.java) -- [UpdateSubscriptionLevelStateToDismiss](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToDismissSamples.java) -- [UpdateSubscriptionLevelStateToResolve](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToResolveSamples.java) +- [GetResourceGroupLevel](#alerts_getresourcegrouplevel) +- [GetSubscriptionLevel](#alerts_getsubscriptionlevel) +- [List](#alerts_list) +- [ListByResourceGroup](#alerts_listbyresourcegroup) +- [ListResourceGroupLevelByRegion](#alerts_listresourcegrouplevelbyregion) +- [ListSubscriptionLevelByRegion](#alerts_listsubscriptionlevelbyregion) +- [Simulate](#alerts_simulate) +- [UpdateResourceGroupLevelStateToActivate](#alerts_updateresourcegrouplevelstatetoactivate) +- [UpdateResourceGroupLevelStateToDismiss](#alerts_updateresourcegrouplevelstatetodismiss) +- [UpdateResourceGroupLevelStateToResolve](#alerts_updateresourcegrouplevelstatetoresolve) +- [UpdateSubscriptionLevelStateToActivate](#alerts_updatesubscriptionlevelstatetoactivate) +- [UpdateSubscriptionLevelStateToDismiss](#alerts_updatesubscriptionlevelstatetodismiss) +- [UpdateSubscriptionLevelStateToResolve](#alerts_updatesubscriptionlevelstatetoresolve) -### AlertsSuppressionRules +## AlertsSuppressionRules -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesDeleteSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesListSamples.java) -- [Update](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesUpdateSamples.java) +- [Delete](#alertssuppressionrules_delete) +- [Get](#alertssuppressionrules_get) +- [List](#alertssuppressionrules_list) +- [Update](#alertssuppressionrules_update) -### AllowedConnections +## AllowedConnections -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsListSamples.java) -- [ListByHomeRegion](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsListByHomeRegionSamples.java) +- [Get](#allowedconnections_get) +- [List](#allowedconnections_list) +- [ListByHomeRegion](#allowedconnections_listbyhomeregion) -### Assessments +## Assessments -- [CreateOrUpdate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsCreateOrUpdateSamples.java) -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsDeleteSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsListSamples.java) +- [CreateOrUpdate](#assessments_createorupdate) +- [Delete](#assessments_delete) +- [Get](#assessments_get) +- [List](#assessments_list) -### AssessmentsMetadata +## AssessmentsMetadata -- [CreateInSubscription](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataCreateInSubscriptionSamples.java) -- [DeleteInSubscription](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataDeleteInSubscriptionSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataGetSamples.java) -- [GetInSubscription](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataGetInSubscriptionSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataListSamples.java) -- [ListBySubscription](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataListBySubscriptionSamples.java) +- [CreateInSubscription](#assessmentsmetadata_createinsubscription) +- [DeleteInSubscription](#assessmentsmetadata_deleteinsubscription) +- [Get](#assessmentsmetadata_get) +- [GetInSubscription](#assessmentsmetadata_getinsubscription) +- [List](#assessmentsmetadata_list) +- [ListBySubscription](#assessmentsmetadata_listbysubscription) -### AutoProvisioningSettings +## AutoProvisioningSettings -- [Create](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsCreateSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsListSamples.java) +- [Create](#autoprovisioningsettings_create) +- [Get](#autoprovisioningsettings_get) +- [List](#autoprovisioningsettings_list) -### Automations +## Automations -- [CreateOrUpdate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsCreateOrUpdateSamples.java) -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsDeleteSamples.java) -- [GetByResourceGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsGetByResourceGroupSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsListSamples.java) -- [ListByResourceGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsListByResourceGroupSamples.java) -- [Validate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsValidateSamples.java) +- [CreateOrUpdate](#automations_createorupdate) +- [Delete](#automations_delete) +- [GetByResourceGroup](#automations_getbyresourcegroup) +- [List](#automations_list) +- [ListByResourceGroup](#automations_listbyresourcegroup) +- [Validate](#automations_validate) -### ComplianceResults +## ComplianceResults -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ComplianceResultsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ComplianceResultsListSamples.java) +- [Get](#complianceresults_get) +- [List](#complianceresults_list) -### Compliances +## Compliances -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/CompliancesGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/CompliancesListSamples.java) +- [Get](#compliances_get) +- [List](#compliances_list) -### Connectors +## Connectors -- [CreateOrUpdate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsCreateOrUpdateSamples.java) -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsDeleteSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsListSamples.java) +- [CreateOrUpdate](#connectors_createorupdate) +- [Delete](#connectors_delete) +- [Get](#connectors_get) +- [List](#connectors_list) -### Device +## CustomAssessmentAutomations -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceGetSamples.java) +- [Create](#customassessmentautomations_create) +- [Delete](#customassessmentautomations_delete) +- [GetByResourceGroup](#customassessmentautomations_getbyresourcegroup) +- [List](#customassessmentautomations_list) +- [ListByResourceGroup](#customassessmentautomations_listbyresourcegroup) -### DeviceSecurityGroups +## CustomEntityStoreAssignments -- [CreateOrUpdate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsCreateOrUpdateSamples.java) -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsDeleteSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsListSamples.java) +- [Create](#customentitystoreassignments_create) +- [Delete](#customentitystoreassignments_delete) +- [GetByResourceGroup](#customentitystoreassignments_getbyresourcegroup) +- [List](#customentitystoreassignments_list) +- [ListByResourceGroup](#customentitystoreassignments_listbyresourcegroup) -### DevicesForHub +## DeviceSecurityGroups -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DevicesForHubListSamples.java) +- [CreateOrUpdate](#devicesecuritygroups_createorupdate) +- [Delete](#devicesecuritygroups_delete) +- [Get](#devicesecuritygroups_get) +- [List](#devicesecuritygroups_list) -### DevicesForSubscription +## DiscoveredSecuritySolutions -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DevicesForSubscriptionListSamples.java) +- [Get](#discoveredsecuritysolutions_get) +- [List](#discoveredsecuritysolutions_list) +- [ListByHomeRegion](#discoveredsecuritysolutions_listbyhomeregion) -### DiscoveredSecuritySolutions +## ExternalSecuritySolutions -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsListSamples.java) -- [ListByHomeRegion](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsListByHomeRegionSamples.java) +- [Get](#externalsecuritysolutions_get) +- [List](#externalsecuritysolutions_list) +- [ListByHomeRegion](#externalsecuritysolutions_listbyhomeregion) -### ExternalSecuritySolutions +## InformationProtectionPolicies -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsListSamples.java) -- [ListByHomeRegion](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsListByHomeRegionSamples.java) +- [CreateOrUpdate](#informationprotectionpolicies_createorupdate) +- [Get](#informationprotectionpolicies_get) +- [List](#informationprotectionpolicies_list) -### InformationProtectionPolicies +## IngestionSettings -- [CreateOrUpdate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesCreateOrUpdateSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesListSamples.java) +- [Create](#ingestionsettings_create) +- [Delete](#ingestionsettings_delete) +- [Get](#ingestionsettings_get) +- [List](#ingestionsettings_list) +- [ListConnectionStrings](#ingestionsettings_listconnectionstrings) +- [ListTokens](#ingestionsettings_listtokens) -### IngestionSettings +## IotSecuritySolution -- [Create](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsCreateSamples.java) -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsDeleteSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListSamples.java) -- [ListConnectionStrings](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListConnectionStringsSamples.java) -- [ListTokens](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListTokensSamples.java) +- [CreateOrUpdate](#iotsecuritysolution_createorupdate) +- [Delete](#iotsecuritysolution_delete) +- [GetByResourceGroup](#iotsecuritysolution_getbyresourcegroup) +- [List](#iotsecuritysolution_list) +- [ListByResourceGroup](#iotsecuritysolution_listbyresourcegroup) +- [Update](#iotsecuritysolution_update) -### IotAlertTypes +## IotSecuritySolutionAnalytics -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertTypesGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertTypesListSamples.java) +- [Get](#iotsecuritysolutionanalytics_get) +- [List](#iotsecuritysolutionanalytics_list) -### IotAlerts +## IotSecuritySolutionsAnalyticsAggregatedAlert -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertsListSamples.java) +- [Dismiss](#iotsecuritysolutionsanalyticsaggregatedalert_dismiss) +- [Get](#iotsecuritysolutionsanalyticsaggregatedalert_get) +- [List](#iotsecuritysolutionsanalyticsaggregatedalert_list) -### IotDefenderSettings +## IotSecuritySolutionsAnalyticsRecommendation -- [CreateOrUpdate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsCreateOrUpdateSamples.java) -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsDeleteSamples.java) -- [DownloadManagerActivation](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsDownloadManagerActivationSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsListSamples.java) -- [PackageDownloads](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsPackageDownloadsSamples.java) +- [Get](#iotsecuritysolutionsanalyticsrecommendation_get) +- [List](#iotsecuritysolutionsanalyticsrecommendation_list) -### IotRecommendationTypes +## JitNetworkAccessPolicies -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationTypesGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationTypesListSamples.java) +- [CreateOrUpdate](#jitnetworkaccesspolicies_createorupdate) +- [Delete](#jitnetworkaccesspolicies_delete) +- [Get](#jitnetworkaccesspolicies_get) +- [Initiate](#jitnetworkaccesspolicies_initiate) +- [List](#jitnetworkaccesspolicies_list) +- [ListByRegion](#jitnetworkaccesspolicies_listbyregion) +- [ListByResourceGroup](#jitnetworkaccesspolicies_listbyresourcegroup) +- [ListByResourceGroupAndRegion](#jitnetworkaccesspolicies_listbyresourcegroupandregion) -### IotRecommendations +## Locations -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationsListSamples.java) +- [Get](#locations_get) +- [List](#locations_list) -### IotSecuritySolution +## MdeOnboardings -- [CreateOrUpdate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionCreateOrUpdateSamples.java) -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionDeleteSamples.java) -- [GetByResourceGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionGetByResourceGroupSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionListSamples.java) -- [ListByResourceGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionListByResourceGroupSamples.java) -- [Update](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionUpdateSamples.java) +- [Get](#mdeonboardings_get) +- [List](#mdeonboardings_list) -### IotSecuritySolutionAnalytics +## Pricings -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionAnalyticsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionAnalyticsListSamples.java) +- [Get](#pricings_get) +- [List](#pricings_list) +- [Update](#pricings_update) -### IotSecuritySolutionsAnalyticsAggregatedAlert +## RegulatoryComplianceAssessments -- [Dismiss](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java) +- [Get](#regulatorycomplianceassessments_get) +- [List](#regulatorycomplianceassessments_list) -### IotSecuritySolutionsAnalyticsRecommendation +## RegulatoryComplianceControls -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsRecommendationGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsRecommendationListSamples.java) +- [Get](#regulatorycompliancecontrols_get) +- [List](#regulatorycompliancecontrols_list) -### IotSensors +## RegulatoryComplianceStandards -- [CreateOrUpdate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsCreateOrUpdateSamples.java) -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDeleteSamples.java) -- [DownloadActivation](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDownloadActivationSamples.java) -- [DownloadResetPassword](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDownloadResetPasswordSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsListSamples.java) -- [TriggerTiPackageUpdate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsTriggerTiPackageUpdateSamples.java) +- [Get](#regulatorycompliancestandards_get) +- [List](#regulatorycompliancestandards_list) -### IotSites +## SecureScoreControlDefinitions -- [CreateOrUpdate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesCreateOrUpdateSamples.java) -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesDeleteSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesListSamples.java) +- [List](#securescorecontroldefinitions_list) +- [ListBySubscription](#securescorecontroldefinitions_listbysubscription) -### JitNetworkAccessPolicies +## SecureScoreControls -- [CreateOrUpdate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesCreateOrUpdateSamples.java) -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesDeleteSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesGetSamples.java) -- [Initiate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesInitiateSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListSamples.java) -- [ListByRegion](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByRegionSamples.java) -- [ListByResourceGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByResourceGroupSamples.java) -- [ListByResourceGroupAndRegion](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java) +- [List](#securescorecontrols_list) +- [ListBySecureScore](#securescorecontrols_listbysecurescore) -### Locations +## SecureScores -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/LocationsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/LocationsListSamples.java) +- [Get](#securescores_get) +- [List](#securescores_list) -### OnPremiseIotSensors +## SecurityConnectors -- [CreateOrUpdate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsCreateOrUpdateSamples.java) -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDeleteSamples.java) -- [DownloadActivation](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDownloadActivationSamples.java) -- [DownloadResetPassword](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDownloadResetPasswordSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsListSamples.java) +- [CreateOrUpdate](#securityconnectors_createorupdate) +- [Delete](#securityconnectors_delete) +- [GetByResourceGroup](#securityconnectors_getbyresourcegroup) +- [List](#securityconnectors_list) +- [ListByResourceGroup](#securityconnectors_listbyresourcegroup) +- [Update](#securityconnectors_update) -### Pricings +## SecurityContacts -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsListSamples.java) -- [Update](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsUpdateSamples.java) +- [Create](#securitycontacts_create) +- [Delete](#securitycontacts_delete) +- [Get](#securitycontacts_get) +- [List](#securitycontacts_list) +- [Update](#securitycontacts_update) -### RegulatoryComplianceAssessments +## SecuritySolutions -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceAssessmentsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceAssessmentsListSamples.java) +- [Get](#securitysolutions_get) +- [List](#securitysolutions_list) -### RegulatoryComplianceControls +## SecuritySolutionsReferenceData -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceControlsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceControlsListSamples.java) +- [List](#securitysolutionsreferencedata_list) +- [ListByHomeRegion](#securitysolutionsreferencedata_listbyhomeregion) -### RegulatoryComplianceStandards +## ServerVulnerabilityAssessment -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceStandardsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceStandardsListSamples.java) +- [CreateOrUpdate](#servervulnerabilityassessment_createorupdate) +- [Delete](#servervulnerabilityassessment_delete) +- [Get](#servervulnerabilityassessment_get) +- [ListByExtendedResource](#servervulnerabilityassessment_listbyextendedresource) -### SecureScoreControlDefinitions +## Settings -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlDefinitionsListSamples.java) -- [ListBySubscription](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlDefinitionsListBySubscriptionSamples.java) +- [Get](#settings_get) +- [List](#settings_list) +- [Update](#settings_update) -### SecureScoreControls +## SoftwareInventories -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlsListSamples.java) -- [ListBySecureScore](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlsListBySecureScoreSamples.java) +- [Get](#softwareinventories_get) +- [List](#softwareinventories_list) +- [ListByExtendedResource](#softwareinventories_listbyextendedresource) -### SecureScores +## SqlVulnerabilityAssessmentBaselineRules -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoresGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoresListSamples.java) +- [Add](#sqlvulnerabilityassessmentbaselinerules_add) +- [CreateOrUpdate](#sqlvulnerabilityassessmentbaselinerules_createorupdate) +- [Delete](#sqlvulnerabilityassessmentbaselinerules_delete) +- [Get](#sqlvulnerabilityassessmentbaselinerules_get) +- [List](#sqlvulnerabilityassessmentbaselinerules_list) -### SecurityContacts +## SqlVulnerabilityAssessmentScanResults -- [Create](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsCreateSamples.java) -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsDeleteSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsListSamples.java) -- [Update](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsUpdateSamples.java) +- [Get](#sqlvulnerabilityassessmentscanresults_get) +- [List](#sqlvulnerabilityassessmentscanresults_list) -### SecuritySolutions +## SqlVulnerabilityAssessmentScans -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsListSamples.java) +- [Get](#sqlvulnerabilityassessmentscans_get) +- [List](#sqlvulnerabilityassessmentscans_list) -### SecuritySolutionsReferenceData +## SubAssessments -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsReferenceDataListSamples.java) -- [ListByHomeRegion](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsReferenceDataListByHomeRegionSamples.java) +- [Get](#subassessments_get) +- [List](#subassessments_list) +- [ListAll](#subassessments_listall) -### ServerVulnerabilityAssessment +## Tasks -- [CreateOrUpdate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java) -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentDeleteSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentGetSamples.java) -- [ListByExtendedResource](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java) +- [GetResourceGroupLevelTask](#tasks_getresourcegroupleveltask) +- [GetSubscriptionLevelTask](#tasks_getsubscriptionleveltask) +- [List](#tasks_list) +- [ListByHomeRegion](#tasks_listbyhomeregion) +- [ListByResourceGroup](#tasks_listbyresourcegroup) +- [UpdateResourceGroupLevelTaskState](#tasks_updateresourcegroupleveltaskstate) +- [UpdateSubscriptionLevelTaskState](#tasks_updatesubscriptionleveltaskstate) -### Settings +## Topology -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsListSamples.java) -- [Update](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsUpdateSamples.java) +- [Get](#topology_get) +- [List](#topology_list) +- [ListByHomeRegion](#topology_listbyhomeregion) -### SoftwareInventories +## WorkspaceSettings -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesListSamples.java) -- [ListByExtendedResource](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesListByExtendedResourceSamples.java) +- [Create](#workspacesettings_create) +- [Delete](#workspacesettings_delete) +- [Get](#workspacesettings_get) +- [List](#workspacesettings_list) +- [Update](#workspacesettings_update) +### AdaptiveApplicationControls_Delete -### SqlVulnerabilityAssessmentBaselineRules +```java +import com.azure.core.util.Context; -- [Add](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java) -- [CreateOrUpdate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.java) -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesDeleteSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesListSamples.java) +/** Samples for AdaptiveApplicationControls Delete. */ +public final class AdaptiveApplicationControlsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/DeleteAdaptiveApplicationControls_example.json + */ + /** + * Sample code: Delete an application control machine group. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteAnApplicationControlMachineGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.adaptiveApplicationControls().deleteWithResponse("centralus", "GROUP1", Context.NONE); + } +} +``` -### SqlVulnerabilityAssessmentScanResults +### AdaptiveApplicationControls_Get -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScanResultsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScanResultsListSamples.java) +```java +import com.azure.core.util.Context; -### SqlVulnerabilityAssessmentScans +/** Samples for AdaptiveApplicationControls Get. */ +public final class AdaptiveApplicationControlsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/GetAdaptiveApplicationControlsGroup_example.json + */ + /** + * Sample code: Gets a configured application control VM/server group. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsAConfiguredApplicationControlVMServerGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.adaptiveApplicationControls().getWithResponse("centralus", "ERELGROUP1", Context.NONE); + } +} +``` -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScansGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScansListSamples.java) +### AdaptiveApplicationControls_List -### SubAssessments +```java +import com.azure.core.util.Context; -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsListSamples.java) -- [ListAll](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsListAllSamples.java) +/** Samples for AdaptiveApplicationControls List. */ +public final class AdaptiveApplicationControlsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/GetAdaptiveApplicationControlsSubscription_example.json + */ + /** + * Sample code: Gets a list of application control groups of machines for the subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsAListOfApplicationControlGroupsOfMachinesForTheSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.adaptiveApplicationControls().listWithResponse(true, false, Context.NONE); + } +} +``` -### Tasks +### AdaptiveApplicationControls_Put -- [GetResourceGroupLevelTask](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksGetResourceGroupLevelTaskSamples.java) -- [GetSubscriptionLevelTask](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksGetSubscriptionLevelTaskSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListSamples.java) -- [ListByHomeRegion](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListByHomeRegionSamples.java) -- [ListByResourceGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListByResourceGroupSamples.java) -- [UpdateResourceGroupLevelTaskState](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksUpdateResourceGroupLevelTaskStateSamples.java) -- [UpdateSubscriptionLevelTaskState](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksUpdateSubscriptionLevelTaskStateSamples.java) +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.models.AdaptiveApplicationControlGroup; +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.UserRecommendation; +import com.azure.resourcemanager.security.models.VmRecommendation; +import java.util.Arrays; -### Topology +/** Samples for AdaptiveApplicationControls Put. */ +public final class AdaptiveApplicationControlsPutSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/PutAdaptiveApplicationControls_example.json + */ + /** + * Sample code: Update an application control machine group by adding a new application. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateAnApplicationControlMachineGroupByAddingANewApplication( + com.azure.resourcemanager.security.SecurityManager manager) { + AdaptiveApplicationControlGroup resource = + manager.adaptiveApplicationControls().getWithResponse("centralus", "ERELGROUP1", Context.NONE).getValue(); + resource + .update() + .withEnforcementMode(EnforcementMode.AUDIT) + .withProtectionMode( + new ProtectionMode() + .withExe(EnforcementMode.AUDIT) + .withMsi(EnforcementMode.NONE) + .withScript(EnforcementMode.NONE)) + .withVmRecommendations( + Arrays + .asList( + new VmRecommendation() + .withConfigurationStatus(ConfigurationStatus.CONFIGURED) + .withRecommendationAction(RecommendationAction.RECOMMENDED) + .withResourceId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/erelh-stable/providers/microsoft.compute/virtualmachines/erelh-16090") + .withEnforcementSupport(EnforcementSupport.SUPPORTED), + new VmRecommendation() + .withConfigurationStatus(ConfigurationStatus.CONFIGURED) + .withRecommendationAction(RecommendationAction.RECOMMENDED) + .withResourceId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/matanvs/providers/microsoft.compute/virtualmachines/matanvs19") + .withEnforcementSupport(EnforcementSupport.SUPPORTED))) + .withPathRecommendations( + Arrays + .asList( + new PathRecommendation() + .withPath("[Exe] O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\*\\*\\0.0.0.0") + .withAction(RecommendationAction.RECOMMENDED) + .withType(RecommendationType.fromString("PublisherSignature")) + .withPublisherInfo( + new PublisherInfo() + .withPublisherName("O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US") + .withProductName("*") + .withBinaryName("*") + .withVersion("0.0.0.0")) + .withCommon(true) + .withUserSids(Arrays.asList("S-1-1-0")) + .withUsernames( + Arrays + .asList( + new UserRecommendation() + .withUsername("Everyone") + .withRecommendationAction(RecommendationAction.RECOMMENDED))) + .withFileType(FileType.EXE) + .withConfigurationStatus(ConfigurationStatus.CONFIGURED), + new PathRecommendation() + .withPath("%OSDRIVE%\\WINDOWSAZURE\\SECAGENT\\WASECAGENTPROV.EXE") + .withAction(RecommendationAction.RECOMMENDED) + .withType(RecommendationType.fromString("ProductSignature")) + .withPublisherInfo( + new PublisherInfo() + .withPublisherName("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN") + .withProductName("MICROSOFT® COREXT") + .withBinaryName("*") + .withVersion("0.0.0.0")) + .withCommon(true) + .withUserSids(Arrays.asList("S-1-1-0")) + .withUsernames( + Arrays + .asList( + new UserRecommendation() + .withUsername("NT AUTHORITY\\SYSTEM") + .withRecommendationAction(RecommendationAction.RECOMMENDED))) + .withFileType(FileType.EXE) + .withConfigurationStatus(ConfigurationStatus.CONFIGURED), + new PathRecommendation() + .withPath("%OSDRIVE%\\WINDOWSAZURE\\PACKAGES_201973_7415\\COLLECTGUESTLOGS.EXE") + .withAction(RecommendationAction.RECOMMENDED) + .withType(RecommendationType.fromString("PublisherSignature")) + .withPublisherInfo( + new PublisherInfo() + .withPublisherName("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN") + .withProductName("*") + .withBinaryName("*") + .withVersion("0.0.0.0")) + .withCommon(true) + .withUserSids(Arrays.asList("S-1-1-0")) + .withUsernames( + Arrays + .asList( + new UserRecommendation() + .withUsername("NT AUTHORITY\\SYSTEM") + .withRecommendationAction(RecommendationAction.RECOMMENDED))) + .withFileType(FileType.EXE) + .withConfigurationStatus(ConfigurationStatus.CONFIGURED), + new PathRecommendation() + .withPath("C:\\directory\\file.exe") + .withAction(RecommendationAction.ADD) + .withType(RecommendationType.fromString("File")) + .withCommon(true))) + .apply(); + } +} +``` -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyListSamples.java) -- [ListByHomeRegion](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyListByHomeRegionSamples.java) +### AdaptiveNetworkHardenings_Enforce -### WorkspaceSettings +```java +import com.azure.core.util.Context; +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; + +/** Samples for AdaptiveNetworkHardenings Enforce. */ +public final class AdaptiveNetworkHardeningsEnforceSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/EnforceAdaptiveNetworkHardeningRules_example.json + */ + /** + * Sample code: Enforces the given rules on the NSG(s) listed in the request. + * + * @param manager Entry point to SecurityManager. + */ + public static void enforcesTheGivenRulesOnTheNSGSListedInTheRequest( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .adaptiveNetworkHardenings() + .enforce( + "rg1", + "Microsoft.Compute", + "virtualMachines", + "vm1", + "default", + new AdaptiveNetworkHardeningEnforceRequest() + .withRules( + Arrays + .asList( + new Rule() + .withName("rule1") + .withDirection(Direction.INBOUND) + .withDestinationPort(3389) + .withProtocols(Arrays.asList(TransportProtocol.TCP)) + .withIpAddresses(Arrays.asList("100.10.1.1", "200.20.2.2", "81.199.3.0/24")), + new Rule() + .withName("rule2") + .withDirection(Direction.INBOUND) + .withDestinationPort(22) + .withProtocols(Arrays.asList(TransportProtocol.TCP)) + .withIpAddresses(Arrays.asList()))) + .withNetworkSecurityGroups( + Arrays + .asList( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1", + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg2")), + Context.NONE); + } +} +``` + +### AdaptiveNetworkHardenings_Get + +```java +import com.azure.core.util.Context; + +/** Samples for AdaptiveNetworkHardenings Get. */ +public final class AdaptiveNetworkHardeningsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/GetAdaptiveNetworkHardening_example.json + */ + /** + * Sample code: Get a single Adaptive Network Hardening resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void getASingleAdaptiveNetworkHardeningResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .adaptiveNetworkHardenings() + .getWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", "default", Context.NONE); + } +} +``` + +### AdaptiveNetworkHardenings_ListByExtendedResource + +```java +import com.azure.core.util.Context; + +/** Samples for AdaptiveNetworkHardenings ListByExtendedResource. */ +public final class AdaptiveNetworkHardeningsListByExtendedResourceSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/ListByExtendedResourceAdaptiveNetworkHardenings_example.json + */ + /** + * Sample code: List Adaptive Network Hardenings resources of an extended resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAdaptiveNetworkHardeningsResourcesOfAnExtendedResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .adaptiveNetworkHardenings() + .listByExtendedResource("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); + } +} +``` + +### AdvancedThreatProtection_Create + +```java +/** Samples for AdvancedThreatProtection Create. */ +public final class AdvancedThreatProtectionCreateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/PutAdvancedThreatProtectionSettings_example.json + */ + /** + * Sample code: Creates or updates the Advanced Threat Protection settings on a specified resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void createsOrUpdatesTheAdvancedThreatProtectionSettingsOnASpecifiedResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .advancedThreatProtections() + .define() + .withExistingResourceId( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount") + .withIsEnabled(true) + .create(); + } +} +``` + +### AdvancedThreatProtection_Get + +```java +import com.azure.core.util.Context; + +/** Samples for AdvancedThreatProtection Get. */ +public final class AdvancedThreatProtectionGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/GetAdvancedThreatProtectionSettings_example.json + */ + /** + * Sample code: Gets the Advanced Threat Protection settings for the specified resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsTheAdvancedThreatProtectionSettingsForTheSpecifiedResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .advancedThreatProtections() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", + Context.NONE); + } +} +``` + +### Alerts_GetResourceGroupLevel + +```java +import com.azure.core.util.Context; + +/** Samples for Alerts GetResourceGroupLevel. */ +public final class AlertsGetResourceGroupLevelSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/GetAlertResourceGroupLocation_example.json + */ + /** + * Sample code: Get security alert on a resource group from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityAlertOnAResourceGroupFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .alerts() + .getResourceGroupLevelWithResponse( + "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", "myRg1", Context.NONE); + } +} +``` + +### Alerts_GetSubscriptionLevel + +```java +import com.azure.core.util.Context; + +/** Samples for Alerts GetSubscriptionLevel. */ +public final class AlertsGetSubscriptionLevelSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/GetAlertSubscriptionLocation_example.json + */ + /** + * Sample code: Get security alert on a subscription from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityAlertOnASubscriptionFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .alerts() + .getSubscriptionLevelWithResponse( + "westeurope", "2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA", Context.NONE); + } +} +``` + +### Alerts_List + +```java +import com.azure.core.util.Context; + +/** Samples for Alerts List. */ +public final class AlertsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/GetAlertsSubscription_example.json + */ + /** + * Sample code: Get security alerts on a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityAlertsOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts().list(Context.NONE); + } +} +``` + +### Alerts_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Alerts ListByResourceGroup. */ +public final class AlertsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/GetAlertsResourceGroup_example.json + */ + /** + * Sample code: Get security alerts on a resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityAlertsOnAResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts().listByResourceGroup("myRg1", Context.NONE); + } +} +``` + +### Alerts_ListResourceGroupLevelByRegion + +```java +import com.azure.core.util.Context; + +/** Samples for Alerts ListResourceGroupLevelByRegion. */ +public final class AlertsListResourceGroupLevelByRegionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/GetAlertsResourceGroupLocation_example.json + */ + /** + * Sample code: Get security alerts on a resource group from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityAlertsOnAResourceGroupFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts().listResourceGroupLevelByRegion("westeurope", "myRg1", Context.NONE); + } +} +``` + +### Alerts_ListSubscriptionLevelByRegion + +```java +import com.azure.core.util.Context; + +/** Samples for Alerts ListSubscriptionLevelByRegion. */ +public final class AlertsListSubscriptionLevelByRegionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/GetAlertsSubscriptionsLocation_example.json + */ + /** + * Sample code: Get security alerts on a subscription from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityAlertsOnASubscriptionFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts().listSubscriptionLevelByRegion("westeurope", Context.NONE); + } +} +``` + +### Alerts_Simulate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.models.AlertSimulatorBundlesRequestProperties; +import com.azure.resourcemanager.security.models.AlertSimulatorRequestBody; +import com.azure.resourcemanager.security.models.BundleType; +import java.util.Arrays; + +/** Samples for Alerts Simulate. */ +public final class AlertsSimulateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/SimulateAlerts_example.json + */ + /** + * Sample code: Simulate security alerts on a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void simulateSecurityAlertsOnASubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .alerts() + .simulate( + "centralus", + new AlertSimulatorRequestBody() + .withProperties( + new AlertSimulatorBundlesRequestProperties() + .withBundles( + Arrays + .asList( + BundleType.APP_SERVICES, + BundleType.DNS, + BundleType.KEY_VAULTS, + BundleType.KUBERNETES_SERVICE, + BundleType.RESOURCE_MANAGER, + BundleType.SQL_SERVERS, + BundleType.STORAGE_ACCOUNTS, + BundleType.VIRTUAL_MACHINES))), + Context.NONE); + } +} +``` + +### Alerts_UpdateResourceGroupLevelStateToActivate + +```java +import com.azure.core.util.Context; + +/** Samples for Alerts UpdateResourceGroupLevelStateToActivate. */ +public final class AlertsUpdateResourceGroupLevelStateToActivateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_example.json + */ + /** + * Sample code: Update security alert state on a resource group from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .alerts() + .updateResourceGroupLevelStateToActivateWithResponse( + "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", "myRg2", Context.NONE); + } +} +``` + +### Alerts_UpdateResourceGroupLevelStateToDismiss + +```java +import com.azure.core.util.Context; + +/** Samples for Alerts UpdateResourceGroupLevelStateToDismiss. */ +public final class AlertsUpdateResourceGroupLevelStateToDismissSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_example.json + */ + /** + * Sample code: Update security alert state on a resource group from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .alerts() + .updateResourceGroupLevelStateToDismissWithResponse( + "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", "myRg2", Context.NONE); + } +} +``` + +### Alerts_UpdateResourceGroupLevelStateToResolve + +```java +import com.azure.core.util.Context; + +/** Samples for Alerts UpdateResourceGroupLevelStateToResolve. */ +public final class AlertsUpdateResourceGroupLevelStateToResolveSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_resolve_example.json + */ + /** + * Sample code: Update security alert state on a resource group from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .alerts() + .updateResourceGroupLevelStateToResolveWithResponse( + "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", "myRg2", Context.NONE); + } +} +``` + +### Alerts_UpdateSubscriptionLevelStateToActivate + +```java +import com.azure.core.util.Context; + +/** Samples for Alerts UpdateSubscriptionLevelStateToActivate. */ +public final class AlertsUpdateSubscriptionLevelStateToActivateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_example.json + */ + /** + * Sample code: Update security alert state on a subscription from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .alerts() + .updateSubscriptionLevelStateToActivateWithResponse( + "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", Context.NONE); + } +} +``` + +### Alerts_UpdateSubscriptionLevelStateToDismiss + +```java +import com.azure.core.util.Context; + +/** Samples for Alerts UpdateSubscriptionLevelStateToDismiss. */ +public final class AlertsUpdateSubscriptionLevelStateToDismissSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_example.json + */ + /** + * Sample code: Update security alert state on a subscription from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .alerts() + .updateSubscriptionLevelStateToDismissWithResponse( + "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", Context.NONE); + } +} +``` + +### Alerts_UpdateSubscriptionLevelStateToResolve + +```java +import com.azure.core.util.Context; + +/** Samples for Alerts UpdateSubscriptionLevelStateToResolve. */ +public final class AlertsUpdateSubscriptionLevelStateToResolveSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_resolve_example.json + */ + /** + * Sample code: Update security alert state on a subscription from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .alerts() + .updateSubscriptionLevelStateToResolveWithResponse( + "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", Context.NONE); + } +} +``` + +### AlertsSuppressionRules_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for AlertsSuppressionRules Delete. */ +public final class AlertsSuppressionRulesDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/DeleteAlertsSuppressionRule_example.json + */ + /** + * Sample code: Delete suppression rule data for a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteSuppressionRuleDataForASubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alertsSuppressionRules().deleteWithResponse("dismissIpAnomalyAlerts", Context.NONE); + } +} +``` + +### AlertsSuppressionRules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for AlertsSuppressionRules Get. */ +public final class AlertsSuppressionRulesGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRule_example.json + */ + /** + * Sample code: Get suppression alert rule for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSuppressionAlertRuleForSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alertsSuppressionRules().getWithResponse("dismissIpAnomalyAlerts", Context.NONE); + } +} +``` + +### AlertsSuppressionRules_List + +```java +import com.azure.core.util.Context; + +/** Samples for AlertsSuppressionRules List. */ +public final class AlertsSuppressionRulesListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRules_example.json + */ + /** + * Sample code: Get suppression rules for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSuppressionRulesForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.alertsSuppressionRules().list(null, Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRulesWithAlertType_example.json + */ + /** + * Sample code: Get suppression alert rule for subscription, filtered by AlertType. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSuppressionAlertRuleForSubscriptionFilteredByAlertType( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alertsSuppressionRules().list("IpAnomaly", Context.NONE); + } +} +``` + +### AlertsSuppressionRules_Update + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; +import com.azure.resourcemanager.security.models.RuleState; +import com.azure.resourcemanager.security.models.ScopeElement; +import com.azure.resourcemanager.security.models.SuppressionAlertsScope; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AlertsSuppressionRules Update. */ +public final class AlertsSuppressionRulesUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/PutAlertsSuppressionRule_example.json + */ + /** + * Sample code: Update or create suppression rule for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateOrCreateSuppressionRuleForSubscription( + com.azure.resourcemanager.security.SecurityManager manager) throws IOException { + manager + .alertsSuppressionRules() + .updateWithResponse( + "dismissIpAnomalyAlerts", + new AlertsSuppressionRuleInner() + .withAlertType("IpAnomaly") + .withExpirationDateUtc(OffsetDateTime.parse("2019-12-01T19:50:47.083633Z")) + .withReason("FalsePositive") + .withState(RuleState.ENABLED) + .withComment("Test VM") + .withSuppressionAlertsScope( + new SuppressionAlertsScope() + .withAllOf( + Arrays + .asList( + new ScopeElement() + .withField("entities.ip.address") + .withAdditionalProperties( + mapOf( + "in", + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "[\"104.215.95.187\",\"52.164.206.56\"]", + Object.class, + SerializerEncoding.JSON))), + new ScopeElement() + .withField("entities.process.commandline") + .withAdditionalProperties(mapOf("contains", "POWERSHELL.EXE"))))), + Context.NONE); + } + + @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; + } +} +``` + +### AllowedConnections_Get + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.models.ConnectionType; + +/** Samples for AllowedConnections Get. */ +public final class AllowedConnectionsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnections_example.json + */ + /** + * Sample code: Get allowed connections. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAllowedConnections(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .allowedConnections() + .getWithResponse("myResourceGroup", "centralus", ConnectionType.INTERNAL, Context.NONE); + } +} +``` + +### AllowedConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for AllowedConnections List. */ +public final class AllowedConnectionsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnectionsSubscription_example.json + */ + /** + * Sample code: Get allowed connections on a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAllowedConnectionsOnASubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.allowedConnections().list(Context.NONE); + } +} +``` + +### AllowedConnections_ListByHomeRegion + +```java +import com.azure.core.util.Context; + +/** Samples for AllowedConnections ListByHomeRegion. */ +public final class AllowedConnectionsListByHomeRegionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnectionsSubscriptionLocation_example.json + */ + /** + * Sample code: Get allowed connections on a subscription from security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAllowedConnectionsOnASubscriptionFromSecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.allowedConnections().listByHomeRegion("centralus", Context.NONE); + } +} +``` + +### Assessments_CreateOrUpdate + +```java +import com.azure.resourcemanager.security.models.AssessmentStatus; +import com.azure.resourcemanager.security.models.AssessmentStatusCode; +import com.azure.resourcemanager.security.models.AzureResourceDetails; + +/** Samples for Assessments CreateOrUpdate. */ +public final class AssessmentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/PutAssessment_example.json + */ + /** + * Sample code: Create security recommendation task on a resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void createSecurityRecommendationTaskOnAResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .assessments() + .define("8bb8be0a-6010-4789-812f-e4d661c4ed0e") + .withExistingResourceId( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2") + .withStatus(new AssessmentStatus().withCode(AssessmentStatusCode.HEALTHY)) + .withResourceDetails(new AzureResourceDetails()) + .create(); + } +} +``` + +### Assessments_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Assessments Delete. */ +public final class AssessmentsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/DeleteAssessment_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 + .assessments() + .deleteWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", + "8bb8be0a-6010-4789-812f-e4d661c4ed0e", + Context.NONE); + } +} +``` + +### Assessments_Get + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.models.ExpandEnum; + +/** Samples for Assessments Get. */ +public final class AssessmentsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/GetAssessmentWithExpand_example.json + */ + /** + * Sample code: Get security recommendation task from security data location with expand parameter. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityRecommendationTaskFromSecurityDataLocationWithExpandParameter( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .assessments() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", + "21300918-b2e3-0346-785f-c77ff57d243b", + ExpandEnum.LINKS, + Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/GetAssessment_example.json + */ + /** + * Sample code: Get security recommendation task from security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityRecommendationTaskFromSecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .assessments() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", + "21300918-b2e3-0346-785f-c77ff57d243b", + null, + Context.NONE); + } +} +``` + +### Assessments_List + +```java +import com.azure.core.util.Context; + +/** Samples for Assessments List. */ +public final class AssessmentsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/ListAssessments_example.json + */ + /** + * Sample code: List security assessments. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecurityAssessments(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessments().list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", Context.NONE); + } +} +``` + +### AssessmentsMetadata_CreateInSubscription + +```java +import com.azure.resourcemanager.security.models.AssessmentType; +import com.azure.resourcemanager.security.models.Categories; +import com.azure.resourcemanager.security.models.ImplementationEffort; +import com.azure.resourcemanager.security.models.Severity; +import com.azure.resourcemanager.security.models.Threats; +import com.azure.resourcemanager.security.models.UserImpact; +import java.util.Arrays; + +/** Samples for AssessmentsMetadata CreateInSubscription. */ +public final class AssessmentsMetadataCreateInSubscriptionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/CreateAssessmentsMetadata_subscription_example.json + */ + /** + * Sample code: Create security assessment metadata for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void createSecurityAssessmentMetadataForSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .assessmentsMetadatas() + .define("ca039e75-a276-4175-aebc-bcd41e4b14b7") + .withDisplayName("Install endpoint protection solution on virtual machine scale sets") + .withDescription( + "Install an endpoint protection solution on your virtual machines scale sets, to protect them from" + + " threats and vulnerabilities.") + .withRemediationDescription( + "To install an endpoint protection solution: 1. Follow" + + " the instructions in How do I turn on antimalware in my virtual machine scale set") + .withCategories(Arrays.asList(Categories.COMPUTE)) + .withSeverity(Severity.MEDIUM) + .withUserImpact(UserImpact.LOW) + .withImplementationEffort(ImplementationEffort.LOW) + .withThreats(Arrays.asList(Threats.DATA_EXFILTRATION, Threats.DATA_SPILLAGE, Threats.MALICIOUS_INSIDER)) + .withAssessmentType(AssessmentType.CUSTOMER_MANAGED) + .create(); + } +} +``` + +### AssessmentsMetadata_DeleteInSubscription + +```java +import com.azure.core.util.Context; + +/** Samples for AssessmentsMetadata DeleteInSubscription. */ +public final class AssessmentsMetadataDeleteInSubscriptionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/DeleteAssessmentsMetadata_subscription_example.json + */ + /** + * Sample code: Delete a security assessment metadata for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteASecurityAssessmentMetadataForSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .assessmentsMetadatas() + .deleteInSubscriptionWithResponse("ca039e75-a276-4175-aebc-bcd41e4b14b7", Context.NONE); + } +} +``` + +### AssessmentsMetadata_Get + +```java +import com.azure.core.util.Context; + +/** Samples for AssessmentsMetadata Get. */ +public final class AssessmentsMetadataGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json + */ + /** + * Sample code: Get security assessment metadata. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityAssessmentMetadata(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessmentsMetadatas().getWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", Context.NONE); + } +} +``` + +### AssessmentsMetadata_GetInSubscription + +```java +import com.azure.core.util.Context; + +/** Samples for AssessmentsMetadata GetInSubscription. */ +public final class AssessmentsMetadataGetInSubscriptionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/GetAssessmentsMetadata_subscription_example.json + */ + /** + * Sample code: Get security assessment metadata for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityAssessmentMetadataForSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .assessmentsMetadatas() + .getInSubscriptionWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", Context.NONE); + } +} +``` + +### AssessmentsMetadata_List + +```java +import com.azure.core.util.Context; + +/** Samples for AssessmentsMetadata List. */ +public final class AssessmentsMetadataListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json + */ + /** + * Sample code: List security assessment metadata. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecurityAssessmentMetadata(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessmentsMetadatas().list(Context.NONE); + } +} +``` + +### AssessmentsMetadata_ListBySubscription + +```java +import com.azure.core.util.Context; + +/** Samples for AssessmentsMetadata ListBySubscription. */ +public final class AssessmentsMetadataListBySubscriptionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/ListAssessmentsMetadata_subscription_example.json + */ + /** + * Sample code: List security assessment metadata for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecurityAssessmentMetadataForSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessmentsMetadatas().listBySubscription(Context.NONE); + } +} +``` + +### AutoProvisioningSettings_Create + +```java +import com.azure.resourcemanager.security.models.AutoProvision; + +/** Samples for AutoProvisioningSettings Create. */ +public final class AutoProvisioningSettingsCreateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/CreateAutoProvisioningSettingsSubscription_example.json + */ + /** + * Sample code: Create auto provisioning settings for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void createAutoProvisioningSettingsForSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.autoProvisioningSettings().define("default").withAutoProvision(AutoProvision.ON).create(); + } +} +``` + +### AutoProvisioningSettings_Get + +```java +import com.azure.core.util.Context; + +/** Samples for AutoProvisioningSettings Get. */ +public final class AutoProvisioningSettingsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/GetAutoProvisioningSettingSubscription_example.json + */ + /** + * Sample code: Get an auto provisioning setting for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAnAutoProvisioningSettingForSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.autoProvisioningSettings().getWithResponse("default", Context.NONE); + } +} +``` + +### AutoProvisioningSettings_List + +```java +import com.azure.core.util.Context; + +/** Samples for AutoProvisioningSettings List. */ +public final class AutoProvisioningSettingsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/GetAutoProvisioningSettingsSubscription_example.json + */ + /** + * Sample code: Get auto provisioning settings for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAutoProvisioningSettingsForSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.autoProvisioningSettings().list(Context.NONE); + } +} +``` + +### Automations_CreateOrUpdate + +```java +import com.azure.resourcemanager.security.models.AutomationActionLogicApp; +import com.azure.resourcemanager.security.models.AutomationRuleSet; +import com.azure.resourcemanager.security.models.AutomationScope; +import com.azure.resourcemanager.security.models.AutomationSource; +import com.azure.resourcemanager.security.models.AutomationTriggeringRule; +import com.azure.resourcemanager.security.models.EventSource; +import com.azure.resourcemanager.security.models.Operator; +import com.azure.resourcemanager.security.models.PropertyType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Automations CreateOrUpdate. */ +public final class AutomationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutAutomationAllAssessments_example.json + */ + /** + * Sample code: Create or update a security automation for all assessments (including all severities). + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateASecurityAutomationForAllAssessmentsIncludingAllSeverities( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .automations() + .define("exampleAutomation") + .withRegion("Central US") + .withExistingResourceGroup("exampleResourceGroup") + .withTags(mapOf()) + .withDescription( + "An example of a security automation that triggers one LogicApp resource (myTest1) on any security" + + " assessment") + .withIsEnabled(true) + .withScopes( + Arrays + .asList( + new AutomationScope() + .withDescription( + "A description that helps to identify this scope - for example: security assessments" + + " that relate to the resource group myResourceGroup within the subscription" + + " a5caac9c-5c04-49af-b3d0-e204f40345d5") + .withScopePath( + "/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) + .withSources(Arrays.asList(new AutomationSource().withEventSource(EventSource.ASSESSMENTS))) + .withActions( + Arrays + .asList( + new AutomationActionLogicApp() + .withLogicAppResourceId( + "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") + .withUri("https://exampleTriggerUri1.com"))) + .create(); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutDisableAutomation_example.json + */ + /** + * Sample code: Disable or enable a security automation. + * + * @param manager Entry point to SecurityManager. + */ + public static void disableOrEnableASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .automations() + .define("exampleAutomation") + .withRegion("Central US") + .withExistingResourceGroup("exampleResourceGroup") + .withTags(mapOf()) + .withDescription( + "An example of a security automation that triggers one LogicApp resource (myTest1) on any security" + + " assessment of type customAssessment") + .withIsEnabled(false) + .withScopes( + Arrays + .asList( + new AutomationScope() + .withDescription( + "A description that helps to identify this scope - for example: security assessments" + + " that relate to the resource group myResourceGroup within the subscription" + + " a5caac9c-5c04-49af-b3d0-e204f40345d5") + .withScopePath( + "/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) + .withSources( + Arrays + .asList( + new AutomationSource() + .withEventSource(EventSource.ASSESSMENTS) + .withRuleSets( + Arrays + .asList( + new AutomationRuleSet() + .withRules( + Arrays + .asList( + new AutomationTriggeringRule() + .withPropertyJPath("$.Entity.AssessmentType") + .withPropertyType(PropertyType.STRING) + .withExpectedValue("customAssessment") + .withOperator(Operator.EQUALS))))))) + .withActions( + Arrays + .asList( + new AutomationActionLogicApp() + .withLogicAppResourceId( + "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") + .withUri("https://exampleTriggerUri1.com"))) + .create(); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutAutomationHighSeverityAssessments_example.json + */ + /** + * Sample code: Create or update a security automation for all high severity assessments. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateASecurityAutomationForAllHighSeverityAssessments( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .automations() + .define("exampleAutomation") + .withRegion("Central US") + .withExistingResourceGroup("exampleResourceGroup") + .withTags(mapOf()) + .withDescription( + "An example of a security automation that triggers one LogicApp resource (myTest1) on any high severity" + + " security assessment") + .withIsEnabled(true) + .withScopes( + Arrays + .asList( + new AutomationScope() + .withDescription( + "A description that helps to identify this scope - for example: security assessments" + + " that relate to the resource group myResourceGroup within the subscription" + + " a5caac9c-5c04-49af-b3d0-e204f40345d5") + .withScopePath( + "/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) + .withSources( + Arrays + .asList( + new AutomationSource() + .withEventSource(EventSource.ASSESSMENTS) + .withRuleSets( + Arrays + .asList( + new AutomationRuleSet() + .withRules( + Arrays + .asList( + new AutomationTriggeringRule() + .withPropertyJPath("properties.metadata.severity") + .withPropertyType(PropertyType.STRING) + .withExpectedValue("High") + .withOperator(Operator.EQUALS))))))) + .withActions( + Arrays + .asList( + new AutomationActionLogicApp() + .withLogicAppResourceId( + "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") + .withUri("https://exampleTriggerUri1.com"))) + .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; + } +} +``` + +### Automations_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Automations Delete. */ +public final class AutomationsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/DeleteAutomation_example.json + */ + /** + * Sample code: Delete a security automation. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.automations().deleteWithResponse("myRg", "myAutomationName", Context.NONE); + } +} +``` + +### Automations_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Automations GetByResourceGroup. */ +public final class AutomationsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationResourceGroup_example.json + */ + /** + * Sample code: Retrieve a security automation. + * + * @param manager Entry point to SecurityManager. + */ + public static void retrieveASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.automations().getByResourceGroupWithResponse("exampleResourceGroup", "exampleAutomation", Context.NONE); + } +} +``` + +### Automations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Automations List. */ +public final class AutomationsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationsSubscription_example.json + */ + /** + * Sample code: List all security automations of a specified subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAllSecurityAutomationsOfASpecifiedSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.automations().list(Context.NONE); + } +} +``` + +### Automations_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Automations ListByResourceGroup. */ +public final class AutomationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationsResourceGroup_example.json + */ + /** + * Sample code: List all security automations of a specified resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAllSecurityAutomationsOfASpecifiedResourceGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.automations().listByResourceGroup("exampleResourceGroup", Context.NONE); + } +} +``` + +### Automations_Validate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.AutomationInner; +import com.azure.resourcemanager.security.models.AutomationActionLogicApp; +import com.azure.resourcemanager.security.models.AutomationRuleSet; +import com.azure.resourcemanager.security.models.AutomationScope; +import com.azure.resourcemanager.security.models.AutomationSource; +import com.azure.resourcemanager.security.models.AutomationTriggeringRule; +import com.azure.resourcemanager.security.models.EventSource; +import com.azure.resourcemanager.security.models.Operator; +import com.azure.resourcemanager.security.models.PropertyType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Automations Validate. */ +public final class AutomationsValidateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/ValidateAutomation_example.json + */ + /** + * Sample code: Validate the security automation model before create or update. + * + * @param manager Entry point to SecurityManager. + */ + public static void validateTheSecurityAutomationModelBeforeCreateOrUpdate( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .automations() + .validateWithResponse( + "exampleResourceGroup", + "exampleAutomation", + new AutomationInner() + .withLocation("Central US") + .withTags(mapOf()) + .withDescription( + "An example of a security automation that triggers one LogicApp resource (myTest1) on any" + + " security assessment of type customAssessment") + .withIsEnabled(true) + .withScopes( + Arrays + .asList( + new AutomationScope() + .withDescription( + "A description that helps to identify this scope - for example: security" + + " assessments that relate to the resource group myResourceGroup within" + + " the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5") + .withScopePath( + "/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) + .withSources( + Arrays + .asList( + new AutomationSource() + .withEventSource(EventSource.ASSESSMENTS) + .withRuleSets( + Arrays + .asList( + new AutomationRuleSet() + .withRules( + Arrays + .asList( + new AutomationTriggeringRule() + .withPropertyJPath("$.Entity.AssessmentType") + .withPropertyType(PropertyType.STRING) + .withExpectedValue("customAssessment") + .withOperator(Operator.EQUALS))))))) + .withActions( + Arrays + .asList( + new AutomationActionLogicApp() + .withLogicAppResourceId( + "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") + .withUri("https://exampleTriggerUri1.com"))), + Context.NONE); + } + + @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; + } +} +``` + +### ComplianceResults_Get + +```java +import com.azure.core.util.Context; + +/** 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", Context.NONE); + } +} +``` + +### ComplianceResults_List + +```java +import com.azure.core.util.Context; + +/** 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", Context.NONE); + } +} +``` + +### Compliances_Get + +```java +import com.azure.core.util.Context; + +/** 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", Context.NONE); + } +} +``` + +### Compliances_List + +```java +import com.azure.core.util.Context; + +/** 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", 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("6efg587hra2568as34d22326b044cc20dc2af") + .withPrivateKey( + "-----BEGIN PRIVATE KEY-----\n" + + "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCpxYHcLzcDZ6/Q\n" + + "AeQZnQXM5GTb3p09Xsbjo2T2F61b6I7FZiQXBrbw3Zf0CUCkkqTTpD5xifl82yQ6\n" + + "89V7SAe8hxI7esAcVDhm/aJMqzVjHLISAU2L3li1sn0jjY2oYtndwN6bRivP8O6t\n" + + "9F+W6E0zMlbCxtpZEHLbb6WxlJJrwEQ0MPH2yOCwZUQi6NHksAtEzX2nNKJNyUC7\n" + + "QyBVHHMm34H2bmZwsuQp3y2otpcJ9tJnVmYfC3k/w4x2L+DIK7JnQP/C1wQqu2du\n" + + "c0w6sydF6RhLoHButrVdYRJTdfK4k03SsSTyMqZ+f7LNnKw3xenzw1VmEpk8mvoQ\n" + + "t08tCBOrAgMBAAECggEAByzz6iyMtLYjNjV+QJ7kad6VbL2iA8AHxANZ9xTVHPdd\n" + + "YXaJu/dqsA+NpqDlfI8+LDva782XH/HbPCqmMUnAGfXTjXQIvqnIoIHD5F2wKfpC\n" + + "hIRNlMXXFgbvRxtqi11yO+80+XcjzuwuCmgzyhsTeEB+bkkdXXpWgHPdmv3emnM6\n" + + "MQM9Zgrug0UndPmiUwKOcJSU4PlmlTpHEV4vA6JfA4bvphy9m1jxO5qWeah5yym2\n" + + "6FP5BRIDF98kFrDnSXJjajwgLCQ+MypFQXyax6XkxDxuKXbng1bv7eZDjqazIChk\n" + + "m0y14X0s0jnWc+AX8vfeSf7d+EsGdVinEwR1aAawEQKBgQDqDB0qxcIQ1oI1Kww8\n" + + "9vXefTiuWsf47F+fJ/DIOEbiRfE8IdCgmOABvcqJIoxW/DFMBEdLCcx73Km7pOmd\n" + + "Kg1ddScnaO8cOj2v/Ub+fAqVrA4ki4ViYP0A7/Nogga3Jr/x3ey5bitrIfFImteS\n" + + "CgBHBzZvoQpvO4lB2tKVgo2P9wKBgQC5sgTEq4sasRGSAY6lIoJno0I8w28a/16D\n" + + "es60XQeY1ger8uTGwlT02v/u/arDUmRLPClpujXq6gK29KvtRCHy7JkpGbqW2bZs\n" + + "PFKKWR7Tk3XPKYyjv94AIi5/xoFeDhS4lpAvy3Z5tQhYS6wqWKvT6yZQ3kM+Hfxs\n" + + "pHgvu3mU7QKBgQC9/E1k3hj1cBtMK4CIsHPPQljTd4+iacYJPPPAo6YuoVX8WPqw\n" + + "ksgrwbN59Fh1d8xQh5yTtgWOegYx8uFMGcm1lpbM7+pBQKm4hWGuzGQPMRZd5f/F\n" + + "ZzOZIi61I+9tlv/yxxIVR+/ozCm/pSneO04UWi9/F/uPZYW6tnWAtfRR6wKBgGsZ\n" + + "8MQaCK4JaI/klAhMghgSQnbXZXKVzUZaA3Rln6cX8u7KtgapOOTMlwaZie8Dy1LV\n" + + "TTFstAJcm9o3/h1nyYjZy3C4JTUyNpPwqs6enjf7edxVI4eidwFutZD+xcigqHTa\n" + + "aikW2atSrZB3fMIjyF7+5meH+hKOqvNiXOty3qn1AoGAZuVxYQy5FVq3YZxzr3Aa\n" + + "Am0ShoXTF6QYIbsaUiUGoa/NlHcw9V/lj4AqBRbxbaYMD+hz2J/od9cb268eJKY8\n" + + "3b6MvaUqdNhNnWodJXLhgtmGEHDKmTppz2JSTx/tVzCfhFdcOC79StZvcKLhtoFQ\n" + + "+/3lEw6NCIXzm5E4+dtJG4k=\n" + + "-----END PRIVATE KEY-----\n") + .withClientEmail("asc-135@asc-project-1234.iam.gserviceaccount.com") + .withClientId("105889053725632919854") + .withAuthUri("https://accounts.google.com/o/oauth2/auth") + .withTokenUri("https://oauth2.googleapis.com/token") + .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(""))) + .withAuthenticationDetails( + new AwsCredsAuthenticationDetailsProperties() + .withAwsAccessKeyId("AKIARPZCNODDNAEQFSOE") + .withAwsSecretAccessKey("")) + .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(""))) + .withAuthenticationDetails( + new AwAssumeRoleAuthenticationDetailsProperties() + .withAwsAssumeRoleArn("arn:aws:iam::81231569658:role/AscConnector") + .withAwsExternalId("20ff7fc3-e762-44dd-bd96-b71116dcdc23")) + .create(); + } +} +``` + +### Connectors_Delete + +```java +import com.azure.core.util.Context; + +/** 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", Context.NONE); + } +} +``` + +### Connectors_Get + +```java +import com.azure.core.util.Context; + +/** 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", Context.NONE); + } +} +``` + +### Connectors_List + +```java +import com.azure.core.util.Context; + +/** 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(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 +import com.azure.core.util.Context; + +/** 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() + .deleteWithResponse("TestResourceGroup", "MyCustomAssessmentAutomation", Context.NONE); + } +} +``` + +### CustomAssessmentAutomations_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** 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", Context.NONE); + } +} +``` + +### CustomAssessmentAutomations_List + +```java +import com.azure.core.util.Context; + +/** 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(Context.NONE); + } +} +``` + +### CustomAssessmentAutomations_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** 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", 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 +import com.azure.core.util.Context; + +/** 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() + .deleteWithResponse("TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", Context.NONE); + } +} +``` + +### CustomEntityStoreAssignments_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** 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", Context.NONE); + } +} +``` + +### CustomEntityStoreAssignments_List + +```java +import com.azure.core.util.Context; + +/** 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(Context.NONE); + } +} +``` + +### CustomEntityStoreAssignments_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** 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", Context.NONE); + } +} +``` + +### DeviceSecurityGroups_CreateOrUpdate + +```java +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/stable/2019-08-01/examples/DeviceSecurityGroups/PutDeviceSecurityGroups_example.json + */ + /** + * Sample code: Create or update a device security group for the specified IoT hub resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateADeviceSecurityGroupForTheSpecifiedIoTHubResource( + 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(); + } +} +``` + +### DeviceSecurityGroups_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for DeviceSecurityGroups Delete. */ +public final class DeviceSecurityGroupsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/DeleteDeviceSecurityGroups_example.json + */ + /** + * Sample code: Delete a device security group for the specified IoT Hub resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteADeviceSecurityGroupForTheSpecifiedIoTHubResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .deviceSecurityGroups() + .deleteWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", + "samplesecuritygroup", + Context.NONE); + } +} +``` + +### DeviceSecurityGroups_Get + +```java +import com.azure.core.util.Context; + +/** Samples for DeviceSecurityGroups Get. */ +public final class DeviceSecurityGroupsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/GetDeviceSecurityGroups_example.json + */ + /** + * Sample code: Get a device security group for the specified IoT Hub resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void getADeviceSecurityGroupForTheSpecifiedIoTHubResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .deviceSecurityGroups() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", + "samplesecuritygroup", + Context.NONE); + } +} +``` + +### DeviceSecurityGroups_List + +```java +import com.azure.core.util.Context; + +/** Samples for DeviceSecurityGroups List. */ +public final class DeviceSecurityGroupsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/ListDeviceSecurityGroups_example.json + */ + /** + * Sample code: List all device security groups for the specified IoT Hub resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAllDeviceSecurityGroupsForTheSpecifiedIoTHubResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .deviceSecurityGroups() + .list( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", + Context.NONE); + } +} +``` + +### DiscoveredSecuritySolutions_Get + +```java +import com.azure.core.util.Context; + +/** Samples for DiscoveredSecuritySolutions Get. */ +public final class DiscoveredSecuritySolutionsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionResourceGroupLocation_example.json + */ + /** + * Sample code: Get discovered security solution from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getDiscoveredSecuritySolutionFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.discoveredSecuritySolutions().getWithResponse("myRg2", "centralus", "paloalto7", Context.NONE); + } +} +``` + +### DiscoveredSecuritySolutions_List + +```java +import com.azure.core.util.Context; + +/** Samples for DiscoveredSecuritySolutions List. */ +public final class DiscoveredSecuritySolutionsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionsSubscription_example.json + */ + /** + * Sample code: Get discovered security solutions. + * + * @param manager Entry point to SecurityManager. + */ + public static void getDiscoveredSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { + manager.discoveredSecuritySolutions().list(Context.NONE); + } +} +``` + +### DiscoveredSecuritySolutions_ListByHomeRegion + +```java +import com.azure.core.util.Context; + +/** Samples for DiscoveredSecuritySolutions ListByHomeRegion. */ +public final class DiscoveredSecuritySolutionsListByHomeRegionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionsSubscriptionLocation_example.json + */ + /** + * Sample code: Get discovered security solutions from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getDiscoveredSecuritySolutionsFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.discoveredSecuritySolutions().listByHomeRegion("centralus", Context.NONE); + } +} +``` + +### ExternalSecuritySolutions_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ExternalSecuritySolutions Get. */ +public final class ExternalSecuritySolutionsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolution_example.json + */ + /** + * Sample code: Get external security solution. + * + * @param manager Entry point to SecurityManager. + */ + public static void getExternalSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .externalSecuritySolutions() + .getWithResponse( + "defaultresourcegroup-eus", + "centralus", + "aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus", + Context.NONE); + } +} +``` + +### ExternalSecuritySolutions_List + +```java +import com.azure.core.util.Context; + +/** 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(Context.NONE); + } +} +``` + +### ExternalSecuritySolutions_ListByHomeRegion + +```java +import com.azure.core.util.Context; + +/** Samples for ExternalSecuritySolutions ListByHomeRegion. */ +public final class ExternalSecuritySolutionsListByHomeRegionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolutionsSubscriptionLocation_example.json + */ + /** + * Sample code: Get external security solutions on a subscription from security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getExternalSecuritySolutionsOnASubscriptionFromSecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.externalSecuritySolutions().listByHomeRegion("centralus", Context.NONE); + } +} +``` + +### InformationProtectionPolicies_CreateOrUpdate + +```java +import com.azure.resourcemanager.security.models.InformationProtectionKeyword; +import com.azure.resourcemanager.security.models.InformationProtectionPoliciesInformationProtectionPolicyName; +import com.azure.resourcemanager.security.models.InformationType; +import com.azure.resourcemanager.security.models.SensitivityLabel; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +/** Samples for InformationProtectionPolicies CreateOrUpdate. */ +public final class InformationProtectionPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/CreateOrUpdateInformationProtectionPolicy_example.json + */ + /** + * Sample code: Create or update an information protection policy for a management group. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateAnInformationProtectionPolicyForAManagementGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .informationProtectionPolicies() + .define(InformationProtectionPoliciesInformationProtectionPolicyName.CUSTOM) + .withExistingScope("providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e") + .withLabels( + mapOf( + "1345da73-bc5a-4a8f-b7dd-3820eb713da8", + new SensitivityLabel().withDisplayName("Public").withOrder(100).withEnabled(true), + "575739d2-3d53-4df0-9042-4c7772d5c7b1", + new SensitivityLabel().withDisplayName("Confidential").withOrder(300).withEnabled(true), + "7aa516c7-5a53-4857-bc6e-6808c6acd542", + new SensitivityLabel().withDisplayName("General").withOrder(200).withEnabled(true))) + .withInformationTypes( + mapOf( + "3bf35491-99b8-41f2-86d5-c1200a7df658", + new InformationType() + .withDisplayName("Custom") + .withOrder(1400) + .withRecommendedLabelId(UUID.fromString("7aa516c7-5a53-4857-bc6e-6808c6acd542")) + .withEnabled(true) + .withCustom(true) + .withKeywords( + Arrays + .asList( + new InformationProtectionKeyword() + .withPattern("%custom%") + .withCustom(true) + .withCanBeNumeric(true))), + "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07", + new InformationType() + .withDisplayName("Networking") + .withOrder(100) + .withRecommendedLabelId(UUID.fromString("575739d2-3d53-4df0-9042-4c7772d5c7b1")) + .withEnabled(true) + .withCustom(false) + .withKeywords( + Arrays + .asList( + new InformationProtectionKeyword() + .withPattern("%networking%") + .withCustom(true) + .withCanBeNumeric(false))))) + .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; + } +} +``` + +### InformationProtectionPolicies_Get + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.models.InformationProtectionPoliciesInformationProtectionPolicyName; + +/** Samples for InformationProtectionPolicies Get. */ +public final class InformationProtectionPoliciesGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/GetCustomInformationProtectionPolicy_example.json + */ + /** + * Sample code: Get the customized information protection policy for a management group. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTheCustomizedInformationProtectionPolicyForAManagementGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .informationProtectionPolicies() + .getWithResponse( + "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", + InformationProtectionPoliciesInformationProtectionPolicyName.CUSTOM, + Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/GetEffectiveInformationProtectionPolicy_example.json + */ + /** + * Sample code: Get the effective information protection policy for a management group. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTheEffectiveInformationProtectionPolicyForAManagementGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .informationProtectionPolicies() + .getWithResponse( + "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", + InformationProtectionPoliciesInformationProtectionPolicyName.EFFECTIVE, + Context.NONE); + } +} +``` + +### InformationProtectionPolicies_List + +```java +import com.azure.core.util.Context; + +/** Samples for InformationProtectionPolicies List. */ +public final class InformationProtectionPoliciesListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/ListInformationProtectionPolicies_example.json + */ + /** + * Sample code: Get information protection policies. + * + * @param manager Entry point to SecurityManager. + */ + public static void getInformationProtectionPolicies(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .informationProtectionPolicies() + .list("providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", Context.NONE); + } +} +``` + +### 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 +import com.azure.core.util.Context; + +/** 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", Context.NONE); + } +} +``` + +### IngestionSettings_Get + +```java +import com.azure.core.util.Context; + +/** 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", Context.NONE); + } +} +``` + +### IngestionSettings_List + +```java +import com.azure.core.util.Context; + +/** 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(Context.NONE); + } +} +``` + +### IngestionSettings_ListConnectionStrings + +```java +import com.azure.core.util.Context; + +/** 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", Context.NONE); + } +} +``` + +### IngestionSettings_ListTokens + +```java +import com.azure.core.util.Context; + +/** 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", Context.NONE); + } +} +``` + +### IotSecuritySolution_CreateOrUpdate + +```java +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; + +/** Samples for IotSecuritySolution CreateOrUpdate. */ +public final class IotSecuritySolutionCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/CreateIoTSecuritySolution.json + */ + /** + * Sample code: Create or update a IoT security solution. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateAIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .iotSecuritySolutions() + .define("default") + .withExistingResourceGroup("MyGroup") + .withRegion("East Us") + .withTags(mapOf()) + .withWorkspace( + "/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1") + .withDisplayName("Solution Default") + .withStatus(SecuritySolutionStatus.ENABLED) + .withExport(Arrays.asList()) + .withDisabledDataSources(Arrays.asList()) + .withIotHubs( + Arrays + .asList( + "/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")) + .withUserDefinedResources( + new UserDefinedResourcesProperties() + .withQuery("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\"") + .withQuerySubscriptions(Arrays.asList("075423e9-7d33-4166-8bdf-3920b04e3735"))) + .withRecommendationsConfiguration( + Arrays + .asList( + new RecommendationConfigurationProperties() + .withRecommendationType(RecommendationType.IO_T_OPEN_PORTS) + .withStatus(RecommendationConfigStatus.DISABLED), + new RecommendationConfigurationProperties() + .withRecommendationType(RecommendationType.IO_T_SHARED_CREDENTIALS) + .withStatus(RecommendationConfigStatus.DISABLED))) + .withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus.ENABLED) + .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; + } +} +``` + +### IotSecuritySolution_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for IotSecuritySolution Delete. */ +public final class IotSecuritySolutionDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/DeleteIoTSecuritySolution.json + */ + /** + * Sample code: Delete an IoT security solution. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteAnIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutions().deleteWithResponse("MyGroup", "default", Context.NONE); + } +} +``` + +### IotSecuritySolution_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for IotSecuritySolution GetByResourceGroup. */ +public final class IotSecuritySolutionGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolution.json + */ + /** + * Sample code: Get a IoT security solution. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutions().getByResourceGroupWithResponse("MyGroup", "default", Context.NONE); + } +} +``` + +### IotSecuritySolution_List + +```java +import com.azure.core.util.Context; + +/** Samples for IotSecuritySolution List. */ +public final class IotSecuritySolutionListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsList.json + */ + /** + * Sample code: List IoT Security solutions by subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void listIoTSecuritySolutionsBySubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutions().list(null, Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByIotHub.json + */ + /** + * Sample code: List IoT Security solutions by IoT Hub. + * + * @param manager Entry point to SecurityManager. + */ + public static void listIoTSecuritySolutionsByIoTHub(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .iotSecuritySolutions() + .list( + "properties.iotHubs/any(i eq" + + " \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")", + Context.NONE); + } +} +``` + +### IotSecuritySolution_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for IotSecuritySolution ListByResourceGroup. */ +public final class IotSecuritySolutionListByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByIotHubAndRg.json + */ + /** + * Sample code: List IoT Security solutions by resource group and IoT Hub. + * + * @param manager Entry point to SecurityManager. + */ + public static void listIoTSecuritySolutionsByResourceGroupAndIoTHub( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .iotSecuritySolutions() + .listByResourceGroup( + "MyRg", + "properties.iotHubs/any(i eq" + + " \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")", + Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByRg.json + */ + /** + * Sample code: List IoT Security solutions by resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void listIoTSecuritySolutionsByResourceGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutions().listByResourceGroup("MyGroup", null, Context.NONE); + } +} +``` + +### IotSecuritySolution_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.models.IoTSecuritySolutionModel; +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 java.util.HashMap; +import java.util.Map; + +/** Samples for IotSecuritySolution Update. */ +public final class IotSecuritySolutionUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/UpdateIoTSecuritySolution.json + */ + /** + * Sample code: Use this method to update existing IoT Security solution. + * + * @param manager Entry point to SecurityManager. + */ + public static void useThisMethodToUpdateExistingIoTSecuritySolution( + com.azure.resourcemanager.security.SecurityManager manager) { + IoTSecuritySolutionModel resource = + manager.iotSecuritySolutions().getByResourceGroupWithResponse("myRg", "default", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("foo", "bar")) + .withUserDefinedResources( + new UserDefinedResourcesProperties() + .withQuery("where type != \"microsoft.devices/iothubs\" | where name contains \"v2\"") + .withQuerySubscriptions(Arrays.asList("075423e9-7d33-4166-8bdf-3920b04e3735"))) + .withRecommendationsConfiguration( + Arrays + .asList( + new RecommendationConfigurationProperties() + .withRecommendationType(RecommendationType.IO_T_OPEN_PORTS) + .withStatus(RecommendationConfigStatus.DISABLED), + new RecommendationConfigurationProperties() + .withRecommendationType(RecommendationType.IO_T_SHARED_CREDENTIALS) + .withStatus(RecommendationConfigStatus.DISABLED))) + .apply(); + } + + @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; + } +} +``` + +### IotSecuritySolutionAnalytics_Get + +```java +import com.azure.core.util.Context; + +/** Samples for IotSecuritySolutionAnalytics Get. */ +public final class IotSecuritySolutionAnalyticsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalytics.json + */ + /** + * Sample code: Get Security Solution Analytics. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecuritySolutionAnalytics(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionAnalytics().getWithResponse("MyGroup", "default", Context.NONE); + } +} +``` + +### IotSecuritySolutionAnalytics_List + +```java +import com.azure.core.util.Context; + +/** Samples for IotSecuritySolutionAnalytics List. */ +public final class IotSecuritySolutionAnalyticsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalyticsList.json + */ + /** + * Sample code: Get Security Solution Analytics. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecuritySolutionAnalytics(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionAnalytics().listWithResponse("MyGroup", "default", Context.NONE); + } +} +``` + +### IotSecuritySolutionsAnalyticsAggregatedAlert_Dismiss + +```java +import com.azure.core.util.Context; + +/** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert Dismiss. */ +public final class IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/PostIoTSecuritySolutionsSecurityAggregatedAlertDismiss.json + */ + /** + * Sample code: Dismiss an aggregated IoT Security Solution Alert. + * + * @param manager Entry point to SecurityManager. + */ + public static void dismissAnAggregatedIoTSecuritySolutionAlert( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .iotSecuritySolutionsAnalyticsAggregatedAlerts() + .dismissWithResponse("IoTEdgeResources", "default", "IoT_Bruteforce_Fail/2019-02-02/dismiss", Context.NONE); + } +} +``` + +### IotSecuritySolutionsAnalyticsAggregatedAlert_Get + +```java +import com.azure.core.util.Context; + +/** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert Get. */ +public final class IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAggregatedAlert.json + */ + /** + * Sample code: Get the aggregated security analytics alert of yours IoT Security solution. This aggregation is + * performed by alert name. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getTheAggregatedSecurityAnalyticsAlertOfYoursIoTSecuritySolutionThisAggregationIsPerformedByAlertName( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .iotSecuritySolutionsAnalyticsAggregatedAlerts() + .getWithResponse("MyGroup", "default", "IoT_Bruteforce_Fail/2019-02-02", Context.NONE); + } +} +``` + +### IotSecuritySolutionsAnalyticsAggregatedAlert_List + +```java +import com.azure.core.util.Context; + +/** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert List. */ +public final class IotSecuritySolutionsAnalyticsAggregatedAlertListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAggregatedAlertList.json + */ + /** + * Sample code: Get the aggregated alert list of yours IoT Security solution. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTheAggregatedAlertListOfYoursIoTSecuritySolution( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionsAnalyticsAggregatedAlerts().list("MyGroup", "default", null, Context.NONE); + } +} +``` + +### IotSecuritySolutionsAnalyticsRecommendation_Get + +```java +import com.azure.core.util.Context; + +/** Samples for IotSecuritySolutionsAnalyticsRecommendation Get. */ +public final class IotSecuritySolutionsAnalyticsRecommendationGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendation.json + */ + /** + * Sample code: Get the aggregated security analytics recommendation of yours IoT Security solution. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTheAggregatedSecurityAnalyticsRecommendationOfYoursIoTSecuritySolution( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .iotSecuritySolutionsAnalyticsRecommendations() + .getWithResponse("IoTEdgeResources", "default", "OpenPortsOnDevice", Context.NONE); + } +} +``` + +### IotSecuritySolutionsAnalyticsRecommendation_List + +```java +import com.azure.core.util.Context; + +/** Samples for IotSecuritySolutionsAnalyticsRecommendation List. */ +public final class IotSecuritySolutionsAnalyticsRecommendationListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendationList.json + */ + /** + * Sample code: Get the list of aggregated security analytics recommendations of yours IoT Security solution. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTheListOfAggregatedSecurityAnalyticsRecommendationsOfYoursIoTSecuritySolution( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionsAnalyticsRecommendations().list("IoTEdgeResources", "default", null, Context.NONE); + } +} +``` + +### JitNetworkAccessPolicies_CreateOrUpdate + +```java +import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; +import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyVirtualMachine; +import com.azure.resourcemanager.security.models.JitNetworkAccessPortRule; +import com.azure.resourcemanager.security.models.JitNetworkAccessRequestPort; +import com.azure.resourcemanager.security.models.JitNetworkAccessRequestVirtualMachine; +import com.azure.resourcemanager.security.models.Protocol; +import com.azure.resourcemanager.security.models.Status; +import com.azure.resourcemanager.security.models.StatusReason; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for JitNetworkAccessPolicies CreateOrUpdate. */ +public final class JitNetworkAccessPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/CreateJitNetworkAccessPolicy_example.json + */ + /** + * Sample code: Create JIT network access policy. + * + * @param manager Entry point to SecurityManager. + */ + public static void createJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .jitNetworkAccessPolicies() + .define("default") + .withExistingLocation("myRg1", "westeurope") + .withVirtualMachines( + Arrays + .asList( + new JitNetworkAccessPolicyVirtualMachine() + .withId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1") + .withPorts( + Arrays + .asList( + new JitNetworkAccessPortRule() + .withNumber(22) + .withProtocol(Protocol.ASTERISK) + .withAllowedSourceAddressPrefix("*") + .withMaxRequestAccessDuration("PT3H"), + new JitNetworkAccessPortRule() + .withNumber(3389) + .withProtocol(Protocol.ASTERISK) + .withAllowedSourceAddressPrefix("*") + .withMaxRequestAccessDuration("PT3H"))))) + .withKind("Basic") + .withRequests( + Arrays + .asList( + new JitNetworkAccessRequestInner() + .withVirtualMachines( + Arrays + .asList( + new JitNetworkAccessRequestVirtualMachine() + .withId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1") + .withPorts( + Arrays + .asList( + new JitNetworkAccessRequestPort() + .withNumber(3389) + .withAllowedSourceAddressPrefix("192.127.0.2") + .withEndTimeUtc( + OffsetDateTime.parse("2018-05-17T09:06:45.5691611Z")) + .withStatus(Status.INITIATED) + .withStatusReason(StatusReason.USER_REQUESTED))))) + .withStartTimeUtc(OffsetDateTime.parse("2018-05-17T08:06:45.5691611Z")) + .withRequestor("barbara@contoso.com"))) + .create(); + } +} +``` + +### JitNetworkAccessPolicies_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for JitNetworkAccessPolicies Delete. */ +public final class JitNetworkAccessPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/DeleteJitNetworkAccessPolicy_example.json + */ + /** + * Sample code: Delete a JIT network access policy. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteAJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies().deleteWithResponse("myRg1", "westeurope", "default", Context.NONE); + } +} +``` + +### JitNetworkAccessPolicies_Get + +```java +import com.azure.core.util.Context; + +/** Samples for JitNetworkAccessPolicies Get. */ +public final class JitNetworkAccessPoliciesGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPolicy_example.json + */ + /** + * Sample code: Get JIT network access policy. + * + * @param manager Entry point to SecurityManager. + */ + public static void getJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies().getWithResponse("myRg1", "westeurope", "default", Context.NONE); + } +} +``` + +### JitNetworkAccessPolicies_Initiate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiatePort; +import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateRequest; +import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateVirtualMachine; +import java.util.Arrays; + +/** Samples for JitNetworkAccessPolicies Initiate. */ +public final class JitNetworkAccessPoliciesInitiateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/InitiateJitNetworkAccessPolicy_example.json + */ + /** + * Sample code: Initiate an action on a JIT network access policy. + * + * @param manager Entry point to SecurityManager. + */ + public static void initiateAnActionOnAJITNetworkAccessPolicy( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .jitNetworkAccessPolicies() + .initiateWithResponse( + "myRg1", + "westeurope", + "default", + new JitNetworkAccessPolicyInitiateRequest() + .withVirtualMachines( + Arrays + .asList( + new JitNetworkAccessPolicyInitiateVirtualMachine() + .withId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1") + .withPorts( + Arrays + .asList( + new JitNetworkAccessPolicyInitiatePort() + .withNumber(3389) + .withAllowedSourceAddressPrefix("192.127.0.2"))))) + .withJustification("testing a new version of the product"), + Context.NONE); + } +} +``` + +### JitNetworkAccessPolicies_List + +```java +import com.azure.core.util.Context; + +/** Samples for JitNetworkAccessPolicies List. */ +public final class JitNetworkAccessPoliciesListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesSubscription_example.json + */ + /** + * Sample code: Get JIT network access policies on a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getJITNetworkAccessPoliciesOnASubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies().list(Context.NONE); + } +} +``` + +### JitNetworkAccessPolicies_ListByRegion + +```java +import com.azure.core.util.Context; + +/** Samples for JitNetworkAccessPolicies ListByRegion. */ +public final class JitNetworkAccessPoliciesListByRegionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesSubscriptionLocation_example.json + */ + /** + * Sample code: Get JIT network access policies on a subscription from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getJITNetworkAccessPoliciesOnASubscriptionFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies().listByRegion("westeurope", Context.NONE); + } +} +``` + +### JitNetworkAccessPolicies_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for JitNetworkAccessPolicies ListByResourceGroup. */ +public final class JitNetworkAccessPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesResourceGroup_example.json + */ + /** + * Sample code: Get JIT network access policies on a resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void getJITNetworkAccessPoliciesOnAResourceGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies().listByResourceGroup("myRg1", Context.NONE); + } +} +``` + +### JitNetworkAccessPolicies_ListByResourceGroupAndRegion + +```java +import com.azure.core.util.Context; + +/** Samples for JitNetworkAccessPolicies ListByResourceGroupAndRegion. */ +public final class JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesResourceGroupLocation_example.json + */ + /** + * Sample code: Get JIT network access policies on a resource group from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getJITNetworkAccessPoliciesOnAResourceGroupFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies().listByResourceGroupAndRegion("myRg1", "westeurope", Context.NONE); + } +} +``` + +### Locations_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Locations Get. */ +public final class LocationsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Locations/GetLocation_example.json + */ + /** + * Sample code: Get security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityDataLocation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.locations().getWithResponse("centralus", Context.NONE); + } +} +``` + +### Locations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Locations List. */ +public final class LocationsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Locations/GetLocations_example.json + */ + /** + * Sample code: Get security data locations. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityDataLocations(com.azure.resourcemanager.security.SecurityManager manager) { + manager.locations().list(Context.NONE); + } +} +``` + +### MdeOnboardings_Get + +```java +import com.azure.core.util.Context; + +/** Samples for MdeOnboardings Get. */ +public final class MdeOnboardingsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-10-01-preview/examples/MdeOnboardings/GetMdeOnboardings_example.json + */ + /** + * Sample code: The default configuration or data needed to onboard the machine to MDE. + * + * @param manager Entry point to SecurityManager. + */ + public static void theDefaultConfigurationOrDataNeededToOnboardTheMachineToMDE( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.mdeOnboardings().getWithResponse(Context.NONE); + } +} +``` + +### MdeOnboardings_List + +```java +import com.azure.core.util.Context; + +/** Samples for MdeOnboardings List. */ +public final class MdeOnboardingsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-10-01-preview/examples/MdeOnboardings/ListMdeOnboardings_example.json + */ + /** + * Sample code: The configuration or data needed to onboard the machine to MDE. + * + * @param manager Entry point to SecurityManager. + */ + public static void theConfigurationOrDataNeededToOnboardTheMachineToMDE( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.mdeOnboardings().listWithResponse(Context.NONE); + } +} +``` + +### Pricings_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Pricings Get. */ +public final class PricingsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/examples/Pricings/GetPricingByName_example.json + */ + /** + * Sample code: Get pricings on subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getPricingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings().getWithResponse("VirtualMachines", Context.NONE); + } +} +``` + +### Pricings_List + +```java +import com.azure.core.util.Context; + +/** Samples for Pricings List. */ +public final class PricingsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/examples/Pricings/ListPricings_example.json + */ + /** + * Sample code: Get pricings on subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getPricingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings().listWithResponse(Context.NONE); + } +} +``` + +### Pricings_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.PricingInner; +import com.azure.resourcemanager.security.models.PricingTier; + +/** Samples for Pricings Update. */ +public final class PricingsUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/examples/Pricings/PutPricingByName_example.json + */ + /** + * Sample code: Update pricing on subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void updatePricingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .pricings() + .updateWithResponse( + "VirtualMachines", new PricingInner().withPricingTier(PricingTier.STANDARD), Context.NONE); + } +} +``` + +### RegulatoryComplianceAssessments_Get + +```java +import com.azure.core.util.Context; + +/** Samples for RegulatoryComplianceAssessments Get. */ +public final class RegulatoryComplianceAssessmentsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceAssessment_example.json + */ + /** + * Sample code: Get selected regulatory compliance assessment details and state. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSelectedRegulatoryComplianceAssessmentDetailsAndState( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .regulatoryComplianceAssessments() + .getWithResponse("PCI-DSS-3.2", "1.1", "968548cb-02b3-8cd2-11f8-0cf64ab1a347", Context.NONE); + } +} +``` + +### RegulatoryComplianceAssessments_List + +```java +import com.azure.core.util.Context; + +/** Samples for RegulatoryComplianceAssessments List. */ +public final class RegulatoryComplianceAssessmentsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceAssessmentList_example.json + */ + /** + * Sample code: Get all assessments mapped to selected regulatory compliance control. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAllAssessmentsMappedToSelectedRegulatoryComplianceControl( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.regulatoryComplianceAssessments().list("PCI-DSS-3.2", "1.1", null, Context.NONE); + } +} +``` + +### RegulatoryComplianceControls_Get + +```java +import com.azure.core.util.Context; + +/** Samples for RegulatoryComplianceControls Get. */ +public final class RegulatoryComplianceControlsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceControl_example.json + */ + /** + * Sample code: Get selected regulatory compliance control details and state. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSelectedRegulatoryComplianceControlDetailsAndState( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.regulatoryComplianceControls().getWithResponse("PCI-DSS-3.2", "1.1", Context.NONE); + } +} +``` + +### RegulatoryComplianceControls_List + +```java +import com.azure.core.util.Context; + +/** Samples for RegulatoryComplianceControls List. */ +public final class RegulatoryComplianceControlsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceControlList_example.json + */ + /** + * Sample code: Get all regulatory compliance controls details and state for selected standard. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAllRegulatoryComplianceControlsDetailsAndStateForSelectedStandard( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.regulatoryComplianceControls().list("PCI-DSS-3.2", null, Context.NONE); + } +} +``` + +### RegulatoryComplianceStandards_Get + +```java +import com.azure.core.util.Context; + +/** Samples for RegulatoryComplianceStandards Get. */ +public final class RegulatoryComplianceStandardsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceStandard_example.json + */ + /** + * Sample code: Get selected regulatory compliance standard details and state. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSelectedRegulatoryComplianceStandardDetailsAndState( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.regulatoryComplianceStandards().getWithResponse("PCI-DSS-3.2", Context.NONE); + } +} +``` + +### RegulatoryComplianceStandards_List + +```java +import com.azure.core.util.Context; + +/** Samples for RegulatoryComplianceStandards List. */ +public final class RegulatoryComplianceStandardsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceStandardList_example.json + */ + /** + * Sample code: Get all supported regulatory compliance standards details and state. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAllSupportedRegulatoryComplianceStandardsDetailsAndState( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.regulatoryComplianceStandards().list(null, Context.NONE); + } +} +``` + +### SecureScoreControlDefinitions_List + +```java +import com.azure.core.util.Context; + +/** Samples for SecureScoreControlDefinitions List. */ +public final class SecureScoreControlDefinitionsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScoreControlDefinitions/ListSecureScoreControlDefinitions_example.json + */ + /** + * Sample code: List security controls definition. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecurityControlsDefinition(com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScoreControlDefinitions().list(Context.NONE); + } +} +``` + +### SecureScoreControlDefinitions_ListBySubscription + +```java +import com.azure.core.util.Context; + +/** Samples for SecureScoreControlDefinitions ListBySubscription. */ +public final class SecureScoreControlDefinitionsListBySubscriptionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScoreControlDefinitions/ListSecureScoreControlDefinitions_subscription_example.json + */ + /** + * Sample code: List security controls definition by subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecurityControlsDefinitionBySubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScoreControlDefinitions().listBySubscription(Context.NONE); + } +} +``` + +### SecureScoreControls_List + +```java +import com.azure.core.util.Context; + +/** Samples for SecureScoreControls List. */ +public final class SecureScoreControlsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControls_example.json + */ + /** + * Sample code: List all secure scores controls. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAllSecureScoresControls(com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScoreControls().list(null, Context.NONE); + } +} +``` + +### SecureScoreControls_ListBySecureScore + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.models.ExpandControlsEnum; + +/** Samples for SecureScoreControls ListBySecureScore. */ +public final class SecureScoreControlsListBySecureScoreSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControlsForNameWithExpand_builtin_example.json + */ + /** + * Sample code: Get security controls and their current score for the specified initiative with the expand + * parameter. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiativeWithTheExpandParameter( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScoreControls().listBySecureScore("ascScore", ExpandControlsEnum.DEFINITION, Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControlsForName_builtin_example.json + */ + /** + * Sample code: Get security controls and their current score for the specified initiative. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiative( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScoreControls().listBySecureScore("ascScore", null, Context.NONE); + } +} +``` + +### SecureScores_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SecureScores Get. */ +public final class SecureScoresGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/GetSecureScoresSingle_example.json + */ + /** + * Sample code: Get single secure score. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSingleSecureScore(com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScores().getWithResponse("ascScore", Context.NONE); + } +} +``` + +### SecureScores_List + +```java +import com.azure.core.util.Context; + +/** Samples for SecureScores List. */ +public final class SecureScoresListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScores_example.json + */ + /** + * Sample code: List secure scores. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecureScores(com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScores().list(Context.NONE); + } +} +``` + +### SecurityConnectors_CreateOrUpdate + +```java +import com.azure.resourcemanager.security.models.CloudName; +import com.azure.resourcemanager.security.models.CspmMonitorAwsOffering; +import com.azure.resourcemanager.security.models.CspmMonitorAwsOfferingNativeCloudConnection; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SecurityConnectors CreateOrUpdate. */ +public final class SecurityConnectorsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/SecurityConnectors/PutSecurityConnector_example.json + */ + /** + * Sample code: Create or update a security connector. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .securityConnectors() + .define("exampleSecurityConnectorName") + .withRegion("Central US") + .withExistingResourceGroup("exampleResourceGroup") + .withTags(mapOf()) + .withHierarchyIdentifier("exampleHierarchyId") + .withCloudName(CloudName.AWS) + .withOfferings( + Arrays + .asList( + new CspmMonitorAwsOffering() + .withNativeCloudConnection( + new CspmMonitorAwsOfferingNativeCloudConnection() + .withCloudRoleArn("arn:aws:iam::00000000:role/ASCMonitor")))) + .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; + } +} +``` + +### SecurityConnectors_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for SecurityConnectors Delete. */ +public final class SecurityConnectorsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/SecurityConnectors/DeleteSecurityConnector_example.json + */ + /** + * Sample code: Delete a security connector. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityConnectors().deleteWithResponse("myRg", "mySecurityConnectorName", Context.NONE); + } +} +``` + +### SecurityConnectors_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for SecurityConnectors GetByResourceGroup. */ +public final class SecurityConnectorsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/SecurityConnectors/GetSecurityConnectorResourceGroup_example.json + */ + /** + * Sample code: Retrieve a security connector. + * + * @param manager Entry point to SecurityManager. + */ + public static void retrieveASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .securityConnectors() + .getByResourceGroupWithResponse("exampleResourceGroup", "exampleSecurityConnectorName", Context.NONE); + } +} +``` + +### SecurityConnectors_List + +```java +import com.azure.core.util.Context; + +/** Samples for SecurityConnectors List. */ +public final class SecurityConnectorsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/SecurityConnectors/GetSecurityConnectorsSubscription_example.json + */ + /** + * Sample code: List all security connectors of a specified subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAllSecurityConnectorsOfASpecifiedSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityConnectors().list(Context.NONE); + } +} +``` + +### SecurityConnectors_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for SecurityConnectors ListByResourceGroup. */ +public final class SecurityConnectorsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/SecurityConnectors/GetSecurityConnectorsResourceGroup_example.json + */ + /** + * Sample code: List all security connectors of a specified resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAllSecurityConnectorsOfASpecifiedResourceGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityConnectors().listByResourceGroup("exampleResourceGroup", Context.NONE); + } +} +``` + +### SecurityConnectors_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.models.CloudName; +import com.azure.resourcemanager.security.models.CspmMonitorAwsOffering; +import com.azure.resourcemanager.security.models.CspmMonitorAwsOfferingNativeCloudConnection; +import com.azure.resourcemanager.security.models.SecurityConnector; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SecurityConnectors Update. */ +public final class SecurityConnectorsUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/SecurityConnectors/PatchSecurityConnector_example.json + */ + /** + * Sample code: Update a security connector. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { + SecurityConnector resource = + manager + .securityConnectors() + .getByResourceGroupWithResponse("exampleResourceGroup", "exampleSecurityConnectorName", Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf()) + .withHierarchyIdentifier("exampleHierarchyId") + .withCloudName(CloudName.AWS) + .withOfferings( + Arrays + .asList( + new CspmMonitorAwsOffering() + .withNativeCloudConnection( + new CspmMonitorAwsOfferingNativeCloudConnection() + .withCloudRoleArn("arn:aws:iam::00000000:role/ASCMonitor")))) + .apply(); + } + + @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; + } +} +``` + +### SecurityContacts_Create + +```java +import com.azure.resourcemanager.security.models.AlertNotifications; +import com.azure.resourcemanager.security.models.AlertsToAdmins; + +/** Samples for SecurityContacts Create. */ +public final class SecurityContactsCreateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/CreateSecurityContact_min_example.json + */ + /** + * Sample code: Create security contact data minimal. + * + * @param manager Entry point to SecurityManager. + */ + public static void createSecurityContactDataMinimal(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .securityContacts() + .define("default2") + .withEmail("chen@contoso.com") + .withAlertNotifications(AlertNotifications.ON) + .withAlertsToAdmins(AlertsToAdmins.ON) + .create(); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/CreateSecurityContact_full_example.json + */ + /** + * Sample code: Create security contact data full. + * + * @param manager Entry point to SecurityManager. + */ + public static void createSecurityContactDataFull(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .securityContacts() + .define("default1") + .withEmail("john@contoso.com") + .withPhone("(214)275-4038") + .withAlertNotifications(AlertNotifications.ON) + .withAlertsToAdmins(AlertsToAdmins.ON) + .create(); + } +} +``` + +### SecurityContacts_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for SecurityContacts Delete. */ +public final class SecurityContactsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/DeleteSecurityContact_example.json + */ + /** + * Sample code: Delete security contact data. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteSecurityContactData(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityContacts().deleteWithResponse("default1", Context.NONE); + } +} +``` + +### SecurityContacts_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SecurityContacts Get. */ +public final class SecurityContactsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/GetSecurityContact_min_example.json + */ + /** + * Sample code: Get security contact data minimal. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityContactDataMinimal(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityContacts().getWithResponse("default2", Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/GetSecurityContact_full_example.json + */ + /** + * Sample code: Get security contact data full. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityContactDataFull(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityContacts().getWithResponse("default1", Context.NONE); + } +} +``` + +### SecurityContacts_List + +```java +import com.azure.core.util.Context; + +/** Samples for SecurityContacts List. */ +public final class SecurityContactsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/GetSecurityContactsSubscription_min_example.json + */ + /** + * Sample code: Update security contact data minimal. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityContactDataMinimal(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityContacts().list(Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/GetSecurityContactsSubscription_full_example.json + */ + /** + * Sample code: Update security contact data full. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityContactDataFull(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityContacts().list(Context.NONE); + } +} +``` + +### SecurityContacts_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.models.AlertNotifications; +import com.azure.resourcemanager.security.models.SecurityContact; + +/** Samples for SecurityContacts Update. */ +public final class SecurityContactsUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/UpdateSecurityContact_min_example.json + */ + /** + * Sample code: Update security contact data minimal. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityContactDataMinimal(com.azure.resourcemanager.security.SecurityManager manager) { + SecurityContact resource = manager.securityContacts().getWithResponse("default2", Context.NONE).getValue(); + resource.update().withAlertNotifications(AlertNotifications.ON).apply(); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/UpdateSecurityContact_full_example.json + */ + /** + * Sample code: Update security contact data full. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityContactDataFull(com.azure.resourcemanager.security.SecurityManager manager) { + SecurityContact resource = manager.securityContacts().getWithResponse("john", Context.NONE).getValue(); + resource.update().withPhone("(214)275-4038").withAlertNotifications(AlertNotifications.ON).apply(); + } +} +``` + +### SecuritySolutions_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SecuritySolutions Get. */ +public final class SecuritySolutionsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutions/GetSecuritySolutionsResourceGroupLocation_example.json + */ + /** + * Sample code: Get a security solution from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getASecuritySolutionFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.securitySolutions().getWithResponse("myRg2", "centralus", "paloalto7", Context.NONE); + } +} +``` + +### SecuritySolutions_List + +```java +import com.azure.core.util.Context; + +/** Samples for SecuritySolutions List. */ +public final class SecuritySolutionsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutions/GetSecuritySolutionsSubscription_example.json + */ + /** + * Sample code: Get security solutions. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securitySolutions().list(Context.NONE); + } +} +``` + +### SecuritySolutionsReferenceData_List + +```java +import com.azure.core.util.Context; + +/** Samples for SecuritySolutionsReferenceData List. */ +public final class SecuritySolutionsReferenceDataListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutionsReferenceData/GetSecuritySolutionsReferenceDataSubscription_example.json + */ + /** + * Sample code: Get security solutions. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securitySolutionsReferenceDatas().listWithResponse(Context.NONE); + } +} +``` + +### SecuritySolutionsReferenceData_ListByHomeRegion + +```java +import com.azure.core.util.Context; + +/** Samples for SecuritySolutionsReferenceData ListByHomeRegion. */ +public final class SecuritySolutionsReferenceDataListByHomeRegionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutionsReferenceData/GetSecuritySolutionsReferenceDataSubscriptionLocation_example.json + */ + /** + * Sample code: Get security solutions from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecuritySolutionsFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.securitySolutionsReferenceDatas().listByHomeRegionWithResponse("westcentralus", Context.NONE); + } +} +``` + +### ServerVulnerabilityAssessment_CreateOrUpdate + +```java +import com.azure.core.util.Context; + +/** Samples for ServerVulnerabilityAssessment CreateOrUpdate. */ +public final class ServerVulnerabilityAssessmentCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/CreateServerVulnerabilityAssessments_example.json + */ + /** + * Sample code: Create a server vulnerability assessments on a resource. Only 'default' resource is supported. Once + * creating the resource, the server will be onboarded to vulnerability assessment by Microsoft.Security. + * + * @param manager Entry point to SecurityManager. + */ + public static void + createAServerVulnerabilityAssessmentsOnAResourceOnlyDefaultResourceIsSupportedOnceCreatingTheResourceTheServerWillBeOnboardedToVulnerabilityAssessmentByMicrosoftSecurity( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .serverVulnerabilityAssessments() + .createOrUpdateWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); + } +} +``` + +### ServerVulnerabilityAssessment_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ServerVulnerabilityAssessment Delete. */ +public final class ServerVulnerabilityAssessmentDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/DeleteServerVulnerabilityAssessments_example.json + */ + /** + * Sample code: Delete a server vulnerability assessments on a resource. Only 'default' resource is supported. Once + * deleting, Microsoft.Security will not provide vulnerability assessment findings on the resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteAServerVulnerabilityAssessmentsOnAResourceOnlyDefaultResourceIsSupportedOnceDeletingMicrosoftSecurityWillNotProvideVulnerabilityAssessmentFindingsOnTheResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .serverVulnerabilityAssessments() + .delete("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); + } +} +``` + +### ServerVulnerabilityAssessment_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ServerVulnerabilityAssessment Get. */ +public final class ServerVulnerabilityAssessmentGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/GetServerVulnerabilityAssessments_example.json + */ + /** + * Sample code: Get a server vulnerability assessments onboarding status on a resource. Currently Microsoft.Security + * only supports the single 'default' resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getAServerVulnerabilityAssessmentsOnboardingStatusOnAResourceCurrentlyMicrosoftSecurityOnlySupportsTheSingleDefaultResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .serverVulnerabilityAssessments() + .getWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); + } +} +``` + +### ServerVulnerabilityAssessment_ListByExtendedResource + +```java +import com.azure.core.util.Context; + +/** Samples for ServerVulnerabilityAssessment ListByExtendedResource. */ +public final class ServerVulnerabilityAssessmentListByExtendedResourceSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/ListByExtendedResourceServerVulnerabilityAssessments_example.json + */ + /** + * Sample code: Get a list of server vulnerability assessments on a resource. Though this API returns a list, + * Currently Microsoft.Security only supports a single default type of server vulnerability assessment. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getAListOfServerVulnerabilityAssessmentsOnAResourceThoughThisAPIReturnsAListCurrentlyMicrosoftSecurityOnlySupportsASingleDefaultTypeOfServerVulnerabilityAssessment( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .serverVulnerabilityAssessments() + .listByExtendedResourceWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); + } +} +``` + +### Settings_Get + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.models.SettingsSettingName; + +/** Samples for Settings Get. */ +public final class SettingsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-07-01/examples/Settings/GetSetting_example.json + */ + /** + * Sample code: Get a setting on subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getASettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.settings().getWithResponse(SettingsSettingName.MCAS, Context.NONE); + } +} +``` + +### Settings_List + +```java +import com.azure.core.util.Context; + +/** Samples for Settings List. */ +public final class SettingsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-07-01/examples/Settings/GetSettings_example.json + */ + /** + * Sample code: Get settings of subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSettingsOfSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.settings().list(Context.NONE); + } +} +``` + +### Settings_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.models.DataExportSettings; +import com.azure.resourcemanager.security.models.SettingsSettingName; + +/** Samples for Settings Update. */ +public final class SettingsUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-07-01/examples/Settings/UpdateSetting_example.json + */ + /** + * Sample code: Update a setting for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateASettingForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .settings() + .updateWithResponse(SettingsSettingName.MCAS, new DataExportSettings().withEnabled(true), Context.NONE); + } +} +``` + +### SoftwareInventories_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SoftwareInventories Get. */ +public final class SoftwareInventoriesGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/GetSoftware_example.json + */ + /** + * Sample code: Gets a single software data of the virtual machine. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsASingleSoftwareDataOfTheVirtualMachine( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .softwareInventories() + .getWithResponse( + "EITAN-TESTS", + "Microsoft.Compute", + "virtualMachines", + "Eitan-Test1", + "outlook_16.0.10371.20060", + Context.NONE); + } +} +``` + +### SoftwareInventories_List + +```java +import com.azure.core.util.Context; + +/** Samples for SoftwareInventories List. */ +public final class SoftwareInventoriesListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/ListBySubscriptionSoftwareInventories_example.json + */ + /** + * Sample code: Gets the software inventory of all virtual machines in the subscriptions. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsTheSoftwareInventoryOfAllVirtualMachinesInTheSubscriptions( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.softwareInventories().list(Context.NONE); + } +} +``` + +### SoftwareInventories_ListByExtendedResource + +```java +import com.azure.core.util.Context; + +/** Samples for SoftwareInventories ListByExtendedResource. */ +public final class SoftwareInventoriesListByExtendedResourceSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/ListByExtendedResourceSoftwareInventories_example.json + */ + /** + * Sample code: Gets the software inventory of the virtual machine. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsTheSoftwareInventoryOfTheVirtualMachine( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .softwareInventories() + .listByExtendedResource("EITAN-TESTS", "Microsoft.Compute", "virtualMachines", "Eitan-Test1", Context.NONE); + } +} +``` + +### SqlVulnerabilityAssessmentBaselineRules_Add + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.models.RulesResultsInput; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SqlVulnerabilityAssessmentBaselineRules Add. */ +public final class SqlVulnerabilityAssessmentBaselineRulesAddSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Add.json + */ + /** + * Sample code: Create a baseline for all rules. + * + * @param manager Entry point to SecurityManager. + */ + public static void createABaselineForAllRules(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .sqlVulnerabilityAssessmentBaselineRules() + .addWithResponse( + "55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + new RulesResultsInput() + .withLatestScan(false) + .withResults( + mapOf( + "VA1234", + Arrays.asList(Arrays.asList("userA", "SELECT"), Arrays.asList("userB", "SELECT")), + "VA5678", + Arrays.asList(Arrays.asList("Test", "0.0.0.0", "125.125.125.125")))), + Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_AddLatest.json + */ + /** + * Sample code: Create a baseline for all rules using the latest scan results. + * + * @param manager Entry point to SecurityManager. + */ + public static void createABaselineForAllRulesUsingTheLatestScanResults( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .sqlVulnerabilityAssessmentBaselineRules() + .addWithResponse( + "55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + new RulesResultsInput().withLatestScan(true).withResults(mapOf()), + Context.NONE); + } + + @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; + } +} +``` + +### SqlVulnerabilityAssessmentBaselineRules_CreateOrUpdate + +```java +import java.util.Arrays; + +/** Samples for SqlVulnerabilityAssessmentBaselineRules CreateOrUpdate. */ +public final class SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_PutLatest.json + */ + /** + * Sample code: Create a baseline using the latest scan results. + * + * @param manager Entry point to SecurityManager. + */ + public static void createABaselineUsingTheLatestScanResults( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .sqlVulnerabilityAssessmentBaselineRules() + .define("VA1234") + .withExistingResourceId( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master") + .withLatestScan(true) + .withResults(Arrays.asList()) + .withWorkspaceId("55555555-6666-7777-8888-999999999999") + .create(); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Put.json + */ + /** + * Sample code: Create a baseline. + * + * @param manager Entry point to SecurityManager. + */ + public static void createABaseline(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .sqlVulnerabilityAssessmentBaselineRules() + .define("VA1234") + .withExistingResourceId( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master") + .withLatestScan(false) + .withResults(Arrays.asList(Arrays.asList("userA", "SELECT"), Arrays.asList("userB", "SELECT"))) + .withWorkspaceId("55555555-6666-7777-8888-999999999999") + .create(); + } +} +``` + +### SqlVulnerabilityAssessmentBaselineRules_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for SqlVulnerabilityAssessmentBaselineRules Delete. */ +public final class SqlVulnerabilityAssessmentBaselineRulesDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Delete.json + */ + /** + * Sample code: Delete the baseline. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteTheBaseline(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .sqlVulnerabilityAssessmentBaselineRules() + .deleteWithResponse( + "VA1234", + "55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + Context.NONE); + } +} +``` + +### SqlVulnerabilityAssessmentBaselineRules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SqlVulnerabilityAssessmentBaselineRules Get. */ +public final class SqlVulnerabilityAssessmentBaselineRulesGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Get.json + */ + /** + * Sample code: Get the baseline. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTheBaseline(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .sqlVulnerabilityAssessmentBaselineRules() + .getWithResponse( + "VA1234", + "55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + Context.NONE); + } +} +``` + +### SqlVulnerabilityAssessmentBaselineRules_List + +```java +import com.azure.core.util.Context; + +/** Samples for SqlVulnerabilityAssessmentBaselineRules List. */ +public final class SqlVulnerabilityAssessmentBaselineRulesListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_List.json + */ + /** + * Sample code: List baseline for all rules. + * + * @param manager Entry point to SecurityManager. + */ + public static void listBaselineForAllRules(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .sqlVulnerabilityAssessmentBaselineRules() + .listWithResponse( + "55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + Context.NONE); + } +} +``` + +### SqlVulnerabilityAssessmentScanResults_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SqlVulnerabilityAssessmentScanResults Get. */ +public final class SqlVulnerabilityAssessmentScanResultsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_Get.json + */ + /** + * Sample code: Get scan details of a scan record. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanDetailsOfAScanRecord(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .sqlVulnerabilityAssessmentScanResults() + .getWithResponse( + "Scheduled-20200623", + "VA2063", + "55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_GetLatest.json + */ + /** + * Sample code: Get scan details of the latest scan record. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanDetailsOfTheLatestScanRecord(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .sqlVulnerabilityAssessmentScanResults() + .getWithResponse( + "latest", + "VA2063", + "55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + Context.NONE); + } +} +``` + +### SqlVulnerabilityAssessmentScanResults_List + +```java +import com.azure.core.util.Context; + +/** Samples for SqlVulnerabilityAssessmentScanResults List. */ +public final class SqlVulnerabilityAssessmentScanResultsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_ListLatest.json + */ + /** + * Sample code: List scan results of the latest scan. + * + * @param manager Entry point to SecurityManager. + */ + public static void listScanResultsOfTheLatestScan(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .sqlVulnerabilityAssessmentScanResults() + .listWithResponse( + "latest", + "55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_List.json + */ + /** + * Sample code: List scan results. + * + * @param manager Entry point to SecurityManager. + */ + public static void listScanResults(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .sqlVulnerabilityAssessmentScanResults() + .listWithResponse( + "Scheduled-20200623", + "55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + Context.NONE); + } +} +``` + +### SqlVulnerabilityAssessmentScans_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SqlVulnerabilityAssessmentScans Get. */ +public final class SqlVulnerabilityAssessmentScansGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_Get.json + */ + /** + * Sample code: Get scan details of a scan record. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanDetailsOfAScanRecord(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .sqlVulnerabilityAssessmentScans() + .getWithResponse( + "Scheduled-20200623", + "55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_GetLatest.json + */ + /** + * Sample code: Get scan details of the latest scan record. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanDetailsOfTheLatestScanRecord(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .sqlVulnerabilityAssessmentScans() + .getWithResponse( + "latest", + "55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + Context.NONE); + } +} +``` + +### SqlVulnerabilityAssessmentScans_List + +```java +import com.azure.core.util.Context; + +/** Samples for SqlVulnerabilityAssessmentScans List. */ +public final class SqlVulnerabilityAssessmentScansListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_List.json + */ + /** + * Sample code: List scan details. + * + * @param manager Entry point to SecurityManager. + */ + public static void listScanDetails(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .sqlVulnerabilityAssessmentScans() + .listWithResponse( + "55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + Context.NONE); + } +} +``` + +### SubAssessments_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SubAssessments Get. */ +public final class SubAssessmentsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/GetSubAssessment_example.json + */ + /** + * Sample code: Get security recommendation task from security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityRecommendationTaskFromSecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .subAssessments() + .getWithResponse( + "subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/DEMORG/providers/Microsoft.Compute/virtualMachines/vm2", + "1195afff-c881-495e-9bc5-1486211ae03f", + "95f7da9c-a2a4-1322-0758-fcd24ef09b85", + Context.NONE); + } +} +``` + +### SubAssessments_List + +```java +import com.azure.core.util.Context; + +/** Samples for SubAssessments List. */ +public final class SubAssessmentsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ListSubAssessments_example.json + */ + /** + * Sample code: List security sub-assessments. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecuritySubAssessments(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .subAssessments() + .list( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "82e20e14-edc5-4373-bfc4-f13121257c37", + Context.NONE); + } +} +``` + +### SubAssessments_ListAll + +```java +import com.azure.core.util.Context; + +/** Samples for SubAssessments ListAll. */ +public final class SubAssessmentsListAllSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ListSubscriptionSubAssessments_example.json + */ + /** + * Sample code: List security sub-assessments. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecuritySubAssessments(com.azure.resourcemanager.security.SecurityManager manager) { + manager.subAssessments().listAll("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", Context.NONE); + } +} +``` + +### Tasks_GetResourceGroupLevelTask + +```java +import com.azure.core.util.Context; + +/** Samples for Tasks GetResourceGroupLevelTask. */ +public final class TasksGetResourceGroupLevelTaskSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTaskResourceGroupLocation_example.json + */ + /** + * Sample code: Get security recommendation task in a resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityRecommendationTaskInAResourceGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .tasks() + .getResourceGroupLevelTaskWithResponse( + "myRg", "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", Context.NONE); + } +} +``` + +### Tasks_GetSubscriptionLevelTask + +```java +import com.azure.core.util.Context; + +/** Samples for Tasks GetSubscriptionLevelTask. */ +public final class TasksGetSubscriptionLevelTaskSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTaskSubscriptionLocation_example.json + */ + /** + * Sample code: Get security recommendation task from security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityRecommendationTaskFromSecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .tasks() + .getSubscriptionLevelTaskWithResponse("westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", Context.NONE); + } +} +``` + +### Tasks_List + +```java +import com.azure.core.util.Context; + +/** Samples for Tasks List. */ +public final class TasksListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksSubscription_example.json + */ + /** + * Sample code: Get security recommendations tasks. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityRecommendationsTasks(com.azure.resourcemanager.security.SecurityManager manager) { + manager.tasks().list(null, Context.NONE); + } +} +``` + +### Tasks_ListByHomeRegion + +```java +import com.azure.core.util.Context; + +/** Samples for Tasks ListByHomeRegion. */ +public final class TasksListByHomeRegionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksSubscriptionLocation_example.json + */ + /** + * Sample code: Get security recommendations tasks from security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityRecommendationsTasksFromSecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.tasks().listByHomeRegion("westeurope", null, Context.NONE); + } +} +``` + +### Tasks_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Tasks ListByResourceGroup. */ +public final class TasksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksResourceGroupLocation_example.json + */ + /** + * Sample code: Get security recommendation tasks in a resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityRecommendationTasksInAResourceGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.tasks().listByResourceGroup("myRg", "westeurope", null, Context.NONE); + } +} +``` + +### Tasks_UpdateResourceGroupLevelTaskState + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.models.TasksTaskUpdateActionType; + +/** Samples for Tasks UpdateResourceGroupLevelTaskState. */ +public final class TasksUpdateResourceGroupLevelTaskStateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/UpdateTaskResourceGroupLocation_example.json + */ + /** + * Sample code: Change security recommendation task state. + * + * @param manager Entry point to SecurityManager. + */ + public static void changeSecurityRecommendationTaskState( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .tasks() + .updateResourceGroupLevelTaskStateWithResponse( + "myRg", + "westeurope", + "d55b4dc0-779c-c66c-33e5-d7bce24c4222", + TasksTaskUpdateActionType.DISMISS, + Context.NONE); + } +} +``` + +### Tasks_UpdateSubscriptionLevelTaskState + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.models.TasksTaskUpdateActionType; + +/** Samples for Tasks UpdateSubscriptionLevelTaskState. */ +public final class TasksUpdateSubscriptionLevelTaskStateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/UpdateTaskSubscriptionLocation_example.json + */ + /** + * Sample code: Change security recommendation task state. + * + * @param manager Entry point to SecurityManager. + */ + public static void changeSecurityRecommendationTaskState( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .tasks() + .updateSubscriptionLevelTaskStateWithResponse( + "westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", TasksTaskUpdateActionType.DISMISS, Context.NONE); + } +} +``` + +### Topology_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Topology Get. */ +public final class TopologyGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopology_example.json + */ + /** + * Sample code: Get topology. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTopology(com.azure.resourcemanager.security.SecurityManager manager) { + manager.topologies().getWithResponse("myservers", "centralus", "vnets", Context.NONE); + } +} +``` + +### Topology_List + +```java +import com.azure.core.util.Context; + +/** Samples for Topology List. */ +public final class TopologyListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopologySubscription_example.json + */ + /** + * Sample code: Get topology on a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTopologyOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.topologies().list(Context.NONE); + } +} +``` + +### Topology_ListByHomeRegion + +```java +import com.azure.core.util.Context; + +/** Samples for Topology ListByHomeRegion. */ +public final class TopologyListByHomeRegionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopologySubscriptionLocation_example.json + */ + /** + * Sample code: Get topology on a subscription from security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTopologyOnASubscriptionFromSecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.topologies().listByHomeRegion("centralus", Context.NONE); + } +} +``` + +### WorkspaceSettings_Create + +```java +/** Samples for WorkspaceSettings Create. */ +public final class WorkspaceSettingsCreateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/CreateWorkspaceSetting_example.json + */ + /** + * Sample code: Create a workspace setting data for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void createAWorkspaceSettingDataForSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .workspaceSettings() + .define("default") + .withWorkspaceId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace") + .withScope("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23") + .create(); + } +} +``` + +### WorkspaceSettings_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for WorkspaceSettings Delete. */ +public final class WorkspaceSettingsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/DeleteWorkspaceSetting_example.json + */ + /** + * Sample code: Delete a workspace setting data for resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteAWorkspaceSettingDataForResourceGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.workspaceSettings().deleteWithResponse("default", Context.NONE); + } +} +``` + +### WorkspaceSettings_Get + +```java +import com.azure.core.util.Context; + +/** Samples for WorkspaceSettings Get. */ +public final class WorkspaceSettingsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/GetWorkspaceSetting_example.json + */ + /** + * Sample code: Get a workspace setting on subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAWorkspaceSettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.workspaceSettings().getWithResponse("default", Context.NONE); + } +} +``` + +### WorkspaceSettings_List + +```java +import com.azure.core.util.Context; + +/** Samples for WorkspaceSettings List. */ +public final class WorkspaceSettingsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/GetWorkspaceSettings_example.json + */ + /** + * Sample code: Get workspace settings on subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getWorkspaceSettingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.workspaceSettings().list(Context.NONE); + } +} +``` + +### WorkspaceSettings_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.models.WorkspaceSetting; + +/** Samples for WorkspaceSettings Update. */ +public final class WorkspaceSettingsUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/UpdateWorkspaceSetting_example.json + */ + /** + * Sample code: Update a workspace setting data for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateAWorkspaceSettingDataForSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + WorkspaceSetting resource = manager.workspaceSettings().getWithResponse("default", Context.NONE).getValue(); + resource + .update() + .withWorkspaceId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace") + .apply(); + } +} +``` -- [Create](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsCreateSamples.java) -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsDeleteSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsListSamples.java) -- [Update](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsUpdateSamples.java) 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 cdcf2fc45d004..c8d45f6d93fad 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 @@ -8,6 +8,7 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; @@ -34,28 +35,20 @@ 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.DeviceSecurityGroupsImpl; -import com.azure.resourcemanager.security.implementation.DevicesForHubsImpl; -import com.azure.resourcemanager.security.implementation.DevicesForSubscriptionsImpl; -import com.azure.resourcemanager.security.implementation.DevicesImpl; import com.azure.resourcemanager.security.implementation.DiscoveredSecuritySolutionsImpl; import com.azure.resourcemanager.security.implementation.ExternalSecuritySolutionsImpl; import com.azure.resourcemanager.security.implementation.InformationProtectionPoliciesImpl; import com.azure.resourcemanager.security.implementation.IngestionSettingsImpl; -import com.azure.resourcemanager.security.implementation.IotAlertTypesImpl; -import com.azure.resourcemanager.security.implementation.IotAlertsImpl; -import com.azure.resourcemanager.security.implementation.IotDefenderSettingsImpl; -import com.azure.resourcemanager.security.implementation.IotRecommendationTypesImpl; -import com.azure.resourcemanager.security.implementation.IotRecommendationsImpl; import com.azure.resourcemanager.security.implementation.IotSecuritySolutionAnalyticsImpl; import com.azure.resourcemanager.security.implementation.IotSecuritySolutionsAnalyticsAggregatedAlertsImpl; import com.azure.resourcemanager.security.implementation.IotSecuritySolutionsAnalyticsRecommendationsImpl; import com.azure.resourcemanager.security.implementation.IotSecuritySolutionsImpl; -import com.azure.resourcemanager.security.implementation.IotSensorsImpl; -import com.azure.resourcemanager.security.implementation.IotSitesImpl; import com.azure.resourcemanager.security.implementation.JitNetworkAccessPoliciesImpl; import com.azure.resourcemanager.security.implementation.LocationsImpl; -import com.azure.resourcemanager.security.implementation.OnPremiseIotSensorsImpl; +import com.azure.resourcemanager.security.implementation.MdeOnboardingsImpl; import com.azure.resourcemanager.security.implementation.OperationsImpl; import com.azure.resourcemanager.security.implementation.PricingsImpl; import com.azure.resourcemanager.security.implementation.RegulatoryComplianceAssessmentsImpl; @@ -65,6 +58,7 @@ import com.azure.resourcemanager.security.implementation.SecureScoreControlsImpl; import com.azure.resourcemanager.security.implementation.SecureScoresImpl; import com.azure.resourcemanager.security.implementation.SecurityCenterBuilder; +import com.azure.resourcemanager.security.implementation.SecurityConnectorsImpl; import com.azure.resourcemanager.security.implementation.SecurityContactsImpl; import com.azure.resourcemanager.security.implementation.SecuritySolutionsImpl; import com.azure.resourcemanager.security.implementation.SecuritySolutionsReferenceDatasImpl; @@ -91,28 +85,20 @@ 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.DeviceSecurityGroups; -import com.azure.resourcemanager.security.models.Devices; -import com.azure.resourcemanager.security.models.DevicesForHubs; -import com.azure.resourcemanager.security.models.DevicesForSubscriptions; import com.azure.resourcemanager.security.models.DiscoveredSecuritySolutions; import com.azure.resourcemanager.security.models.ExternalSecuritySolutions; import com.azure.resourcemanager.security.models.InformationProtectionPolicies; import com.azure.resourcemanager.security.models.IngestionSettings; -import com.azure.resourcemanager.security.models.IotAlertTypes; -import com.azure.resourcemanager.security.models.IotAlerts; -import com.azure.resourcemanager.security.models.IotDefenderSettings; -import com.azure.resourcemanager.security.models.IotRecommendationTypes; -import com.azure.resourcemanager.security.models.IotRecommendations; import com.azure.resourcemanager.security.models.IotSecuritySolutionAnalytics; import com.azure.resourcemanager.security.models.IotSecuritySolutions; import com.azure.resourcemanager.security.models.IotSecuritySolutionsAnalyticsAggregatedAlerts; import com.azure.resourcemanager.security.models.IotSecuritySolutionsAnalyticsRecommendations; -import com.azure.resourcemanager.security.models.IotSensors; -import com.azure.resourcemanager.security.models.IotSites; import com.azure.resourcemanager.security.models.JitNetworkAccessPolicies; import com.azure.resourcemanager.security.models.Locations; -import com.azure.resourcemanager.security.models.OnPremiseIotSensors; +import com.azure.resourcemanager.security.models.MdeOnboardings; import com.azure.resourcemanager.security.models.Operations; import com.azure.resourcemanager.security.models.Pricings; import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessments; @@ -121,6 +107,7 @@ import com.azure.resourcemanager.security.models.SecureScoreControlDefinitions; import com.azure.resourcemanager.security.models.SecureScoreControls; import com.azure.resourcemanager.security.models.SecureScores; +import com.azure.resourcemanager.security.models.SecurityConnectors; import com.azure.resourcemanager.security.models.SecurityContacts; import com.azure.resourcemanager.security.models.SecuritySolutions; import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceDatas; @@ -139,9 +126,16 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) resource provider. */ public final class SecurityManager { + private MdeOnboardings mdeOnboardings; + + private CustomAssessmentAutomations customAssessmentAutomations; + + private CustomEntityStoreAssignments customEntityStoreAssignments; + private ComplianceResults complianceResults; private Pricings pricings; @@ -224,28 +218,6 @@ public final class SecurityManager { private SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselineRules; - private IotDefenderSettings iotDefenderSettings; - - private IotSensors iotSensors; - - private DevicesForSubscriptions devicesForSubscriptions; - - private DevicesForHubs devicesForHubs; - - private Devices devices; - - private OnPremiseIotSensors onPremiseIotSensors; - - private IotSites iotSites; - - private IotAlerts iotAlerts; - - private IotAlertTypes iotAlertTypes; - - private IotRecommendations iotRecommendations; - - private IotRecommendationTypes iotRecommendationTypes; - private Alerts alerts; private Settings settings; @@ -254,6 +226,8 @@ public final class SecurityManager { private SoftwareInventories softwareInventories; + private SecurityConnectors securityConnectors; + private final SecurityCenter clientObject; private SecurityManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -413,11 +387,24 @@ public SecurityManager authenticate(TokenCredential credential, AzureProfile pro List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies.addAll(this.policies); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = @@ -429,6 +416,32 @@ public SecurityManager authenticate(TokenCredential credential, AzureProfile pro } } + /** @return Resource collection API of MdeOnboardings. */ + public MdeOnboardings mdeOnboardings() { + if (this.mdeOnboardings == null) { + this.mdeOnboardings = new MdeOnboardingsImpl(clientObject.getMdeOnboardings(), this); + } + return mdeOnboardings; + } + + /** @return Resource collection API of CustomAssessmentAutomations. */ + public CustomAssessmentAutomations customAssessmentAutomations() { + if (this.customAssessmentAutomations == null) { + this.customAssessmentAutomations = + new CustomAssessmentAutomationsImpl(clientObject.getCustomAssessmentAutomations(), this); + } + return customAssessmentAutomations; + } + + /** @return Resource collection API of CustomEntityStoreAssignments. */ + public CustomEntityStoreAssignments customEntityStoreAssignments() { + if (this.customEntityStoreAssignments == null) { + this.customEntityStoreAssignments = + new CustomEntityStoreAssignmentsImpl(clientObject.getCustomEntityStoreAssignments(), this); + } + return customEntityStoreAssignments; + } + /** @return Resource collection API of ComplianceResults. */ public ComplianceResults complianceResults() { if (this.complianceResults == null) { @@ -782,96 +795,6 @@ public SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselin return sqlVulnerabilityAssessmentBaselineRules; } - /** @return Resource collection API of IotDefenderSettings. */ - public IotDefenderSettings iotDefenderSettings() { - if (this.iotDefenderSettings == null) { - this.iotDefenderSettings = new IotDefenderSettingsImpl(clientObject.getIotDefenderSettings(), this); - } - return iotDefenderSettings; - } - - /** @return Resource collection API of IotSensors. */ - public IotSensors iotSensors() { - if (this.iotSensors == null) { - this.iotSensors = new IotSensorsImpl(clientObject.getIotSensors(), this); - } - return iotSensors; - } - - /** @return Resource collection API of DevicesForSubscriptions. */ - public DevicesForSubscriptions devicesForSubscriptions() { - if (this.devicesForSubscriptions == null) { - this.devicesForSubscriptions = - new DevicesForSubscriptionsImpl(clientObject.getDevicesForSubscriptions(), this); - } - return devicesForSubscriptions; - } - - /** @return Resource collection API of DevicesForHubs. */ - public DevicesForHubs devicesForHubs() { - if (this.devicesForHubs == null) { - this.devicesForHubs = new DevicesForHubsImpl(clientObject.getDevicesForHubs(), this); - } - return devicesForHubs; - } - - /** @return Resource collection API of Devices. */ - public Devices devices() { - if (this.devices == null) { - this.devices = new DevicesImpl(clientObject.getDevices(), this); - } - return devices; - } - - /** @return Resource collection API of OnPremiseIotSensors. */ - public OnPremiseIotSensors onPremiseIotSensors() { - if (this.onPremiseIotSensors == null) { - this.onPremiseIotSensors = new OnPremiseIotSensorsImpl(clientObject.getOnPremiseIotSensors(), this); - } - return onPremiseIotSensors; - } - - /** @return Resource collection API of IotSites. */ - public IotSites iotSites() { - if (this.iotSites == null) { - this.iotSites = new IotSitesImpl(clientObject.getIotSites(), this); - } - return iotSites; - } - - /** @return Resource collection API of IotAlerts. */ - public IotAlerts iotAlerts() { - if (this.iotAlerts == null) { - this.iotAlerts = new IotAlertsImpl(clientObject.getIotAlerts(), this); - } - return iotAlerts; - } - - /** @return Resource collection API of IotAlertTypes. */ - public IotAlertTypes iotAlertTypes() { - if (this.iotAlertTypes == null) { - this.iotAlertTypes = new IotAlertTypesImpl(clientObject.getIotAlertTypes(), this); - } - return iotAlertTypes; - } - - /** @return Resource collection API of IotRecommendations. */ - public IotRecommendations iotRecommendations() { - if (this.iotRecommendations == null) { - this.iotRecommendations = new IotRecommendationsImpl(clientObject.getIotRecommendations(), this); - } - return iotRecommendations; - } - - /** @return Resource collection API of IotRecommendationTypes. */ - public IotRecommendationTypes iotRecommendationTypes() { - if (this.iotRecommendationTypes == null) { - this.iotRecommendationTypes = - new IotRecommendationTypesImpl(clientObject.getIotRecommendationTypes(), this); - } - return iotRecommendationTypes; - } - /** @return Resource collection API of Alerts. */ public Alerts alerts() { if (this.alerts == null) { @@ -904,6 +827,14 @@ public SoftwareInventories softwareInventories() { return softwareInventories; } + /** @return Resource collection API of SecurityConnectors. */ + public SecurityConnectors securityConnectors() { + if (this.securityConnectors == null) { + this.securityConnectors = new SecurityConnectorsImpl(clientObject.getSecurityConnectors(), this); + } + return securityConnectors; + } + /** * @return Wrapped service client SecurityCenter providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdaptiveNetworkHardeningsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdaptiveNetworkHardeningsClient.java index da45ed63794df..05b7260a7f28f 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdaptiveNetworkHardeningsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdaptiveNetworkHardeningsClient.java @@ -112,7 +112,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginEnforce( String resourceGroupName, String resourceNamespace, @@ -137,7 +137,7 @@ SyncPoller, Void> beginEnforce( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginEnforce( String resourceGroupName, String resourceNamespace, diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsClient.java index a2e489ff86529..e614b0d063cae 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsClient.java @@ -384,7 +384,7 @@ Response updateResourceGroupLevelStateToActivateWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginSimulate( String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody); @@ -400,7 +400,7 @@ SyncPoller, Void> beginSimulate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginSimulate( String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody, Context context); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsClient.java index 5d3b6586bae37..2a460bf72778d 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsClient.java @@ -9,8 +9,9 @@ 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.SecurityAssessmentInner; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner; import com.azure.resourcemanager.security.models.ExpandEnum; +import com.azure.resourcemanager.security.models.SecurityAssessment; /** An instance of this class provides access to all the operations defined in AssessmentsClient. */ public interface AssessmentsClient { @@ -25,7 +26,7 @@ public interface AssessmentsClient { * @return security assessments on all your scanned resources inside a scope. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); + PagedIterable list(String scope); /** * Get security assessments on all your scanned resources inside a scope. @@ -39,7 +40,7 @@ public interface AssessmentsClient { * @return security assessments on all your scanned resources inside a scope. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); + PagedIterable list(String scope, Context context); /** * Get a security assessment on your scanned resource. @@ -52,7 +53,7 @@ public interface AssessmentsClient { * @return a security assessment on your scanned resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentInner get(String resourceId, String assessmentName); + SecurityAssessmentResponseInner get(String resourceId, String assessmentName); /** * Get a security assessment on your scanned resource. @@ -67,7 +68,7 @@ public interface AssessmentsClient { * @return a security assessment on your scanned resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( + Response getWithResponse( String resourceId, String assessmentName, ExpandEnum expand, Context context); /** @@ -80,11 +81,11 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment on a resource. + * @return security assessment on a resource - response format. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentInner createOrUpdate( - String resourceId, String assessmentName, SecurityAssessmentInner assessment); + SecurityAssessmentResponseInner createOrUpdate( + String resourceId, String assessmentName, SecurityAssessment assessment); /** * Create a security assessment on your resource. An assessment metadata that describes this assessment must be @@ -97,11 +98,11 @@ SecurityAssessmentInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment on a resource. + * @return security assessment on a resource - response format. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceId, String assessmentName, SecurityAssessmentInner assessment, Context context); + Response createOrUpdateWithResponse( + String resourceId, String assessmentName, SecurityAssessment assessment, Context context); /** * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsMetadatasClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsMetadatasClient.java index 6cc6f62ecf443..595cfc2b325ca 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsMetadatasClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsMetadatasClient.java @@ -9,7 +9,7 @@ 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.SecurityAssessmentMetadataInner; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner; /** An instance of this class provides access to all the operations defined in AssessmentsMetadatasClient. */ public interface AssessmentsMetadatasClient { @@ -21,7 +21,7 @@ public interface AssessmentsMetadatasClient { * @return metadata information on all assessment types. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable list(); /** * Get metadata information on all assessment types. @@ -33,7 +33,7 @@ public interface AssessmentsMetadatasClient { * @return metadata information on all assessment types. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable list(Context context); /** * Get metadata information on an assessment type. @@ -45,7 +45,7 @@ public interface AssessmentsMetadatasClient { * @return metadata information on an assessment type. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentMetadataInner get(String assessmentMetadataName); + SecurityAssessmentMetadataResponseInner get(String assessmentMetadataName); /** * Get metadata information on an assessment type. @@ -58,7 +58,7 @@ public interface AssessmentsMetadatasClient { * @return metadata information on an assessment type. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String assessmentMetadataName, Context context); + Response getWithResponse(String assessmentMetadataName, Context context); /** * Get metadata information on all assessment types in a specific subscription. @@ -68,7 +68,7 @@ public interface AssessmentsMetadatasClient { * @return metadata information on all assessment types in a specific subscription. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySubscription(); + PagedIterable listBySubscription(); /** * Get metadata information on all assessment types in a specific subscription. @@ -80,7 +80,7 @@ public interface AssessmentsMetadatasClient { * @return metadata information on all assessment types in a specific subscription. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySubscription(Context context); + PagedIterable listBySubscription(Context context); /** * Get metadata information on an assessment type in a specific subscription. @@ -92,7 +92,7 @@ public interface AssessmentsMetadatasClient { * @return metadata information on an assessment type in a specific subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentMetadataInner getInSubscription(String assessmentMetadataName); + SecurityAssessmentMetadataResponseInner getInSubscription(String assessmentMetadataName); /** * Get metadata information on an assessment type in a specific subscription. @@ -105,7 +105,7 @@ public interface AssessmentsMetadatasClient { * @return metadata information on an assessment type in a specific subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getInSubscriptionWithResponse( + Response getInSubscriptionWithResponse( String assessmentMetadataName, Context context); /** @@ -116,11 +116,11 @@ Response getInSubscriptionWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata. + * @return security assessment metadata response. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentMetadataInner createInSubscription( - String assessmentMetadataName, SecurityAssessmentMetadataInner assessmentMetadata); + SecurityAssessmentMetadataResponseInner createInSubscription( + String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata); /** * Create metadata information on an assessment type in a specific subscription. @@ -131,11 +131,11 @@ SecurityAssessmentMetadataInner createInSubscription( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata. + * @return security assessment metadata response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createInSubscriptionWithResponse( - String assessmentMetadataName, SecurityAssessmentMetadataInner assessmentMetadata, Context context); + Response createInSubscriptionWithResponse( + String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata, Context context); /** * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomAssessmentAutomationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomAssessmentAutomationsClient.java new file mode 100644 index 0000000000000..aacbf9c554dde --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomAssessmentAutomationsClient.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.CustomAssessmentAutomationInner; +import com.azure.resourcemanager.security.models.CustomAssessmentAutomationRequest; + +/** An instance of this class provides access to all the operations defined in CustomAssessmentAutomationsClient. */ +public interface CustomAssessmentAutomationsClient { + /** + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom assessment automation by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomAssessmentAutomationInner getByResourceGroup(String resourceGroupName, String customAssessmentAutomationName); + + /** + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom assessment automation by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String customAssessmentAutomationName, Context context); + + /** + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * existing custom assessment automation will replace the existing record. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param customAssessmentAutomationBody Custom Assessment Automation body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom Assessment Automation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomAssessmentAutomationInner create( + String resourceGroupName, + String customAssessmentAutomationName, + CustomAssessmentAutomationRequest customAssessmentAutomationBody); + + /** + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * existing custom assessment automation will replace the existing record. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param customAssessmentAutomationBody Custom Assessment Automation body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom Assessment Automation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String customAssessmentAutomationName, + CustomAssessmentAutomationRequest customAssessmentAutomationBody, + Context context); + + /** + * Deletes a custom assessment automation by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 customAssessmentAutomationName); + + /** + * Deletes a custom assessment automation by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String customAssessmentAutomationName, Context context); + + /** + * List custom assessment automations by provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List custom assessment automations by provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List custom assessment automations by provided 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 a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List custom assessment automations by provided 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 a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomEntityStoreAssignmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomEntityStoreAssignmentsClient.java new file mode 100644 index 0000000000000..ad69fae85ad84 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomEntityStoreAssignmentsClient.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.CustomEntityStoreAssignmentInner; +import com.azure.resourcemanager.security.models.CustomEntityStoreAssignmentRequest; + +/** An instance of this class provides access to all the operations defined in CustomEntityStoreAssignmentsClient. */ +public interface CustomEntityStoreAssignmentsClient { + /** + * Gets a single custom entity store assignment by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom entity store assignment by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomEntityStoreAssignmentInner getByResourceGroup( + String resourceGroupName, String customEntityStoreAssignmentName); + + /** + * Gets a single custom entity store assignment by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom entity store assignment by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String customEntityStoreAssignmentName, Context context); + + /** + * Creates a custom entity store assignment for the provided subscription, if not already exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom entity store assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomEntityStoreAssignmentInner create( + String resourceGroupName, + String customEntityStoreAssignmentName, + CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody); + + /** + * Creates a custom entity store assignment for the provided subscription, if not already exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom entity store assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String customEntityStoreAssignmentName, + CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody, + Context context); + + /** + * Delete a custom entity store assignment by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String customEntityStoreAssignmentName); + + /** + * Delete a custom entity store assignment by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String customEntityStoreAssignmentName, Context context); + + /** + * List custom entity store assignments by a provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 custom entity store assignments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List custom entity store assignments by a provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 custom entity store assignments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List custom entity store assignments by provided 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 a list of custom entity store assignments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List custom entity store assignments by provided 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 a list of custom entity store assignments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesClient.java deleted file mode 100644 index 90532443f9ff6..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesClient.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.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.DeviceInner; - -/** An instance of this class provides access to all the operations defined in DevicesClient. */ -public interface DevicesClient { - /** - * Get device. - * - * @param resourceId The identifier of the resource. - * @param deviceId Identifier of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeviceInner get(String resourceId, String deviceId); - - /** - * Get device. - * - * @param resourceId The identifier of the resource. - * @param deviceId Identifier of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceId, String deviceId, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesForHubsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesForHubsClient.java deleted file mode 100644 index 69f002544a435..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesForHubsClient.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.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.DeviceInner; -import com.azure.resourcemanager.security.models.ManagementState; - -/** An instance of this class provides access to all the operations defined in DevicesForHubsClient. */ -public interface DevicesForHubsClient { - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices for the specified IoT Hub resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceId); - - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 the devices for the specified IoT Hub resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceId, Integer limit, String skipToken, ManagementState deviceManagementType, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesForSubscriptionsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesForSubscriptionsClient.java deleted file mode 100644 index 155c79771103f..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevicesForSubscriptionsClient.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.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.DeviceInner; -import com.azure.resourcemanager.security.models.ManagementState; - -/** An instance of this class provides access to all the operations defined in DevicesForSubscriptionsClient. */ -public interface DevicesForSubscriptionsClient { - /** - * Get list of the devices by their 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 the devices by their subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get list of the devices by their subscription. - * - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 the devices by their subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - Integer limit, String skipToken, ManagementState deviceManagementType, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotAlertsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotAlertsClient.java deleted file mode 100644 index add204e53a99b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotAlertsClient.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.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.IotAlertModelInner; -import com.azure.resourcemanager.security.models.ManagementState; - -/** An instance of this class provides access to all the operations defined in IotAlertsClient. */ -public interface IotAlertsClient { - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 IoT alerts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param minStartTimeUtc Filter by minimum startTimeUtc (ISO 8601 format). - * @param maxStartTimeUtc Filter by maximum startTimeUtc (ISO 8601 format). - * @param alertType Filter by alert type. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param compromisedEntity Filter by compromised device. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 IoT alerts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String scope, - String minStartTimeUtc, - String maxStartTimeUtc, - String alertType, - ManagementState deviceManagementType, - String compromisedEntity, - Integer limit, - String skipToken, - Context context); - - /** - * Get IoT alert. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotAlertId Id of the alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotAlertModelInner get(String scope, String iotAlertId); - - /** - * Get IoT alert. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotAlertId Id of the alert. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String iotAlertId, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotDefenderSettingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotDefenderSettingsClient.java deleted file mode 100644 index 2fc29dca00933..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotDefenderSettingsClient.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (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.http.rest.StreamResponse; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsListInner; -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsModelInner; -import com.azure.resourcemanager.security.fluent.models.PackageDownloadsInner; -import java.io.InputStream; - -/** An instance of this class provides access to all the operations defined in IotDefenderSettingsClient. */ -public interface IotDefenderSettingsClient { - /** - * List IoT Defender Settings. - * - * @throws com.azure.core.management.exception.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 IoT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotDefenderSettingsListInner list(); - - /** - * List IoT Defender 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 list of IoT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); - - /** - * Get IoT Defender Settings. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender Settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotDefenderSettingsModelInner get(); - - /** - * Get IoT Defender 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 ioT Defender Settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(Context context); - - /** - * Create or update IoT Defender settings. - * - * @param iotDefenderSettingsModel The IoT defender settings model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotDefenderSettingsModelInner createOrUpdate(IotDefenderSettingsModelInner iotDefenderSettingsModel); - - /** - * Create or update IoT Defender settings. - * - * @param iotDefenderSettingsModel The IoT defender settings model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - IotDefenderSettingsModelInner iotDefenderSettingsModel, Context context); - - /** - * Delete IoT Defender settings. - * - * @throws com.azure.core.management.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(); - - /** - * Delete IoT Defender 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 response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(Context context); - - /** - * Information about downloadable packages. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about package downloads. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PackageDownloadsInner packageDownloads(); - - /** - * Information about downloadable packages. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about package downloads. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response packageDownloadsWithResponse(Context context); - - /** - * Download manager activation data defined for this 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 the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InputStream downloadManagerActivation(); - - /** - * Download manager activation data defined for this 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 the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StreamResponse downloadManagerActivationWithResponse(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotRecommendationTypesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotRecommendationTypesClient.java deleted file mode 100644 index 73ef2991f597f..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotRecommendationTypesClient.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; - -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.IotRecommendationTypeInner; -import com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeListInner; - -/** An instance of this class provides access to all the operations defined in IotRecommendationTypesClient. */ -public interface IotRecommendationTypesClient { - /** - * List IoT recommendation types. - * - * @throws com.azure.core.management.exception.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 recommendation types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotRecommendationTypeListInner list(); - - /** - * List IoT recommendation types. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 recommendation types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); - - /** - * Get IoT recommendation type. - * - * @param iotRecommendationTypeName Name of the recommendation 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 ioT recommendation type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotRecommendationTypeInner get(String iotRecommendationTypeName); - - /** - * Get IoT recommendation type. - * - * @param iotRecommendationTypeName Name of the recommendation 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 ioT recommendation type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String iotRecommendationTypeName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotRecommendationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotRecommendationsClient.java deleted file mode 100644 index 8d800d83f3197..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotRecommendationsClient.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (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.IotRecommendationModelInner; - -/** An instance of this class provides access to all the operations defined in IotRecommendationsClient. */ -public interface IotRecommendationsClient { - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 IoT recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param recommendationType Filter by recommendation type. - * @param deviceId Filter by device id. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 IoT recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String scope, String recommendationType, String deviceId, Integer limit, String skipToken, Context context); - - /** - * Get IoT recommendation. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotRecommendationId Id of the recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotRecommendationModelInner get(String scope, String iotRecommendationId); - - /** - * Get IoT recommendation. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotRecommendationId Id of the recommendation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String iotRecommendationId, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSensorsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSensorsClient.java deleted file mode 100644 index 6ea5cb5022dc3..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSensorsClient.java +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright (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.http.rest.StreamResponse; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IotSensorsListInner; -import com.azure.resourcemanager.security.fluent.models.IotSensorsModelInner; -import com.azure.resourcemanager.security.models.ResetPasswordInput; -import java.io.InputStream; - -/** An instance of this class provides access to all the operations defined in IotSensorsClient. */ -public interface IotSensorsClient { - /** - * List IoT sensors. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotSensorsListInner list(String scope); - - /** - * List IoT sensors. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String scope, Context context); - - /** - * Get IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotSensorsModelInner get(String scope, String iotSensorName); - - /** - * Get IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String iotSensorName, Context context); - - /** - * Create or update IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param iotSensorsModel The IoT sensor model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotSensorsModelInner createOrUpdate(String scope, String iotSensorName, IotSensorsModelInner iotSensorsModel); - - /** - * Create or update IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param iotSensorsModel The IoT sensor model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String scope, String iotSensorName, IotSensorsModelInner iotSensorsModel, Context context); - - /** - * Delete IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String scope, String iotSensorName); - - /** - * Delete IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String scope, String iotSensorName, Context context); - - /** - * Download sensor activation file. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InputStream downloadActivation(String scope, String iotSensorName); - - /** - * Download sensor activation file. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StreamResponse downloadActivationWithResponse(String scope, String iotSensorName, Context context); - - /** - * Download file for reset password of the sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param body The reset password input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InputStream downloadResetPassword(String scope, String iotSensorName, ResetPasswordInput body); - - /** - * Download file for reset password of the sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param body The reset password input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StreamResponse downloadResetPasswordWithResponse( - String scope, String iotSensorName, ResetPasswordInput body, Context context); - - /** - * Trigger threat intelligence package update. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 triggerTiPackageUpdate(String scope, String iotSensorName); - - /** - * Trigger threat intelligence package update. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response triggerTiPackageUpdateWithResponse(String scope, String iotSensorName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSitesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSitesClient.java deleted file mode 100644 index 4945f8bc0f1df..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSitesClient.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.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.IotSitesListInner; -import com.azure.resourcemanager.security.fluent.models.IotSitesModelInner; - -/** An instance of this class provides access to all the operations defined in IotSitesClient. */ -public interface IotSitesClient { - /** - * List IoT sites. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 IoT sites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotSitesListInner list(String scope); - - /** - * List IoT sites. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 IoT sites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String scope, Context context); - - /** - * Get IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotSitesModelInner get(String scope); - - /** - * Get IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, Context context); - - /** - * Create or update IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSitesModel The IoT sites model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotSitesModelInner createOrUpdate(String scope, IotSitesModelInner iotSitesModel); - - /** - * Create or update IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSitesModel The IoT sites model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String scope, IotSitesModelInner iotSitesModel, Context context); - - /** - * Delete IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String scope); - - /** - * Delete IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String scope, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotAlertTypesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/MdeOnboardingsClient.java similarity index 64% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotAlertTypesClient.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/MdeOnboardingsClient.java index c61e6ae4bc962..004e5c72adce3 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotAlertTypesClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/MdeOnboardingsClient.java @@ -8,55 +8,52 @@ 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.IotAlertTypeInner; -import com.azure.resourcemanager.security.fluent.models.IotAlertTypeListInner; +import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner; +import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataListInner; -/** An instance of this class provides access to all the operations defined in IotAlertTypesClient. */ -public interface IotAlertTypesClient { +/** An instance of this class provides access to all the operations defined in MdeOnboardingsClient. */ +public interface MdeOnboardingsClient { /** - * List IoT alert types. + * The configuration or data needed to onboard the machine to MDE. * * @throws com.azure.core.management.exception.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 alert types. + * @return list of all MDE onboarding data resources. */ @ServiceMethod(returns = ReturnType.SINGLE) - IotAlertTypeListInner list(); + MdeOnboardingDataListInner list(); /** - * List IoT alert types. + * The configuration or data needed to onboard the machine to MDE. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 alert types. + * @return list of all MDE onboarding data resources. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); + Response listWithResponse(Context context); /** - * Get IoT alert type. + * The default configuration or data needed to onboard the machine to MDE. * - * @param iotAlertTypeName Name of the alert 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 ioT alert type. + * @return the resource of the configuration or data needed to onboard the machine to MDE. */ @ServiceMethod(returns = ReturnType.SINGLE) - IotAlertTypeInner get(String iotAlertTypeName); + MdeOnboardingDataInner get(); /** - * Get IoT alert type. + * The default configuration or data needed to onboard the machine to MDE. * - * @param iotAlertTypeName Name of the alert 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 ioT alert type. + * @return the resource of the configuration or data needed to onboard the machine to MDE. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String iotAlertTypeName, Context context); + Response getWithResponse(Context context); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OnPremiseIotSensorsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OnPremiseIotSensorsClient.java deleted file mode 100644 index 726cda7fbdbd9..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OnPremiseIotSensorsClient.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (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.http.rest.StreamResponse; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorInner; -import com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorsListInner; -import com.azure.resourcemanager.security.models.ResetPasswordInput; -import java.io.InputStream; - -/** An instance of this class provides access to all the operations defined in OnPremiseIotSensorsClient. */ -public interface OnPremiseIotSensorsClient { - /** - * List on-premise IoT sensors. - * - * @throws com.azure.core.management.exception.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 on-premise IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OnPremiseIotSensorsListInner list(); - - /** - * List on-premise IoT sensors. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 on-premise IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); - - /** - * Get on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OnPremiseIotSensorInner get(String onPremiseIotSensorName); - - /** - * Get on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String onPremiseIotSensorName, Context context); - - /** - * Create or update on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OnPremiseIotSensorInner createOrUpdate(String onPremiseIotSensorName); - - /** - * Create or update on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String onPremiseIotSensorName, Context context); - - /** - * Delete on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 onPremiseIotSensorName); - - /** - * Delete on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String onPremiseIotSensorName, Context context); - - /** - * Download sensor activation file. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InputStream downloadActivation(String onPremiseIotSensorName); - - /** - * Download sensor activation file. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StreamResponse downloadActivationWithResponse(String onPremiseIotSensorName, Context context); - - /** - * Download file for reset password of the sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param body Input for reset password. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InputStream downloadResetPassword(String onPremiseIotSensorName, ResetPasswordInput body); - - /** - * Download file for reset password of the sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param body Input for reset password. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StreamResponse downloadResetPasswordWithResponse( - String onPremiseIotSensorName, ResetPasswordInput body, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationsClient.java index 329a3db4ed772..6764dd2708f29 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationsClient.java @@ -17,7 +17,7 @@ public interface OperationsClient { * * @throws com.azure.core.management.exception.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 possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +29,7 @@ public interface OperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); 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 ed8d21449d3ab..0403f17dcb19c 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 @@ -37,6 +37,27 @@ public interface SecurityCenter { */ Duration getDefaultPollInterval(); + /** + * Gets the MdeOnboardingsClient object to access its operations. + * + * @return the MdeOnboardingsClient object. + */ + MdeOnboardingsClient getMdeOnboardings(); + + /** + * Gets the CustomAssessmentAutomationsClient object to access its operations. + * + * @return the CustomAssessmentAutomationsClient object. + */ + CustomAssessmentAutomationsClient getCustomAssessmentAutomations(); + + /** + * Gets the CustomEntityStoreAssignmentsClient object to access its operations. + * + * @return the CustomEntityStoreAssignmentsClient object. + */ + CustomEntityStoreAssignmentsClient getCustomEntityStoreAssignments(); + /** * Gets the ComplianceResultsClient object to access its operations. * @@ -324,83 +345,6 @@ public interface SecurityCenter { */ SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessmentBaselineRules(); - /** - * Gets the IotDefenderSettingsClient object to access its operations. - * - * @return the IotDefenderSettingsClient object. - */ - IotDefenderSettingsClient getIotDefenderSettings(); - - /** - * Gets the IotSensorsClient object to access its operations. - * - * @return the IotSensorsClient object. - */ - IotSensorsClient getIotSensors(); - - /** - * Gets the DevicesForSubscriptionsClient object to access its operations. - * - * @return the DevicesForSubscriptionsClient object. - */ - DevicesForSubscriptionsClient getDevicesForSubscriptions(); - - /** - * Gets the DevicesForHubsClient object to access its operations. - * - * @return the DevicesForHubsClient object. - */ - DevicesForHubsClient getDevicesForHubs(); - - /** - * Gets the DevicesClient object to access its operations. - * - * @return the DevicesClient object. - */ - DevicesClient getDevices(); - - /** - * Gets the OnPremiseIotSensorsClient object to access its operations. - * - * @return the OnPremiseIotSensorsClient object. - */ - OnPremiseIotSensorsClient getOnPremiseIotSensors(); - - /** - * Gets the IotSitesClient object to access its operations. - * - * @return the IotSitesClient object. - */ - IotSitesClient getIotSites(); - - /** - * Gets the IotAlertsClient object to access its operations. - * - * @return the IotAlertsClient object. - */ - IotAlertsClient getIotAlerts(); - - /** - * Gets the IotAlertTypesClient object to access its operations. - * - * @return the IotAlertTypesClient object. - */ - IotAlertTypesClient getIotAlertTypes(); - - /** - * Gets the IotRecommendationsClient object to access its operations. - * - * @return the IotRecommendationsClient object. - */ - IotRecommendationsClient getIotRecommendations(); - - /** - * Gets the IotRecommendationTypesClient object to access its operations. - * - * @return the IotRecommendationTypesClient object. - */ - IotRecommendationTypesClient getIotRecommendationTypes(); - /** * Gets the AlertsClient object to access its operations. * @@ -428,4 +372,11 @@ public interface SecurityCenter { * @return the SoftwareInventoriesClient object. */ SoftwareInventoriesClient getSoftwareInventories(); + + /** + * 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/SecurityConnectorsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorsClient.java new file mode 100644 index 0000000000000..4fb3b7a67b025 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorsClient.java @@ -0,0 +1,200 @@ +// Copyright (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.SecurityConnectorInner; + +/** An instance of this class provides access to all the operations defined in SecurityConnectorsClient. */ +public interface SecurityConnectorsClient { + /** + * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to + * get the next page of security connectors for the specified 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 security connectors response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to + * get the next page of security connectors for the specified 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 security connectors response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to + * get the next page of security connectors for the specified resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 list of security connectors response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to + * get the next page of security connectors for the specified resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 list of security connectors response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieves details of a specific security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityConnectorInner getByResourceGroup(String resourceGroupName, String securityConnectorName); + + /** + * Retrieves details of a specific security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String securityConnectorName, Context context); + + /** + * Creates or updates a security connector. If a security connector is already created and a subsequent request is + * issued for the same security connector id, then it will be updated. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param securityConnectorName The security connector name. + * @param securityConnector The security connector resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityConnectorInner createOrUpdate( + String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector); + + /** + * Creates or updates a security connector. If a security connector is already created and a subsequent request is + * issued for the same security connector id, then it will be updated. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param securityConnectorName The security connector name. + * @param securityConnector The security connector resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String securityConnectorName, + SecurityConnectorInner securityConnector, + Context context); + + /** + * Updates a security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param securityConnectorName The security connector name. + * @param securityConnector The security connector resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityConnectorInner update( + String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector); + + /** + * Updates a security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param securityConnectorName The security connector name. + * @param securityConnector The security connector resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String securityConnectorName, + SecurityConnectorInner securityConnector, + Context context); + + /** + * Deletes a security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String securityConnectorName, Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsClient.java index 6725b6c2d2b1f..1264c94b400e6 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsClient.java @@ -135,7 +135,7 @@ Response createOrUpdateWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String resourceNamespace, String resourceType, String resourceName); @@ -153,7 +153,7 @@ SyncPoller, Void> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupData.java new file mode 100644 index 0000000000000..5c635b7a80637 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupData.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.AdaptiveApplicationControlIssueSummary; +import com.azure.resourcemanager.security.models.ConfigurationStatus; +import com.azure.resourcemanager.security.models.EnforcementMode; +import com.azure.resourcemanager.security.models.PathRecommendation; +import com.azure.resourcemanager.security.models.ProtectionMode; +import com.azure.resourcemanager.security.models.RecommendationStatus; +import com.azure.resourcemanager.security.models.SourceSystem; +import com.azure.resourcemanager.security.models.VmRecommendation; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents a machines group and set of rules to be allowed running on a machine. */ +@Fluent +public final class AdaptiveApplicationControlGroupData { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AdaptiveApplicationControlGroupData.class); + + /* + * The application control policy enforcement/protection mode of the + * machine group + */ + @JsonProperty(value = "enforcementMode") + private EnforcementMode enforcementMode; + + /* + * The protection mode of the collection/file types. Exe/Msi/Script are + * used for Windows, Executable is used for Linux. + */ + @JsonProperty(value = "protectionMode") + private ProtectionMode protectionMode; + + /* + * The configuration status of the machines group or machine or rule + */ + @JsonProperty(value = "configurationStatus", access = JsonProperty.Access.WRITE_ONLY) + private ConfigurationStatus configurationStatus; + + /* + * The initial recommendation status of the machine group or machine + */ + @JsonProperty(value = "recommendationStatus", access = JsonProperty.Access.WRITE_ONLY) + private RecommendationStatus recommendationStatus; + + /* + * The issues property. + */ + @JsonProperty(value = "issues", access = JsonProperty.Access.WRITE_ONLY) + private List issues; + + /* + * The source type of the machine group + */ + @JsonProperty(value = "sourceSystem", access = JsonProperty.Access.WRITE_ONLY) + private SourceSystem sourceSystem; + + /* + * The vmRecommendations property. + */ + @JsonProperty(value = "vmRecommendations") + private List vmRecommendations; + + /* + * The pathRecommendations property. + */ + @JsonProperty(value = "pathRecommendations") + private List pathRecommendations; + + /** + * Get the enforcementMode property: The application control policy enforcement/protection mode of the machine + * group. + * + * @return the enforcementMode value. + */ + public EnforcementMode enforcementMode() { + return this.enforcementMode; + } + + /** + * Set the enforcementMode property: The application control policy enforcement/protection mode of the machine + * group. + * + * @param enforcementMode the enforcementMode value to set. + * @return the AdaptiveApplicationControlGroupData object itself. + */ + public AdaptiveApplicationControlGroupData withEnforcementMode(EnforcementMode enforcementMode) { + this.enforcementMode = enforcementMode; + return this; + } + + /** + * Get the protectionMode property: The protection mode of the collection/file types. Exe/Msi/Script are used for + * Windows, Executable is used for Linux. + * + * @return the protectionMode value. + */ + public ProtectionMode protectionMode() { + return this.protectionMode; + } + + /** + * Set the protectionMode property: The protection mode of the collection/file types. Exe/Msi/Script are used for + * Windows, Executable is used for Linux. + * + * @param protectionMode the protectionMode value to set. + * @return the AdaptiveApplicationControlGroupData object itself. + */ + public AdaptiveApplicationControlGroupData withProtectionMode(ProtectionMode protectionMode) { + this.protectionMode = protectionMode; + return this; + } + + /** + * Get the configurationStatus property: The configuration status of the machines group or machine or rule. + * + * @return the configurationStatus value. + */ + public ConfigurationStatus configurationStatus() { + return this.configurationStatus; + } + + /** + * Get the recommendationStatus property: The initial recommendation status of the machine group or machine. + * + * @return the recommendationStatus value. + */ + public RecommendationStatus recommendationStatus() { + return this.recommendationStatus; + } + + /** + * Get the issues property: The issues property. + * + * @return the issues value. + */ + public List issues() { + return this.issues; + } + + /** + * Get the sourceSystem property: The source type of the machine group. + * + * @return the sourceSystem value. + */ + public SourceSystem sourceSystem() { + return this.sourceSystem; + } + + /** + * Get the vmRecommendations property: The vmRecommendations property. + * + * @return the vmRecommendations value. + */ + public List vmRecommendations() { + return this.vmRecommendations; + } + + /** + * Set the vmRecommendations property: The vmRecommendations property. + * + * @param vmRecommendations the vmRecommendations value to set. + * @return the AdaptiveApplicationControlGroupData object itself. + */ + public AdaptiveApplicationControlGroupData withVmRecommendations(List vmRecommendations) { + this.vmRecommendations = vmRecommendations; + return this; + } + + /** + * Get the pathRecommendations property: The pathRecommendations property. + * + * @return the pathRecommendations value. + */ + public List pathRecommendations() { + return this.pathRecommendations; + } + + /** + * Set the pathRecommendations property: The pathRecommendations property. + * + * @param pathRecommendations the pathRecommendations value to set. + * @return the AdaptiveApplicationControlGroupData object itself. + */ + public AdaptiveApplicationControlGroupData withPathRecommendations(List pathRecommendations) { + this.pathRecommendations = pathRecommendations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protectionMode() != null) { + protectionMode().validate(); + } + if (issues() != null) { + issues().forEach(e -> e.validate()); + } + if (vmRecommendations() != null) { + vmRecommendations().forEach(e -> e.validate()); + } + if (pathRecommendations() != null) { + pathRecommendations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupInner.java index 63eb3290cc2e3..75d8599ebb214 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.AdaptiveApplicationControlIssueSummary; @@ -21,66 +20,41 @@ import java.util.List; /** The AdaptiveApplicationControlGroup model. */ -@JsonFlatten @Fluent -public class AdaptiveApplicationControlGroupInner extends ProxyResource { +public final class AdaptiveApplicationControlGroupInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(AdaptiveApplicationControlGroupInner.class); /* - * The application control policy enforcement/protection mode of the - * machine group + * Represents a machines group and set of rules to be allowed running on a + * machine */ - @JsonProperty(value = "properties.enforcementMode") - private EnforcementMode enforcementMode; + @JsonProperty(value = "properties", required = true) + private AdaptiveApplicationControlGroupData innerProperties = new AdaptiveApplicationControlGroupData(); /* - * The protection mode of the collection/file types. Exe/Msi/Script are - * used for Windows, Executable is used for Linux. - */ - @JsonProperty(value = "properties.protectionMode") - private ProtectionMode protectionMode; - - /* - * The configuration status of the machines group or machine or rule - */ - @JsonProperty(value = "properties.configurationStatus", access = JsonProperty.Access.WRITE_ONLY) - private ConfigurationStatus configurationStatus; - - /* - * The initial recommendation status of the machine group or machine - */ - @JsonProperty(value = "properties.recommendationStatus", access = JsonProperty.Access.WRITE_ONLY) - private RecommendationStatus recommendationStatus; - - /* - * The issues property. - */ - @JsonProperty(value = "properties.issues", access = JsonProperty.Access.WRITE_ONLY) - private List issues; - - /* - * The source type of the machine group - */ - @JsonProperty(value = "properties.sourceSystem", access = JsonProperty.Access.WRITE_ONLY) - private SourceSystem sourceSystem; - - /* - * The vmRecommendations property. + * Location where the resource is stored */ - @JsonProperty(value = "properties.vmRecommendations") - private List vmRecommendations; + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; - /* - * The pathRecommendations property. + /** + * Get the innerProperties property: Represents a machines group and set of rules to be allowed running on a + * machine. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.pathRecommendations") - private List pathRecommendations; + private AdaptiveApplicationControlGroupData innerProperties() { + return this.innerProperties; + } - /* - * Location where the resource is stored + /** + * Get the location property: Location where the resource is stored. + * + * @return the location value. */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; + public String location() { + return this.location; + } /** * Get the enforcementMode property: The application control policy enforcement/protection mode of the machine @@ -89,7 +63,7 @@ public class AdaptiveApplicationControlGroupInner extends ProxyResource { * @return the enforcementMode value. */ public EnforcementMode enforcementMode() { - return this.enforcementMode; + return this.innerProperties() == null ? null : this.innerProperties().enforcementMode(); } /** @@ -100,7 +74,10 @@ public EnforcementMode enforcementMode() { * @return the AdaptiveApplicationControlGroupInner object itself. */ public AdaptiveApplicationControlGroupInner withEnforcementMode(EnforcementMode enforcementMode) { - this.enforcementMode = enforcementMode; + if (this.innerProperties() == null) { + this.innerProperties = new AdaptiveApplicationControlGroupData(); + } + this.innerProperties().withEnforcementMode(enforcementMode); return this; } @@ -111,7 +88,7 @@ public AdaptiveApplicationControlGroupInner withEnforcementMode(EnforcementMode * @return the protectionMode value. */ public ProtectionMode protectionMode() { - return this.protectionMode; + return this.innerProperties() == null ? null : this.innerProperties().protectionMode(); } /** @@ -122,7 +99,10 @@ public ProtectionMode protectionMode() { * @return the AdaptiveApplicationControlGroupInner object itself. */ public AdaptiveApplicationControlGroupInner withProtectionMode(ProtectionMode protectionMode) { - this.protectionMode = protectionMode; + if (this.innerProperties() == null) { + this.innerProperties = new AdaptiveApplicationControlGroupData(); + } + this.innerProperties().withProtectionMode(protectionMode); return this; } @@ -132,7 +112,7 @@ public AdaptiveApplicationControlGroupInner withProtectionMode(ProtectionMode pr * @return the configurationStatus value. */ public ConfigurationStatus configurationStatus() { - return this.configurationStatus; + return this.innerProperties() == null ? null : this.innerProperties().configurationStatus(); } /** @@ -141,7 +121,7 @@ public ConfigurationStatus configurationStatus() { * @return the recommendationStatus value. */ public RecommendationStatus recommendationStatus() { - return this.recommendationStatus; + return this.innerProperties() == null ? null : this.innerProperties().recommendationStatus(); } /** @@ -150,7 +130,7 @@ public RecommendationStatus recommendationStatus() { * @return the issues value. */ public List issues() { - return this.issues; + return this.innerProperties() == null ? null : this.innerProperties().issues(); } /** @@ -159,7 +139,7 @@ public List issues() { * @return the sourceSystem value. */ public SourceSystem sourceSystem() { - return this.sourceSystem; + return this.innerProperties() == null ? null : this.innerProperties().sourceSystem(); } /** @@ -168,7 +148,7 @@ public SourceSystem sourceSystem() { * @return the vmRecommendations value. */ public List vmRecommendations() { - return this.vmRecommendations; + return this.innerProperties() == null ? null : this.innerProperties().vmRecommendations(); } /** @@ -178,7 +158,10 @@ public List vmRecommendations() { * @return the AdaptiveApplicationControlGroupInner object itself. */ public AdaptiveApplicationControlGroupInner withVmRecommendations(List vmRecommendations) { - this.vmRecommendations = vmRecommendations; + if (this.innerProperties() == null) { + this.innerProperties = new AdaptiveApplicationControlGroupData(); + } + this.innerProperties().withVmRecommendations(vmRecommendations); return this; } @@ -188,7 +171,7 @@ public AdaptiveApplicationControlGroupInner withVmRecommendations(List pathRecommendations() { - return this.pathRecommendations; + return this.innerProperties() == null ? null : this.innerProperties().pathRecommendations(); } /** @@ -198,36 +181,26 @@ public List pathRecommendations() { * @return the AdaptiveApplicationControlGroupInner object itself. */ public AdaptiveApplicationControlGroupInner withPathRecommendations(List pathRecommendations) { - this.pathRecommendations = pathRecommendations; + if (this.innerProperties() == null) { + this.innerProperties = new AdaptiveApplicationControlGroupData(); + } + this.innerProperties().withPathRecommendations(pathRecommendations); return this; } - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (protectionMode() != null) { - protectionMode().validate(); - } - if (issues() != null) { - issues().forEach(e -> e.validate()); - } - if (vmRecommendations() != null) { - vmRecommendations().forEach(e -> e.validate()); - } - if (pathRecommendations() != null) { - pathRecommendations().forEach(e -> e.validate()); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model AdaptiveApplicationControlGroupInner")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveNetworkHardeningInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveNetworkHardeningInner.java index a8762ab580285..6ec61cca0aeb9 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveNetworkHardeningInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveNetworkHardeningInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.EffectiveNetworkSecurityGroups; @@ -16,29 +15,24 @@ import java.util.List; /** The resource whose properties describes the Adaptive Network Hardening settings for some Azure resource. */ -@JsonFlatten @Fluent -public class AdaptiveNetworkHardeningInner extends ProxyResource { +public final class AdaptiveNetworkHardeningInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(AdaptiveNetworkHardeningInner.class); /* - * The security rules which are recommended to be effective on the VM + * Properties of the Adaptive Network Hardening resource */ - @JsonProperty(value = "properties.rules") - private List rules; + @JsonProperty(value = "properties") + private AdaptiveNetworkHardeningProperties innerProperties; - /* - * The UTC time on which the rules were calculated - */ - @JsonProperty(value = "properties.rulesCalculationTime") - private OffsetDateTime rulesCalculationTime; - - /* - * The Network Security Groups effective on the network interfaces of the - * protected resource + /** + * Get the innerProperties property: Properties of the Adaptive Network Hardening resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.effectiveNetworkSecurityGroups") - private List effectiveNetworkSecurityGroups; + private AdaptiveNetworkHardeningProperties innerProperties() { + return this.innerProperties; + } /** * Get the rules property: The security rules which are recommended to be effective on the VM. @@ -46,7 +40,7 @@ public class AdaptiveNetworkHardeningInner extends ProxyResource { * @return the rules value. */ public List rules() { - return this.rules; + return this.innerProperties() == null ? null : this.innerProperties().rules(); } /** @@ -56,7 +50,10 @@ public List rules() { * @return the AdaptiveNetworkHardeningInner object itself. */ public AdaptiveNetworkHardeningInner withRules(List rules) { - this.rules = rules; + if (this.innerProperties() == null) { + this.innerProperties = new AdaptiveNetworkHardeningProperties(); + } + this.innerProperties().withRules(rules); return this; } @@ -66,7 +63,7 @@ public AdaptiveNetworkHardeningInner withRules(List rules) { * @return the rulesCalculationTime value. */ public OffsetDateTime rulesCalculationTime() { - return this.rulesCalculationTime; + return this.innerProperties() == null ? null : this.innerProperties().rulesCalculationTime(); } /** @@ -76,7 +73,10 @@ public OffsetDateTime rulesCalculationTime() { * @return the AdaptiveNetworkHardeningInner object itself. */ public AdaptiveNetworkHardeningInner withRulesCalculationTime(OffsetDateTime rulesCalculationTime) { - this.rulesCalculationTime = rulesCalculationTime; + if (this.innerProperties() == null) { + this.innerProperties = new AdaptiveNetworkHardeningProperties(); + } + this.innerProperties().withRulesCalculationTime(rulesCalculationTime); return this; } @@ -87,7 +87,7 @@ public AdaptiveNetworkHardeningInner withRulesCalculationTime(OffsetDateTime rul * @return the effectiveNetworkSecurityGroups value. */ public List effectiveNetworkSecurityGroups() { - return this.effectiveNetworkSecurityGroups; + return this.innerProperties() == null ? null : this.innerProperties().effectiveNetworkSecurityGroups(); } /** @@ -99,7 +99,10 @@ public List effectiveNetworkSecurityGroups() { */ public AdaptiveNetworkHardeningInner withEffectiveNetworkSecurityGroups( List effectiveNetworkSecurityGroups) { - this.effectiveNetworkSecurityGroups = effectiveNetworkSecurityGroups; + if (this.innerProperties() == null) { + this.innerProperties = new AdaptiveNetworkHardeningProperties(); + } + this.innerProperties().withEffectiveNetworkSecurityGroups(effectiveNetworkSecurityGroups); return this; } @@ -109,11 +112,8 @@ public AdaptiveNetworkHardeningInner withEffectiveNetworkSecurityGroups( * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (rules() != null) { - rules().forEach(e -> e.validate()); - } - if (effectiveNetworkSecurityGroups() != null) { - effectiveNetworkSecurityGroups().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveNetworkHardeningProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveNetworkHardeningProperties.java new file mode 100644 index 0000000000000..66c28da722f3f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveNetworkHardeningProperties.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.EffectiveNetworkSecurityGroups; +import com.azure.resourcemanager.security.models.Rule; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Adaptive Network Hardening resource properties. */ +@Fluent +public final class AdaptiveNetworkHardeningProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AdaptiveNetworkHardeningProperties.class); + + /* + * The security rules which are recommended to be effective on the VM + */ + @JsonProperty(value = "rules") + private List rules; + + /* + * The UTC time on which the rules were calculated + */ + @JsonProperty(value = "rulesCalculationTime") + private OffsetDateTime rulesCalculationTime; + + /* + * The Network Security Groups effective on the network interfaces of the + * protected resource + */ + @JsonProperty(value = "effectiveNetworkSecurityGroups") + private List effectiveNetworkSecurityGroups; + + /** + * Get the rules property: The security rules which are recommended to be effective on the VM. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: The security rules which are recommended to be effective on the VM. + * + * @param rules the rules value to set. + * @return the AdaptiveNetworkHardeningProperties object itself. + */ + public AdaptiveNetworkHardeningProperties withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the rulesCalculationTime property: The UTC time on which the rules were calculated. + * + * @return the rulesCalculationTime value. + */ + public OffsetDateTime rulesCalculationTime() { + return this.rulesCalculationTime; + } + + /** + * Set the rulesCalculationTime property: The UTC time on which the rules were calculated. + * + * @param rulesCalculationTime the rulesCalculationTime value to set. + * @return the AdaptiveNetworkHardeningProperties object itself. + */ + public AdaptiveNetworkHardeningProperties withRulesCalculationTime(OffsetDateTime rulesCalculationTime) { + this.rulesCalculationTime = rulesCalculationTime; + return this; + } + + /** + * Get the effectiveNetworkSecurityGroups property: The Network Security Groups effective on the network interfaces + * of the protected resource. + * + * @return the effectiveNetworkSecurityGroups value. + */ + public List effectiveNetworkSecurityGroups() { + return this.effectiveNetworkSecurityGroups; + } + + /** + * Set the effectiveNetworkSecurityGroups property: The Network Security Groups effective on the network interfaces + * of the protected resource. + * + * @param effectiveNetworkSecurityGroups the effectiveNetworkSecurityGroups value to set. + * @return the AdaptiveNetworkHardeningProperties object itself. + */ + public AdaptiveNetworkHardeningProperties withEffectiveNetworkSecurityGroups( + List effectiveNetworkSecurityGroups) { + this.effectiveNetworkSecurityGroups = effectiveNetworkSecurityGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + if (effectiveNetworkSecurityGroups() != null) { + effectiveNetworkSecurityGroups().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionProperties.java new file mode 100644 index 0000000000000..d98045af1ca19 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Advanced Threat Protection settings. */ +@Fluent +public final class AdvancedThreatProtectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AdvancedThreatProtectionProperties.class); + + /* + * Indicates whether Advanced Threat Protection is enabled. + */ + @JsonProperty(value = "isEnabled") + private Boolean isEnabled; + + /** + * Get the isEnabled property: Indicates whether Advanced Threat Protection is enabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set the isEnabled property: Indicates whether Advanced Threat Protection is enabled. + * + * @param isEnabled the isEnabled value to set. + * @return the AdvancedThreatProtectionProperties object itself. + */ + public AdvancedThreatProtectionProperties withIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + 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/AdvancedThreatProtectionSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionSettingInner.java index c632466c79a07..23576567daaf8 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionSettingInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionSettingInner.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The Advanced Threat Protection resource. */ -@JsonFlatten @Fluent -public class AdvancedThreatProtectionSettingInner extends ProxyResource { +public final class AdvancedThreatProtectionSettingInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(AdvancedThreatProtectionSettingInner.class); /* - * Indicates whether Advanced Threat Protection is enabled. + * The Advanced Threat Protection settings. */ - @JsonProperty(value = "properties.isEnabled") - private Boolean isEnabled; + @JsonProperty(value = "properties") + private AdvancedThreatProtectionProperties innerProperties; + + /** + * Get the innerProperties property: The Advanced Threat Protection settings. + * + * @return the innerProperties value. + */ + private AdvancedThreatProtectionProperties innerProperties() { + return this.innerProperties; + } /** * Get the isEnabled property: Indicates whether Advanced Threat Protection is enabled. @@ -29,7 +36,7 @@ public class AdvancedThreatProtectionSettingInner extends ProxyResource { * @return the isEnabled value. */ public Boolean isEnabled() { - return this.isEnabled; + return this.innerProperties() == null ? null : this.innerProperties().isEnabled(); } /** @@ -39,7 +46,10 @@ public Boolean isEnabled() { * @return the AdvancedThreatProtectionSettingInner object itself. */ public AdvancedThreatProtectionSettingInner withIsEnabled(Boolean isEnabled) { - this.isEnabled = isEnabled; + if (this.innerProperties() == null) { + this.innerProperties = new AdvancedThreatProtectionProperties(); + } + this.innerProperties().withIsEnabled(isEnabled); return this; } @@ -49,5 +59,8 @@ public AdvancedThreatProtectionSettingInner withIsEnabled(Boolean isEnabled) { * @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/AlertInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertInner.java index ad7e64021e14a..d9af0e4cf0b9d 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.AlertEntity; @@ -20,161 +19,24 @@ import java.util.Map; /** Security alert. */ -@JsonFlatten @Fluent -public class AlertInner extends ProxyResource { +public final class AlertInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertInner.class); /* - * Unique identifier for the detection logic (all alert instances from the - * same detection logic will have the same alertType). + * describes security alert properties. */ - @JsonProperty(value = "properties.alertType", access = JsonProperty.Access.WRITE_ONLY) - private String alertType; + @JsonProperty(value = "properties") + private AlertProperties innerProperties; - /* - * Unique identifier for the alert. - */ - @JsonProperty(value = "properties.systemAlertId", access = JsonProperty.Access.WRITE_ONLY) - private String systemAlertId; - - /* - * The name of Azure Security Center pricing tier which powering this - * alert. Learn more: - * https://docs.microsoft.com/en-us/azure/security-center/security-center-pricing - */ - @JsonProperty(value = "properties.productComponentName", access = JsonProperty.Access.WRITE_ONLY) - private String productComponentName; - - /* - * The display name of the alert. - */ - @JsonProperty(value = "properties.alertDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String alertDisplayName; - - /* - * Description of the suspicious activity that was detected. - */ - @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * The risk level of the threat that was detected. Learn more: - * https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified. - */ - @JsonProperty(value = "properties.severity", access = JsonProperty.Access.WRITE_ONLY) - private AlertSeverity severity; - - /* - * The kill chain related intent behind the alert. For list of supported - * values, and explanations of Azure Security Center's supported kill chain - * intents. - */ - @JsonProperty(value = "properties.intent", access = JsonProperty.Access.WRITE_ONLY) - private Intent intent; - - /* - * The UTC time of the first event or activity included in the alert in - * ISO8601 format. - */ - @JsonProperty(value = "properties.startTimeUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime startTimeUtc; - - /* - * The UTC time of the last event or activity included in the alert in - * ISO8601 format. - */ - @JsonProperty(value = "properties.endTimeUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime endTimeUtc; - - /* - * The resource identifiers that can be used to direct the alert to the - * right product exposure group (tenant, workspace, subscription etc.). - * There can be multiple identifiers of different type per alert. - */ - @JsonProperty(value = "properties.resourceIdentifiers", access = JsonProperty.Access.WRITE_ONLY) - private List resourceIdentifiers; - - /* - * Manual action items to take to remediate the alert. - */ - @JsonProperty(value = "properties.remediationSteps", access = JsonProperty.Access.WRITE_ONLY) - private List remediationSteps; - - /* - * The name of the vendor that raises the alert. - */ - @JsonProperty(value = "properties.vendorName", access = JsonProperty.Access.WRITE_ONLY) - private String vendorName; - - /* - * The life cycle status of the alert. - */ - @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) - private AlertStatus status; - - /* - * Links related to the alert - */ - @JsonProperty(value = "properties.extendedLinks", access = JsonProperty.Access.WRITE_ONLY) - private List> extendedLinks; - - /* - * A direct link to the alert page in Azure Portal. - */ - @JsonProperty(value = "properties.alertUri", access = JsonProperty.Access.WRITE_ONLY) - private String alertUri; - - /* - * The UTC time the alert was generated in ISO8601 format. - */ - @JsonProperty(value = "properties.timeGeneratedUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime timeGeneratedUtc; - - /* - * The name of the product which published this alert (Azure Security - * Center, Azure ATP, Microsoft Defender ATP, O365 ATP, MCAS, and so on). - */ - @JsonProperty(value = "properties.productName", access = JsonProperty.Access.WRITE_ONLY) - private String productName; - - /* - * The UTC processing end time of the alert in ISO8601 format. - */ - @JsonProperty(value = "properties.processingEndTimeUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime processingEndTimeUtc; - - /* - * A list of entities related to the alert. - */ - @JsonProperty(value = "properties.entities", access = JsonProperty.Access.WRITE_ONLY) - private List entities; - - /* - * This field determines whether the alert is an incident (a compound - * grouping of several alerts) or a single alert. - */ - @JsonProperty(value = "properties.isIncident", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isIncident; - - /* - * Key for corelating related alerts. Alerts with the same correlation key - * considered to be related. - */ - @JsonProperty(value = "properties.correlationKey", access = JsonProperty.Access.WRITE_ONLY) - private String correlationKey; - - /* - * Custom properties for the alert. - */ - @JsonProperty(value = "properties.extendedProperties") - private Map extendedProperties; - - /* - * The display name of the resource most related to this alert. + /** + * Get the innerProperties property: describes security alert properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.compromisedEntity", access = JsonProperty.Access.WRITE_ONLY) - private String compromisedEntity; + private AlertProperties innerProperties() { + return this.innerProperties; + } /** * Get the alertType property: Unique identifier for the detection logic (all alert instances from the same @@ -183,7 +45,7 @@ public class AlertInner extends ProxyResource { * @return the alertType value. */ public String alertType() { - return this.alertType; + return this.innerProperties() == null ? null : this.innerProperties().alertType(); } /** @@ -192,7 +54,7 @@ public String alertType() { * @return the systemAlertId value. */ public String systemAlertId() { - return this.systemAlertId; + return this.innerProperties() == null ? null : this.innerProperties().systemAlertId(); } /** @@ -202,7 +64,7 @@ public String systemAlertId() { * @return the productComponentName value. */ public String productComponentName() { - return this.productComponentName; + return this.innerProperties() == null ? null : this.innerProperties().productComponentName(); } /** @@ -211,7 +73,7 @@ public String productComponentName() { * @return the alertDisplayName value. */ public String alertDisplayName() { - return this.alertDisplayName; + return this.innerProperties() == null ? null : this.innerProperties().alertDisplayName(); } /** @@ -220,7 +82,7 @@ public String alertDisplayName() { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -230,7 +92,7 @@ public String description() { * @return the severity value. */ public AlertSeverity severity() { - return this.severity; + return this.innerProperties() == null ? null : this.innerProperties().severity(); } /** @@ -240,7 +102,7 @@ public AlertSeverity severity() { * @return the intent value. */ public Intent intent() { - return this.intent; + return this.innerProperties() == null ? null : this.innerProperties().intent(); } /** @@ -250,7 +112,7 @@ public Intent intent() { * @return the startTimeUtc value. */ public OffsetDateTime startTimeUtc() { - return this.startTimeUtc; + return this.innerProperties() == null ? null : this.innerProperties().startTimeUtc(); } /** @@ -259,7 +121,7 @@ public OffsetDateTime startTimeUtc() { * @return the endTimeUtc value. */ public OffsetDateTime endTimeUtc() { - return this.endTimeUtc; + return this.innerProperties() == null ? null : this.innerProperties().endTimeUtc(); } /** @@ -270,7 +132,7 @@ public OffsetDateTime endTimeUtc() { * @return the resourceIdentifiers value. */ public List resourceIdentifiers() { - return this.resourceIdentifiers; + return this.innerProperties() == null ? null : this.innerProperties().resourceIdentifiers(); } /** @@ -279,7 +141,7 @@ public List resourceIdentifiers() { * @return the remediationSteps value. */ public List remediationSteps() { - return this.remediationSteps; + return this.innerProperties() == null ? null : this.innerProperties().remediationSteps(); } /** @@ -288,7 +150,7 @@ public List remediationSteps() { * @return the vendorName value. */ public String vendorName() { - return this.vendorName; + return this.innerProperties() == null ? null : this.innerProperties().vendorName(); } /** @@ -297,7 +159,7 @@ public String vendorName() { * @return the status value. */ public AlertStatus status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -306,7 +168,7 @@ public AlertStatus status() { * @return the extendedLinks value. */ public List> extendedLinks() { - return this.extendedLinks; + return this.innerProperties() == null ? null : this.innerProperties().extendedLinks(); } /** @@ -315,7 +177,7 @@ public List> extendedLinks() { * @return the alertUri value. */ public String alertUri() { - return this.alertUri; + return this.innerProperties() == null ? null : this.innerProperties().alertUri(); } /** @@ -324,7 +186,7 @@ public String alertUri() { * @return the timeGeneratedUtc value. */ public OffsetDateTime timeGeneratedUtc() { - return this.timeGeneratedUtc; + return this.innerProperties() == null ? null : this.innerProperties().timeGeneratedUtc(); } /** @@ -334,7 +196,7 @@ public OffsetDateTime timeGeneratedUtc() { * @return the productName value. */ public String productName() { - return this.productName; + return this.innerProperties() == null ? null : this.innerProperties().productName(); } /** @@ -343,7 +205,7 @@ public String productName() { * @return the processingEndTimeUtc value. */ public OffsetDateTime processingEndTimeUtc() { - return this.processingEndTimeUtc; + return this.innerProperties() == null ? null : this.innerProperties().processingEndTimeUtc(); } /** @@ -352,7 +214,7 @@ public OffsetDateTime processingEndTimeUtc() { * @return the entities value. */ public List entities() { - return this.entities; + return this.innerProperties() == null ? null : this.innerProperties().entities(); } /** @@ -362,7 +224,7 @@ public List entities() { * @return the isIncident value. */ public Boolean isIncident() { - return this.isIncident; + return this.innerProperties() == null ? null : this.innerProperties().isIncident(); } /** @@ -372,7 +234,7 @@ public Boolean isIncident() { * @return the correlationKey value. */ public String correlationKey() { - return this.correlationKey; + return this.innerProperties() == null ? null : this.innerProperties().correlationKey(); } /** @@ -381,7 +243,7 @@ public String correlationKey() { * @return the extendedProperties value. */ public Map extendedProperties() { - return this.extendedProperties; + return this.innerProperties() == null ? null : this.innerProperties().extendedProperties(); } /** @@ -391,7 +253,10 @@ public Map extendedProperties() { * @return the AlertInner object itself. */ public AlertInner withExtendedProperties(Map extendedProperties) { - this.extendedProperties = extendedProperties; + if (this.innerProperties() == null) { + this.innerProperties = new AlertProperties(); + } + this.innerProperties().withExtendedProperties(extendedProperties); return this; } @@ -401,7 +266,7 @@ public AlertInner withExtendedProperties(Map extendedProperties) * @return the compromisedEntity value. */ public String compromisedEntity() { - return this.compromisedEntity; + return this.innerProperties() == null ? null : this.innerProperties().compromisedEntity(); } /** @@ -410,11 +275,8 @@ public String compromisedEntity() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (resourceIdentifiers() != null) { - resourceIdentifiers().forEach(e -> e.validate()); - } - if (entities() != null) { - entities().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertProperties.java new file mode 100644 index 0000000000000..c49ea3a997687 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertProperties.java @@ -0,0 +1,419 @@ +// Copyright (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.AlertEntity; +import com.azure.resourcemanager.security.models.AlertSeverity; +import com.azure.resourcemanager.security.models.AlertStatus; +import com.azure.resourcemanager.security.models.Intent; +import com.azure.resourcemanager.security.models.ResourceIdentifier; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** describes security alert properties. */ +@Fluent +public final class AlertProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertProperties.class); + + /* + * Unique identifier for the detection logic (all alert instances from the + * same detection logic will have the same alertType). + */ + @JsonProperty(value = "alertType", access = JsonProperty.Access.WRITE_ONLY) + private String alertType; + + /* + * Unique identifier for the alert. + */ + @JsonProperty(value = "systemAlertId", access = JsonProperty.Access.WRITE_ONLY) + private String systemAlertId; + + /* + * The name of Azure Security Center pricing tier which powering this + * alert. Learn more: + * https://docs.microsoft.com/en-us/azure/security-center/security-center-pricing + */ + @JsonProperty(value = "productComponentName", access = JsonProperty.Access.WRITE_ONLY) + private String productComponentName; + + /* + * The display name of the alert. + */ + @JsonProperty(value = "alertDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String alertDisplayName; + + /* + * Description of the suspicious activity that was detected. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The risk level of the threat that was detected. Learn more: + * https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified. + */ + @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) + private AlertSeverity severity; + + /* + * The kill chain related intent behind the alert. For list of supported + * values, and explanations of Azure Security Center's supported kill chain + * intents. + */ + @JsonProperty(value = "intent", access = JsonProperty.Access.WRITE_ONLY) + private Intent intent; + + /* + * The UTC time of the first event or activity included in the alert in + * ISO8601 format. + */ + @JsonProperty(value = "startTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTimeUtc; + + /* + * The UTC time of the last event or activity included in the alert in + * ISO8601 format. + */ + @JsonProperty(value = "endTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endTimeUtc; + + /* + * The resource identifiers that can be used to direct the alert to the + * right product exposure group (tenant, workspace, subscription etc.). + * There can be multiple identifiers of different type per alert. + */ + @JsonProperty(value = "resourceIdentifiers", access = JsonProperty.Access.WRITE_ONLY) + private List resourceIdentifiers; + + /* + * Manual action items to take to remediate the alert. + */ + @JsonProperty(value = "remediationSteps", access = JsonProperty.Access.WRITE_ONLY) + private List remediationSteps; + + /* + * The name of the vendor that raises the alert. + */ + @JsonProperty(value = "vendorName", access = JsonProperty.Access.WRITE_ONLY) + private String vendorName; + + /* + * The life cycle status of the alert. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private AlertStatus status; + + /* + * Links related to the alert + */ + @JsonProperty(value = "extendedLinks", access = JsonProperty.Access.WRITE_ONLY) + private List> extendedLinks; + + /* + * A direct link to the alert page in Azure Portal. + */ + @JsonProperty(value = "alertUri", access = JsonProperty.Access.WRITE_ONLY) + private String alertUri; + + /* + * The UTC time the alert was generated in ISO8601 format. + */ + @JsonProperty(value = "timeGeneratedUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timeGeneratedUtc; + + /* + * The name of the product which published this alert (Azure Security + * Center, Azure ATP, Microsoft Defender ATP, O365 ATP, MCAS, and so on). + */ + @JsonProperty(value = "productName", access = JsonProperty.Access.WRITE_ONLY) + private String productName; + + /* + * The UTC processing end time of the alert in ISO8601 format. + */ + @JsonProperty(value = "processingEndTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime processingEndTimeUtc; + + /* + * A list of entities related to the alert. + */ + @JsonProperty(value = "entities", access = JsonProperty.Access.WRITE_ONLY) + private List entities; + + /* + * This field determines whether the alert is an incident (a compound + * grouping of several alerts) or a single alert. + */ + @JsonProperty(value = "isIncident", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isIncident; + + /* + * Key for corelating related alerts. Alerts with the same correlation key + * considered to be related. + */ + @JsonProperty(value = "correlationKey", access = JsonProperty.Access.WRITE_ONLY) + private String correlationKey; + + /* + * Custom properties for the alert. + */ + @JsonProperty(value = "extendedProperties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map extendedProperties; + + /* + * The display name of the resource most related to this alert. + */ + @JsonProperty(value = "compromisedEntity", access = JsonProperty.Access.WRITE_ONLY) + private String compromisedEntity; + + /** + * Get the alertType property: Unique identifier for the detection logic (all alert instances from the same + * detection logic will have the same alertType). + * + * @return the alertType value. + */ + public String alertType() { + return this.alertType; + } + + /** + * Get the systemAlertId property: Unique identifier for the alert. + * + * @return the systemAlertId value. + */ + public String systemAlertId() { + return this.systemAlertId; + } + + /** + * Get the productComponentName property: The name of Azure Security Center pricing tier which powering this alert. + * Learn more: https://docs.microsoft.com/en-us/azure/security-center/security-center-pricing. + * + * @return the productComponentName value. + */ + public String productComponentName() { + return this.productComponentName; + } + + /** + * Get the alertDisplayName property: The display name of the alert. + * + * @return the alertDisplayName value. + */ + public String alertDisplayName() { + return this.alertDisplayName; + } + + /** + * Get the description property: Description of the suspicious activity that was detected. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the severity property: The risk level of the threat that was detected. Learn more: + * https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.severity; + } + + /** + * Get the intent property: The kill chain related intent behind the alert. For list of supported values, and + * explanations of Azure Security Center's supported kill chain intents. + * + * @return the intent value. + */ + public Intent intent() { + return this.intent; + } + + /** + * Get the startTimeUtc property: The UTC time of the first event or activity included in the alert in ISO8601 + * format. + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.startTimeUtc; + } + + /** + * Get the endTimeUtc property: The UTC time of the last event or activity included in the alert in ISO8601 format. + * + * @return the endTimeUtc value. + */ + public OffsetDateTime endTimeUtc() { + return this.endTimeUtc; + } + + /** + * Get the resourceIdentifiers property: The resource identifiers that can be used to direct the alert to the right + * product exposure group (tenant, workspace, subscription etc.). There can be multiple identifiers of different + * type per alert. + * + * @return the resourceIdentifiers value. + */ + public List resourceIdentifiers() { + return this.resourceIdentifiers; + } + + /** + * Get the remediationSteps property: Manual action items to take to remediate the alert. + * + * @return the remediationSteps value. + */ + public List remediationSteps() { + return this.remediationSteps; + } + + /** + * Get the vendorName property: The name of the vendor that raises the alert. + * + * @return the vendorName value. + */ + public String vendorName() { + return this.vendorName; + } + + /** + * Get the status property: The life cycle status of the alert. + * + * @return the status value. + */ + public AlertStatus status() { + return this.status; + } + + /** + * Get the extendedLinks property: Links related to the alert. + * + * @return the extendedLinks value. + */ + public List> extendedLinks() { + return this.extendedLinks; + } + + /** + * Get the alertUri property: A direct link to the alert page in Azure Portal. + * + * @return the alertUri value. + */ + public String alertUri() { + return this.alertUri; + } + + /** + * Get the timeGeneratedUtc property: The UTC time the alert was generated in ISO8601 format. + * + * @return the timeGeneratedUtc value. + */ + public OffsetDateTime timeGeneratedUtc() { + return this.timeGeneratedUtc; + } + + /** + * Get the productName property: The name of the product which published this alert (Azure Security Center, Azure + * ATP, Microsoft Defender ATP, O365 ATP, MCAS, and so on). + * + * @return the productName value. + */ + public String productName() { + return this.productName; + } + + /** + * Get the processingEndTimeUtc property: The UTC processing end time of the alert in ISO8601 format. + * + * @return the processingEndTimeUtc value. + */ + public OffsetDateTime processingEndTimeUtc() { + return this.processingEndTimeUtc; + } + + /** + * Get the entities property: A list of entities related to the alert. + * + * @return the entities value. + */ + public List entities() { + return this.entities; + } + + /** + * Get the isIncident property: This field determines whether the alert is an incident (a compound grouping of + * several alerts) or a single alert. + * + * @return the isIncident value. + */ + public Boolean isIncident() { + return this.isIncident; + } + + /** + * Get the correlationKey property: Key for corelating related alerts. Alerts with the same correlation key + * considered to be related. + * + * @return the correlationKey value. + */ + public String correlationKey() { + return this.correlationKey; + } + + /** + * Get the extendedProperties property: Custom properties for the alert. + * + * @return the extendedProperties value. + */ + public Map extendedProperties() { + return this.extendedProperties; + } + + /** + * Set the extendedProperties property: Custom properties for the alert. + * + * @param extendedProperties the extendedProperties value to set. + * @return the AlertProperties object itself. + */ + public AlertProperties withExtendedProperties(Map extendedProperties) { + this.extendedProperties = extendedProperties; + return this; + } + + /** + * Get the compromisedEntity property: The display name of the resource most related to this alert. + * + * @return the compromisedEntity value. + */ + public String compromisedEntity() { + return this.compromisedEntity; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceIdentifiers() != null) { + resourceIdentifiers().forEach(e -> e.validate()); + } + if (entities() != null) { + entities().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotAlertTypeListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertSyncSettingProperties.java similarity index 51% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotAlertTypeListInner.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertSyncSettingProperties.java index d428d8283f9a5..9df4af2284680 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotAlertTypeListInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertSyncSettingProperties.java @@ -8,36 +8,35 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -/** List of alert types. */ +/** The alert sync setting properties. */ @Fluent -public final class IotAlertTypeListInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotAlertTypeListInner.class); +public final class AlertSyncSettingProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertSyncSettingProperties.class); /* - * List data + * Is the alert sync setting enabled */ - @JsonProperty(value = "value") - private List value; + @JsonProperty(value = "enabled", required = true) + private boolean enabled; /** - * Get the value property: List data. + * Get the enabled property: Is the alert sync setting enabled. * - * @return the value value. + * @return the enabled value. */ - public List value() { - return this.value; + public boolean enabled() { + return this.enabled; } /** - * Set the value property: List data. + * Set the enabled property: Is the alert sync setting enabled. * - * @param value the value value to set. - * @return the IotAlertTypeListInner object itself. + * @param enabled the enabled value to set. + * @return the AlertSyncSettingProperties object itself. */ - public IotAlertTypeListInner withValue(List value) { - this.value = value; + public AlertSyncSettingProperties withEnabled(boolean enabled) { + this.enabled = enabled; return this; } @@ -47,8 +46,5 @@ public IotAlertTypeListInner withValue(List value) { * @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/AlertsSuppressionRuleInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleInner.java index b5caf1f52bd05..2c2415c41e84f 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.RuleState; @@ -15,54 +14,24 @@ import java.time.OffsetDateTime; /** Describes the suppression rule. */ -@JsonFlatten @Fluent -public class AlertsSuppressionRuleInner extends ProxyResource { +public final class AlertsSuppressionRuleInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertsSuppressionRuleInner.class); /* - * Type of the alert to automatically suppress. For all alert types, use - * '*' + * describes AlertsSuppressionRule properties */ - @JsonProperty(value = "properties.alertType") - private String alertType; + @JsonProperty(value = "properties") + private AlertsSuppressionRuleProperties innerProperties; - /* - * The last time this rule was modified - */ - @JsonProperty(value = "properties.lastModifiedUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedUtc; - - /* - * Expiration date of the rule, if value is not provided or provided as - * null this field will default to the maximum allowed expiration date. - */ - @JsonProperty(value = "properties.expirationDateUtc") - private OffsetDateTime expirationDateUtc; - - /* - * The reason for dismissing the alert - */ - @JsonProperty(value = "properties.reason") - private String reason; - - /* - * Possible states of the rule - */ - @JsonProperty(value = "properties.state") - private RuleState state; - - /* - * Any comment regarding the rule - */ - @JsonProperty(value = "properties.comment") - private String comment; - - /* - * The suppression conditions + /** + * Get the innerProperties property: describes AlertsSuppressionRule properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.suppressionAlertsScope") - private SuppressionAlertsScope suppressionAlertsScope; + private AlertsSuppressionRuleProperties innerProperties() { + return this.innerProperties; + } /** * Get the alertType property: Type of the alert to automatically suppress. For all alert types, use '*'. @@ -70,7 +39,7 @@ public class AlertsSuppressionRuleInner extends ProxyResource { * @return the alertType value. */ public String alertType() { - return this.alertType; + return this.innerProperties() == null ? null : this.innerProperties().alertType(); } /** @@ -80,7 +49,10 @@ public String alertType() { * @return the AlertsSuppressionRuleInner object itself. */ public AlertsSuppressionRuleInner withAlertType(String alertType) { - this.alertType = alertType; + if (this.innerProperties() == null) { + this.innerProperties = new AlertsSuppressionRuleProperties(); + } + this.innerProperties().withAlertType(alertType); return this; } @@ -90,7 +62,7 @@ public AlertsSuppressionRuleInner withAlertType(String alertType) { * @return the lastModifiedUtc value. */ public OffsetDateTime lastModifiedUtc() { - return this.lastModifiedUtc; + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedUtc(); } /** @@ -100,7 +72,7 @@ public OffsetDateTime lastModifiedUtc() { * @return the expirationDateUtc value. */ public OffsetDateTime expirationDateUtc() { - return this.expirationDateUtc; + return this.innerProperties() == null ? null : this.innerProperties().expirationDateUtc(); } /** @@ -111,7 +83,10 @@ public OffsetDateTime expirationDateUtc() { * @return the AlertsSuppressionRuleInner object itself. */ public AlertsSuppressionRuleInner withExpirationDateUtc(OffsetDateTime expirationDateUtc) { - this.expirationDateUtc = expirationDateUtc; + if (this.innerProperties() == null) { + this.innerProperties = new AlertsSuppressionRuleProperties(); + } + this.innerProperties().withExpirationDateUtc(expirationDateUtc); return this; } @@ -121,7 +96,7 @@ public AlertsSuppressionRuleInner withExpirationDateUtc(OffsetDateTime expiratio * @return the reason value. */ public String reason() { - return this.reason; + return this.innerProperties() == null ? null : this.innerProperties().reason(); } /** @@ -131,7 +106,10 @@ public String reason() { * @return the AlertsSuppressionRuleInner object itself. */ public AlertsSuppressionRuleInner withReason(String reason) { - this.reason = reason; + if (this.innerProperties() == null) { + this.innerProperties = new AlertsSuppressionRuleProperties(); + } + this.innerProperties().withReason(reason); return this; } @@ -141,7 +119,7 @@ public AlertsSuppressionRuleInner withReason(String reason) { * @return the state value. */ public RuleState state() { - return this.state; + return this.innerProperties() == null ? null : this.innerProperties().state(); } /** @@ -151,7 +129,10 @@ public RuleState state() { * @return the AlertsSuppressionRuleInner object itself. */ public AlertsSuppressionRuleInner withState(RuleState state) { - this.state = state; + if (this.innerProperties() == null) { + this.innerProperties = new AlertsSuppressionRuleProperties(); + } + this.innerProperties().withState(state); return this; } @@ -161,7 +142,7 @@ public AlertsSuppressionRuleInner withState(RuleState state) { * @return the comment value. */ public String comment() { - return this.comment; + return this.innerProperties() == null ? null : this.innerProperties().comment(); } /** @@ -171,7 +152,10 @@ public String comment() { * @return the AlertsSuppressionRuleInner object itself. */ public AlertsSuppressionRuleInner withComment(String comment) { - this.comment = comment; + if (this.innerProperties() == null) { + this.innerProperties = new AlertsSuppressionRuleProperties(); + } + this.innerProperties().withComment(comment); return this; } @@ -181,7 +165,7 @@ public AlertsSuppressionRuleInner withComment(String comment) { * @return the suppressionAlertsScope value. */ public SuppressionAlertsScope suppressionAlertsScope() { - return this.suppressionAlertsScope; + return this.innerProperties() == null ? null : this.innerProperties().suppressionAlertsScope(); } /** @@ -191,7 +175,10 @@ public SuppressionAlertsScope suppressionAlertsScope() { * @return the AlertsSuppressionRuleInner object itself. */ public AlertsSuppressionRuleInner withSuppressionAlertsScope(SuppressionAlertsScope suppressionAlertsScope) { - this.suppressionAlertsScope = suppressionAlertsScope; + if (this.innerProperties() == null) { + this.innerProperties = new AlertsSuppressionRuleProperties(); + } + this.innerProperties().withSuppressionAlertsScope(suppressionAlertsScope); return this; } @@ -201,8 +188,8 @@ public AlertsSuppressionRuleInner withSuppressionAlertsScope(SuppressionAlertsSc * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (suppressionAlertsScope() != null) { - suppressionAlertsScope().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleProperties.java new file mode 100644 index 0000000000000..ba26580369a38 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleProperties.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.RuleState; +import com.azure.resourcemanager.security.models.SuppressionAlertsScope; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** describes AlertsSuppressionRule properties. */ +@Fluent +public final class AlertsSuppressionRuleProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertsSuppressionRuleProperties.class); + + /* + * Type of the alert to automatically suppress. For all alert types, use + * '*' + */ + @JsonProperty(value = "alertType", required = true) + private String alertType; + + /* + * The last time this rule was modified + */ + @JsonProperty(value = "lastModifiedUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedUtc; + + /* + * Expiration date of the rule, if value is not provided or provided as + * null this field will default to the maximum allowed expiration date. + */ + @JsonProperty(value = "expirationDateUtc") + private OffsetDateTime expirationDateUtc; + + /* + * The reason for dismissing the alert + */ + @JsonProperty(value = "reason", required = true) + private String reason; + + /* + * Possible states of the rule + */ + @JsonProperty(value = "state", required = true) + private RuleState state; + + /* + * Any comment regarding the rule + */ + @JsonProperty(value = "comment") + private String comment; + + /* + * The suppression conditions + */ + @JsonProperty(value = "suppressionAlertsScope") + private SuppressionAlertsScope suppressionAlertsScope; + + /** + * Get the alertType property: Type of the alert to automatically suppress. For all alert types, use '*'. + * + * @return the alertType value. + */ + public String alertType() { + return this.alertType; + } + + /** + * Set the alertType property: Type of the alert to automatically suppress. For all alert types, use '*'. + * + * @param alertType the alertType value to set. + * @return the AlertsSuppressionRuleProperties object itself. + */ + public AlertsSuppressionRuleProperties withAlertType(String alertType) { + this.alertType = alertType; + return this; + } + + /** + * Get the lastModifiedUtc property: The last time this rule was modified. + * + * @return the lastModifiedUtc value. + */ + public OffsetDateTime lastModifiedUtc() { + return this.lastModifiedUtc; + } + + /** + * Get the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null + * this field will default to the maximum allowed expiration date. + * + * @return the expirationDateUtc value. + */ + public OffsetDateTime expirationDateUtc() { + return this.expirationDateUtc; + } + + /** + * Set the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null + * this field will default to the maximum allowed expiration date. + * + * @param expirationDateUtc the expirationDateUtc value to set. + * @return the AlertsSuppressionRuleProperties object itself. + */ + public AlertsSuppressionRuleProperties withExpirationDateUtc(OffsetDateTime expirationDateUtc) { + this.expirationDateUtc = expirationDateUtc; + return this; + } + + /** + * Get the reason property: The reason for dismissing the alert. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason property: The reason for dismissing the alert. + * + * @param reason the reason value to set. + * @return the AlertsSuppressionRuleProperties object itself. + */ + public AlertsSuppressionRuleProperties withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get the state property: Possible states of the rule. + * + * @return the state value. + */ + public RuleState state() { + return this.state; + } + + /** + * Set the state property: Possible states of the rule. + * + * @param state the state value to set. + * @return the AlertsSuppressionRuleProperties object itself. + */ + public AlertsSuppressionRuleProperties withState(RuleState state) { + this.state = state; + return this; + } + + /** + * Get the comment property: Any comment regarding the rule. + * + * @return the comment value. + */ + public String comment() { + return this.comment; + } + + /** + * Set the comment property: Any comment regarding the rule. + * + * @param comment the comment value to set. + * @return the AlertsSuppressionRuleProperties object itself. + */ + public AlertsSuppressionRuleProperties withComment(String comment) { + this.comment = comment; + return this; + } + + /** + * Get the suppressionAlertsScope property: The suppression conditions. + * + * @return the suppressionAlertsScope value. + */ + public SuppressionAlertsScope suppressionAlertsScope() { + return this.suppressionAlertsScope; + } + + /** + * Set the suppressionAlertsScope property: The suppression conditions. + * + * @param suppressionAlertsScope the suppressionAlertsScope value to set. + * @return the AlertsSuppressionRuleProperties object itself. + */ + public AlertsSuppressionRuleProperties withSuppressionAlertsScope(SuppressionAlertsScope suppressionAlertsScope) { + this.suppressionAlertsScope = suppressionAlertsScope; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (alertType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property alertType in model AlertsSuppressionRuleProperties")); + } + if (reason() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property reason in model AlertsSuppressionRuleProperties")); + } + if (state() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property state in model AlertsSuppressionRuleProperties")); + } + if (suppressionAlertsScope() != null) { + suppressionAlertsScope().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceInner.java index ac7921e03ee60..ca1430347a1b6 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.ConnectableResource; @@ -15,22 +14,15 @@ import java.util.List; /** The resource whose properties describes the allowed traffic between Azure resources. */ -@JsonFlatten @Immutable -public class AllowedConnectionsResourceInner extends ProxyResource { +public final class AllowedConnectionsResourceInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(AllowedConnectionsResourceInner.class); /* - * The UTC time on which the allowed connections resource was calculated + * Describes the allowed traffic between Azure resources */ - @JsonProperty(value = "properties.calculatedDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime calculatedDateTime; - - /* - * List of connectable resources - */ - @JsonProperty(value = "properties.connectableResources", access = JsonProperty.Access.WRITE_ONLY) - private List connectableResources; + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private AllowedConnectionsResourceProperties innerProperties; /* * Location where the resource is stored @@ -38,13 +30,31 @@ public class AllowedConnectionsResourceInner extends ProxyResource { @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) private String location; + /** + * Get the innerProperties property: Describes the allowed traffic between Azure resources. + * + * @return the innerProperties value. + */ + private AllowedConnectionsResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the location property: Location where the resource is stored. + * + * @return the location value. + */ + public String location() { + return this.location; + } + /** * Get the calculatedDateTime property: The UTC time on which the allowed connections resource was calculated. * * @return the calculatedDateTime value. */ public OffsetDateTime calculatedDateTime() { - return this.calculatedDateTime; + return this.innerProperties() == null ? null : this.innerProperties().calculatedDateTime(); } /** @@ -53,16 +63,7 @@ public OffsetDateTime calculatedDateTime() { * @return the connectableResources value. */ public List connectableResources() { - return this.connectableResources; - } - - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; + return this.innerProperties() == null ? null : this.innerProperties().connectableResources(); } /** @@ -71,8 +72,8 @@ public String location() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (connectableResources() != null) { - connectableResources().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceProperties.java new file mode 100644 index 0000000000000..e381815b091ad --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceProperties.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.ConnectableResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Describes the allowed traffic between Azure resources. */ +@Immutable +public final class AllowedConnectionsResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AllowedConnectionsResourceProperties.class); + + /* + * The UTC time on which the allowed connections resource was calculated + */ + @JsonProperty(value = "calculatedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime calculatedDateTime; + + /* + * List of connectable resources + */ + @JsonProperty(value = "connectableResources", access = JsonProperty.Access.WRITE_ONLY) + private List connectableResources; + + /** + * Get the calculatedDateTime property: The UTC time on which the allowed connections resource was calculated. + * + * @return the calculatedDateTime value. + */ + public OffsetDateTime calculatedDateTime() { + return this.calculatedDateTime; + } + + /** + * Get the connectableResources property: List of connectable resources. + * + * @return the connectableResources value. + */ + public List connectableResources() { + return this.connectableResources; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectableResources() != null) { + connectableResources().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingInner.java index 610be89c5ce20..b3910bc41143a 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.AutoProvision; @@ -13,16 +12,24 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** Auto provisioning setting. */ -@JsonFlatten @Fluent -public class AutoProvisioningSettingInner extends ProxyResource { +public final class AutoProvisioningSettingInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoProvisioningSettingInner.class); /* - * Describes what kind of security agent provisioning action to take + * Auto provisioning setting data */ - @JsonProperty(value = "properties.autoProvision") - private AutoProvision autoProvision; + @JsonProperty(value = "properties") + private AutoProvisioningSettingProperties innerProperties; + + /** + * Get the innerProperties property: Auto provisioning setting data. + * + * @return the innerProperties value. + */ + private AutoProvisioningSettingProperties innerProperties() { + return this.innerProperties; + } /** * Get the autoProvision property: Describes what kind of security agent provisioning action to take. @@ -30,7 +37,7 @@ public class AutoProvisioningSettingInner extends ProxyResource { * @return the autoProvision value. */ public AutoProvision autoProvision() { - return this.autoProvision; + return this.innerProperties() == null ? null : this.innerProperties().autoProvision(); } /** @@ -40,7 +47,10 @@ public AutoProvision autoProvision() { * @return the AutoProvisioningSettingInner object itself. */ public AutoProvisioningSettingInner withAutoProvision(AutoProvision autoProvision) { - this.autoProvision = autoProvision; + if (this.innerProperties() == null) { + this.innerProperties = new AutoProvisioningSettingProperties(); + } + this.innerProperties().withAutoProvision(autoProvision); return this; } @@ -50,5 +60,8 @@ public AutoProvisioningSettingInner withAutoProvision(AutoProvision autoProvisio * @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/AutoProvisioningSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingProperties.java new file mode 100644 index 0000000000000..bccec967125ce --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingProperties.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.AutoProvision; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** describes properties of an auto provisioning setting. */ +@Fluent +public final class AutoProvisioningSettingProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoProvisioningSettingProperties.class); + + /* + * Describes what kind of security agent provisioning action to take + */ + @JsonProperty(value = "autoProvision", required = true) + private AutoProvision autoProvision; + + /** + * Get the autoProvision property: Describes what kind of security agent provisioning action to take. + * + * @return the autoProvision value. + */ + public AutoProvision autoProvision() { + return this.autoProvision; + } + + /** + * Set the autoProvision property: Describes what kind of security agent provisioning action to take. + * + * @param autoProvision the autoProvision value to set. + * @return the AutoProvisioningSettingProperties object itself. + */ + public AutoProvisioningSettingProperties withAutoProvision(AutoProvision autoProvision) { + this.autoProvision = autoProvision; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (autoProvision() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property autoProvision in model AutoProvisioningSettingProperties")); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationInner.java index a1fb76d81b554..09eca97ffa03e 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.AutomationAction; @@ -17,45 +16,38 @@ import java.util.Map; /** The security automation resource. */ -@JsonFlatten @Fluent -public class AutomationInner extends Resource { +public final class AutomationInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomationInner.class); /* - * The security automation description. + * Security automation data */ - @JsonProperty(value = "properties.description") - private String description; + @JsonProperty(value = "properties") + private AutomationProperties innerProperties; - /* - * Indicates whether the security automation is enabled. - */ - @JsonProperty(value = "properties.isEnabled") - private Boolean isEnabled; - - /* - * A collection of scopes on which the security automations logic is - * applied. Supported scopes are the subscription itself or a resource - * group under that subscription. The automation will only apply on defined - * scopes. + /** + * Get the innerProperties property: Security automation data. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.scopes") - private List scopes; + private AutomationProperties innerProperties() { + return this.innerProperties; + } - /* - * A collection of the source event types which evaluate the security - * automation set of rules. - */ - @JsonProperty(value = "properties.sources") - private List sources; + /** {@inheritDoc} */ + @Override + public AutomationInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * A collection of the actions which are triggered if all the configured - * rules evaluations, within at least one rule set, are true. - */ - @JsonProperty(value = "properties.actions") - private List actions; + /** {@inheritDoc} */ + @Override + public AutomationInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the description property: The security automation description. @@ -63,7 +55,7 @@ public class AutomationInner extends Resource { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -73,7 +65,10 @@ public String description() { * @return the AutomationInner object itself. */ public AutomationInner withDescription(String description) { - this.description = description; + if (this.innerProperties() == null) { + this.innerProperties = new AutomationProperties(); + } + this.innerProperties().withDescription(description); return this; } @@ -83,7 +78,7 @@ public AutomationInner withDescription(String description) { * @return the isEnabled value. */ public Boolean isEnabled() { - return this.isEnabled; + return this.innerProperties() == null ? null : this.innerProperties().isEnabled(); } /** @@ -93,7 +88,10 @@ public Boolean isEnabled() { * @return the AutomationInner object itself. */ public AutomationInner withIsEnabled(Boolean isEnabled) { - this.isEnabled = isEnabled; + if (this.innerProperties() == null) { + this.innerProperties = new AutomationProperties(); + } + this.innerProperties().withIsEnabled(isEnabled); return this; } @@ -105,7 +103,7 @@ public AutomationInner withIsEnabled(Boolean isEnabled) { * @return the scopes value. */ public List scopes() { - return this.scopes; + return this.innerProperties() == null ? null : this.innerProperties().scopes(); } /** @@ -117,7 +115,10 @@ public List scopes() { * @return the AutomationInner object itself. */ public AutomationInner withScopes(List scopes) { - this.scopes = scopes; + if (this.innerProperties() == null) { + this.innerProperties = new AutomationProperties(); + } + this.innerProperties().withScopes(scopes); return this; } @@ -128,7 +129,7 @@ public AutomationInner withScopes(List scopes) { * @return the sources value. */ public List sources() { - return this.sources; + return this.innerProperties() == null ? null : this.innerProperties().sources(); } /** @@ -139,7 +140,10 @@ public List sources() { * @return the AutomationInner object itself. */ public AutomationInner withSources(List sources) { - this.sources = sources; + if (this.innerProperties() == null) { + this.innerProperties = new AutomationProperties(); + } + this.innerProperties().withSources(sources); return this; } @@ -150,7 +154,7 @@ public AutomationInner withSources(List sources) { * @return the actions value. */ public List actions() { - return this.actions; + return this.innerProperties() == null ? null : this.innerProperties().actions(); } /** @@ -161,21 +165,10 @@ public List actions() { * @return the AutomationInner object itself. */ public AutomationInner withActions(List actions) { - this.actions = actions; - return this; - } - - /** {@inheritDoc} */ - @Override - public AutomationInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public AutomationInner withTags(Map tags) { - super.withTags(tags); + if (this.innerProperties() == null) { + this.innerProperties = new AutomationProperties(); + } + this.innerProperties().withActions(actions); return this; } @@ -185,14 +178,8 @@ public AutomationInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (scopes() != null) { - scopes().forEach(e -> e.validate()); - } - if (sources() != null) { - sources().forEach(e -> e.validate()); - } - if (actions() != null) { - actions().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationProperties.java new file mode 100644 index 0000000000000..598158ca30018 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationProperties.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.AutomationAction; +import com.azure.resourcemanager.security.models.AutomationScope; +import com.azure.resourcemanager.security.models.AutomationSource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A set of properties that defines the behavior of the automation configuration. To learn more about the supported + * security events data models schemas - please visit https://aka.ms/ASCAutomationSchemas. + */ +@Fluent +public final class AutomationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomationProperties.class); + + /* + * The security automation description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Indicates whether the security automation is enabled. + */ + @JsonProperty(value = "isEnabled") + private Boolean isEnabled; + + /* + * A collection of scopes on which the security automations logic is + * applied. Supported scopes are the subscription itself or a resource + * group under that subscription. The automation will only apply on defined + * scopes. + */ + @JsonProperty(value = "scopes") + private List scopes; + + /* + * A collection of the source event types which evaluate the security + * automation set of rules. + */ + @JsonProperty(value = "sources") + private List sources; + + /* + * A collection of the actions which are triggered if all the configured + * rules evaluations, within at least one rule set, are true. + */ + @JsonProperty(value = "actions") + private List actions; + + /** + * Get the description property: The security automation description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The security automation description. + * + * @param description the description value to set. + * @return the AutomationProperties object itself. + */ + public AutomationProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the isEnabled property: Indicates whether the security automation is enabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set the isEnabled property: Indicates whether the security automation is enabled. + * + * @param isEnabled the isEnabled value to set. + * @return the AutomationProperties object itself. + */ + public AutomationProperties withIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get the scopes property: A collection of scopes on which the security automations logic is applied. Supported + * scopes are the subscription itself or a resource group under that subscription. The automation will only apply on + * defined scopes. + * + * @return the scopes value. + */ + public List scopes() { + return this.scopes; + } + + /** + * Set the scopes property: A collection of scopes on which the security automations logic is applied. Supported + * scopes are the subscription itself or a resource group under that subscription. The automation will only apply on + * defined scopes. + * + * @param scopes the scopes value to set. + * @return the AutomationProperties object itself. + */ + public AutomationProperties withScopes(List scopes) { + this.scopes = scopes; + return this; + } + + /** + * Get the sources property: A collection of the source event types which evaluate the security automation set of + * rules. + * + * @return the sources value. + */ + public List sources() { + return this.sources; + } + + /** + * Set the sources property: A collection of the source event types which evaluate the security automation set of + * rules. + * + * @param sources the sources value to set. + * @return the AutomationProperties object itself. + */ + public AutomationProperties withSources(List sources) { + this.sources = sources; + return this; + } + + /** + * Get the actions property: A collection of the actions which are triggered if all the configured rules + * evaluations, within at least one rule set, are true. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: A collection of the actions which are triggered if all the configured rules + * evaluations, within at least one rule set, are true. + * + * @param actions the actions value to set. + * @return the AutomationProperties object itself. + */ + public AutomationProperties withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scopes() != null) { + scopes().forEach(e -> e.validate()); + } + if (sources() != null) { + sources().forEach(e -> e.validate()); + } + if (actions() != null) { + actions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceInner.java index a06540a177745..6f8b098c1b51e 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceInner.java @@ -4,8 +4,7 @@ package com.azure.resourcemanager.security.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.ComplianceSegment; @@ -15,30 +14,24 @@ import java.util.List; /** Compliance of a scope. */ -@JsonFlatten -@Immutable -public class ComplianceInner extends ProxyResource { +@Fluent +public final class ComplianceInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ComplianceInner.class); /* - * The timestamp when the Compliance calculation was conducted. + * Compliance data */ - @JsonProperty(value = "properties.assessmentTimestampUtcDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime assessmentTimestampUtcDate; + @JsonProperty(value = "properties") + private ComplianceProperties innerProperties; - /* - * The resource count of the given subscription for which the Compliance - * calculation was conducted (needed for Management Group Compliance - * calculation). - */ - @JsonProperty(value = "properties.resourceCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer resourceCount; - - /* - * An array of segment, which is the actually the compliance assessment. + /** + * Get the innerProperties property: Compliance data. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.assessmentResult", access = JsonProperty.Access.WRITE_ONLY) - private List assessmentResult; + private ComplianceProperties innerProperties() { + return this.innerProperties; + } /** * Get the assessmentTimestampUtcDate property: The timestamp when the Compliance calculation was conducted. @@ -46,7 +39,7 @@ public class ComplianceInner extends ProxyResource { * @return the assessmentTimestampUtcDate value. */ public OffsetDateTime assessmentTimestampUtcDate() { - return this.assessmentTimestampUtcDate; + return this.innerProperties() == null ? null : this.innerProperties().assessmentTimestampUtcDate(); } /** @@ -56,7 +49,7 @@ public OffsetDateTime assessmentTimestampUtcDate() { * @return the resourceCount value. */ public Integer resourceCount() { - return this.resourceCount; + return this.innerProperties() == null ? null : this.innerProperties().resourceCount(); } /** @@ -65,7 +58,7 @@ public Integer resourceCount() { * @return the assessmentResult value. */ public List assessmentResult() { - return this.assessmentResult; + return this.innerProperties() == null ? null : this.innerProperties().assessmentResult(); } /** @@ -74,8 +67,8 @@ public List assessmentResult() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (assessmentResult() != null) { - assessmentResult().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceProperties.java new file mode 100644 index 0000000000000..8bdd306e97c42 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceProperties.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.ComplianceSegment; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * The Compliance score (percentage) of a Subscription is a sum of all Resources' Compliances under the given + * Subscription. A Resource Compliance is defined as the compliant ('healthy') Policy Definitions out of all Policy + * Definitions applicable to a given resource. + */ +@Immutable +public final class ComplianceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ComplianceProperties.class); + + /* + * The timestamp when the Compliance calculation was conducted. + */ + @JsonProperty(value = "assessmentTimestampUtcDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime assessmentTimestampUtcDate; + + /* + * The resource count of the given subscription for which the Compliance + * calculation was conducted (needed for Management Group Compliance + * calculation). + */ + @JsonProperty(value = "resourceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer resourceCount; + + /* + * An array of segment, which is the actually the compliance assessment. + */ + @JsonProperty(value = "assessmentResult", access = JsonProperty.Access.WRITE_ONLY) + private List assessmentResult; + + /** + * Get the assessmentTimestampUtcDate property: The timestamp when the Compliance calculation was conducted. + * + * @return the assessmentTimestampUtcDate value. + */ + public OffsetDateTime assessmentTimestampUtcDate() { + return this.assessmentTimestampUtcDate; + } + + /** + * Get the resourceCount property: The resource count of the given subscription for which the Compliance calculation + * was conducted (needed for Management Group Compliance calculation). + * + * @return the resourceCount value. + */ + public Integer resourceCount() { + return this.resourceCount; + } + + /** + * Get the assessmentResult property: An array of segment, which is the actually the compliance assessment. + * + * @return the assessmentResult value. + */ + public List assessmentResult() { + return this.assessmentResult; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (assessmentResult() != null) { + assessmentResult().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultInner.java index e41e6c39a1a64..f6c186e13b3e1 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultInner.java @@ -4,8 +4,7 @@ package com.azure.resourcemanager.security.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.ResourceStatus; @@ -13,16 +12,24 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** a compliance result. */ -@JsonFlatten -@Immutable -public class ComplianceResultInner extends ProxyResource { +@Fluent +public final class ComplianceResultInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ComplianceResultInner.class); /* - * The status of the resource regarding a single assessment + * Compliance result data */ - @JsonProperty(value = "properties.resourceStatus", access = JsonProperty.Access.WRITE_ONLY) - private ResourceStatus resourceStatus; + @JsonProperty(value = "properties") + private ComplianceResultProperties innerProperties; + + /** + * Get the innerProperties property: Compliance result data. + * + * @return the innerProperties value. + */ + private ComplianceResultProperties innerProperties() { + return this.innerProperties; + } /** * Get the resourceStatus property: The status of the resource regarding a single assessment. @@ -30,7 +37,7 @@ public class ComplianceResultInner extends ProxyResource { * @return the resourceStatus value. */ public ResourceStatus resourceStatus() { - return this.resourceStatus; + return this.innerProperties() == null ? null : this.innerProperties().resourceStatus(); } /** @@ -39,5 +46,8 @@ public ResourceStatus resourceStatus() { * @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/IotSensorsListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultProperties.java similarity index 54% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSensorsListInner.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultProperties.java index 94c2c0fe00ed6..ac4b8cafc515f 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSensorsListInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultProperties.java @@ -6,28 +6,28 @@ import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.ResourceStatus; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -/** List of IoT sensors. */ +/** Compliance result data. */ @Immutable -public final class IotSensorsListInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotSensorsListInner.class); +public final class ComplianceResultProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ComplianceResultProperties.class); /* - * List data + * The status of the resource regarding a single assessment */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; + @JsonProperty(value = "resourceStatus", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus resourceStatus; /** - * Get the value property: List data. + * Get the resourceStatus property: The status of the resource regarding a single assessment. * - * @return the value value. + * @return the resourceStatus value. */ - public List value() { - return this.value; + public ResourceStatus resourceStatus() { + return this.resourceStatus; } /** @@ -36,8 +36,5 @@ public List value() { * @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/ConnectorSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingInner.java index 30a242a9b38da..27177eab3289c 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.AuthenticationDetailsProperties; @@ -14,24 +13,24 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** The connector setting. */ -@JsonFlatten @Fluent -public class ConnectorSettingInner extends ProxyResource { +public final class ConnectorSettingInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectorSettingInner.class); /* - * Settings for hybrid compute management. These settings are relevant only - * for Arc autoProvision (Hybrid Compute). + * Connector setting data */ - @JsonProperty(value = "properties.hybridComputeSettings") - private HybridComputeSettingsProperties hybridComputeSettings; + @JsonProperty(value = "properties") + private ConnectorSettingProperties innerProperties; - /* - * Settings for authentication management, these settings are relevant only - * for the cloud connector. + /** + * Get the innerProperties property: Connector setting data. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.authenticationDetails") - private AuthenticationDetailsProperties authenticationDetails; + private ConnectorSettingProperties innerProperties() { + return this.innerProperties; + } /** * Get the hybridComputeSettings property: Settings for hybrid compute management. These settings are relevant only @@ -40,7 +39,7 @@ public class ConnectorSettingInner extends ProxyResource { * @return the hybridComputeSettings value. */ public HybridComputeSettingsProperties hybridComputeSettings() { - return this.hybridComputeSettings; + return this.innerProperties() == null ? null : this.innerProperties().hybridComputeSettings(); } /** @@ -51,7 +50,10 @@ public HybridComputeSettingsProperties hybridComputeSettings() { * @return the ConnectorSettingInner object itself. */ public ConnectorSettingInner withHybridComputeSettings(HybridComputeSettingsProperties hybridComputeSettings) { - this.hybridComputeSettings = hybridComputeSettings; + if (this.innerProperties() == null) { + this.innerProperties = new ConnectorSettingProperties(); + } + this.innerProperties().withHybridComputeSettings(hybridComputeSettings); return this; } @@ -62,7 +64,7 @@ public ConnectorSettingInner withHybridComputeSettings(HybridComputeSettingsProp * @return the authenticationDetails value. */ public AuthenticationDetailsProperties authenticationDetails() { - return this.authenticationDetails; + return this.innerProperties() == null ? null : this.innerProperties().authenticationDetails(); } /** @@ -73,7 +75,10 @@ public AuthenticationDetailsProperties authenticationDetails() { * @return the ConnectorSettingInner object itself. */ public ConnectorSettingInner withAuthenticationDetails(AuthenticationDetailsProperties authenticationDetails) { - this.authenticationDetails = authenticationDetails; + if (this.innerProperties() == null) { + this.innerProperties = new ConnectorSettingProperties(); + } + this.innerProperties().withAuthenticationDetails(authenticationDetails); return this; } @@ -83,11 +88,8 @@ public ConnectorSettingInner withAuthenticationDetails(AuthenticationDetailsProp * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (hybridComputeSettings() != null) { - hybridComputeSettings().validate(); - } - if (authenticationDetails() != null) { - authenticationDetails().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingProperties.java new file mode 100644 index 0000000000000..3be913fc15f60 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingProperties.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.AuthenticationDetailsProperties; +import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes properties of a connector setting. */ +@Fluent +public final class ConnectorSettingProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectorSettingProperties.class); + + /* + * Settings for hybrid compute management. These settings are relevant only + * for Arc autoProvision (Hybrid Compute). + */ + @JsonProperty(value = "hybridComputeSettings") + private HybridComputeSettingsProperties hybridComputeSettings; + + /* + * Settings for authentication management, these settings are relevant only + * for the cloud connector. + */ + @JsonProperty(value = "authenticationDetails") + private AuthenticationDetailsProperties authenticationDetails; + + /** + * Get the hybridComputeSettings property: Settings for hybrid compute management. These settings are relevant only + * for Arc autoProvision (Hybrid Compute). + * + * @return the hybridComputeSettings value. + */ + public HybridComputeSettingsProperties hybridComputeSettings() { + return this.hybridComputeSettings; + } + + /** + * Set the hybridComputeSettings property: Settings for hybrid compute management. These settings are relevant only + * for Arc autoProvision (Hybrid Compute). + * + * @param hybridComputeSettings the hybridComputeSettings value to set. + * @return the ConnectorSettingProperties object itself. + */ + public ConnectorSettingProperties withHybridComputeSettings(HybridComputeSettingsProperties hybridComputeSettings) { + this.hybridComputeSettings = hybridComputeSettings; + return this; + } + + /** + * Get the authenticationDetails property: Settings for authentication management, these settings are relevant only + * for the cloud connector. + * + * @return the authenticationDetails value. + */ + public AuthenticationDetailsProperties authenticationDetails() { + return this.authenticationDetails; + } + + /** + * Set the authenticationDetails property: Settings for authentication management, these settings are relevant only + * for the cloud connector. + * + * @param authenticationDetails the authenticationDetails value to set. + * @return the ConnectorSettingProperties object itself. + */ + public ConnectorSettingProperties withAuthenticationDetails(AuthenticationDetailsProperties authenticationDetails) { + this.authenticationDetails = authenticationDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hybridComputeSettings() != null) { + hybridComputeSettings().validate(); + } + if (authenticationDetails() != null) { + authenticationDetails().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationInner.java new file mode 100644 index 0000000000000..d49e38c8fccdc --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationInner.java @@ -0,0 +1,229 @@ +// Copyright (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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.SeverityEnum; +import com.azure.resourcemanager.security.models.SupportedCloudEnum; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom Assessment Automation. */ +@Fluent +public final class CustomAssessmentAutomationInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomAssessmentAutomationInner.class); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * describes Custom Assessment Automation properties. + */ + @JsonProperty(value = "properties") + private CustomAssessmentAutomationProperties innerProperties; + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: describes Custom Assessment Automation properties. + * + * @return the innerProperties value. + */ + private CustomAssessmentAutomationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the compressedQuery property: GZip encoded KQL query representing the assessment automation results required. + * + * @return the compressedQuery value. + */ + public String compressedQuery() { + return this.innerProperties() == null ? null : this.innerProperties().compressedQuery(); + } + + /** + * Set the compressedQuery property: GZip encoded KQL query representing the assessment automation results required. + * + * @param compressedQuery the compressedQuery value to set. + * @return the CustomAssessmentAutomationInner object itself. + */ + public CustomAssessmentAutomationInner withCompressedQuery(String compressedQuery) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomAssessmentAutomationProperties(); + } + this.innerProperties().withCompressedQuery(compressedQuery); + return this; + } + + /** + * Get the supportedCloud property: Relevant cloud for the custom assessment automation. + * + * @return the supportedCloud value. + */ + public SupportedCloudEnum supportedCloud() { + return this.innerProperties() == null ? null : this.innerProperties().supportedCloud(); + } + + /** + * Set the supportedCloud property: Relevant cloud for the custom assessment automation. + * + * @param supportedCloud the supportedCloud value to set. + * @return the CustomAssessmentAutomationInner object itself. + */ + public CustomAssessmentAutomationInner withSupportedCloud(SupportedCloudEnum supportedCloud) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomAssessmentAutomationProperties(); + } + this.innerProperties().withSupportedCloud(supportedCloud); + return this; + } + + /** + * Get the severity property: The severity to relate to the assessments generated by this assessment automation. + * + * @return the severity value. + */ + public SeverityEnum severity() { + return this.innerProperties() == null ? null : this.innerProperties().severity(); + } + + /** + * Set the severity property: The severity to relate to the assessments generated by this assessment automation. + * + * @param severity the severity value to set. + * @return the CustomAssessmentAutomationInner object itself. + */ + public CustomAssessmentAutomationInner withSeverity(SeverityEnum severity) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomAssessmentAutomationProperties(); + } + this.innerProperties().withSeverity(severity); + return this; + } + + /** + * Get the displayName property: The display name of the assessments generated by this assessment automation. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name of the assessments generated by this assessment automation. + * + * @param displayName the displayName value to set. + * @return the CustomAssessmentAutomationInner object itself. + */ + public CustomAssessmentAutomationInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomAssessmentAutomationProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the description property: The description to relate to the assessments generated by this assessment + * automation. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description to relate to the assessments generated by this assessment + * automation. + * + * @param description the description value to set. + * @return the CustomAssessmentAutomationInner object itself. + */ + public CustomAssessmentAutomationInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomAssessmentAutomationProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the remediationDescription property: The remediation description to relate to the assessments generated by + * this assessment automation. + * + * @return the remediationDescription value. + */ + public String remediationDescription() { + return this.innerProperties() == null ? null : this.innerProperties().remediationDescription(); + } + + /** + * Set the remediationDescription property: The remediation description to relate to the assessments generated by + * this assessment automation. + * + * @param remediationDescription the remediationDescription value to set. + * @return the CustomAssessmentAutomationInner object itself. + */ + public CustomAssessmentAutomationInner withRemediationDescription(String remediationDescription) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomAssessmentAutomationProperties(); + } + this.innerProperties().withRemediationDescription(remediationDescription); + return this; + } + + /** + * Get the assessmentKey property: The assessment metadata key used when an assessment is generated for this + * assessment automation. + * + * @return the assessmentKey value. + */ + public String assessmentKey() { + return this.innerProperties() == null ? null : this.innerProperties().assessmentKey(); + } + + /** + * Set the assessmentKey property: The assessment metadata key used when an assessment is generated for this + * assessment automation. + * + * @param assessmentKey the assessmentKey value to set. + * @return the CustomAssessmentAutomationInner object itself. + */ + public CustomAssessmentAutomationInner withAssessmentKey(String assessmentKey) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomAssessmentAutomationProperties(); + } + this.innerProperties().withAssessmentKey(assessmentKey); + 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/CustomAssessmentAutomationProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationProperties.java new file mode 100644 index 0000000000000..316b92b91c5aa --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationProperties.java @@ -0,0 +1,220 @@ +// Copyright (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.SeverityEnum; +import com.azure.resourcemanager.security.models.SupportedCloudEnum; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** describes the Custom Assessment Automation properties. */ +@Fluent +public final class CustomAssessmentAutomationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomAssessmentAutomationProperties.class); + + /* + * GZip encoded KQL query representing the assessment automation results + * required. + */ + @JsonProperty(value = "compressedQuery") + private String compressedQuery; + + /* + * Relevant cloud for the custom assessment automation. + */ + @JsonProperty(value = "supportedCloud") + private SupportedCloudEnum supportedCloud = SupportedCloudEnum.AWS; + + /* + * The severity to relate to the assessments generated by this assessment + * automation. + */ + @JsonProperty(value = "severity") + private SeverityEnum severity = SeverityEnum.LOW; + + /* + * The display name of the assessments generated by this assessment + * automation. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The description to relate to the assessments generated by this + * assessment automation. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The remediation description to relate to the assessments generated by + * this assessment automation. + */ + @JsonProperty(value = "remediationDescription") + private String remediationDescription; + + /* + * The assessment metadata key used when an assessment is generated for + * this assessment automation. + */ + @JsonProperty(value = "assessmentKey") + private String assessmentKey; + + /** + * Get the compressedQuery property: GZip encoded KQL query representing the assessment automation results required. + * + * @return the compressedQuery value. + */ + public String compressedQuery() { + return this.compressedQuery; + } + + /** + * Set the compressedQuery property: GZip encoded KQL query representing the assessment automation results required. + * + * @param compressedQuery the compressedQuery value to set. + * @return the CustomAssessmentAutomationProperties object itself. + */ + public CustomAssessmentAutomationProperties withCompressedQuery(String compressedQuery) { + this.compressedQuery = compressedQuery; + return this; + } + + /** + * Get the supportedCloud property: Relevant cloud for the custom assessment automation. + * + * @return the supportedCloud value. + */ + public SupportedCloudEnum supportedCloud() { + return this.supportedCloud; + } + + /** + * Set the supportedCloud property: Relevant cloud for the custom assessment automation. + * + * @param supportedCloud the supportedCloud value to set. + * @return the CustomAssessmentAutomationProperties object itself. + */ + public CustomAssessmentAutomationProperties withSupportedCloud(SupportedCloudEnum supportedCloud) { + this.supportedCloud = supportedCloud; + return this; + } + + /** + * Get the severity property: The severity to relate to the assessments generated by this assessment automation. + * + * @return the severity value. + */ + public SeverityEnum severity() { + return this.severity; + } + + /** + * Set the severity property: The severity to relate to the assessments generated by this assessment automation. + * + * @param severity the severity value to set. + * @return the CustomAssessmentAutomationProperties object itself. + */ + public CustomAssessmentAutomationProperties withSeverity(SeverityEnum severity) { + this.severity = severity; + return this; + } + + /** + * Get the displayName property: The display name of the assessments generated by this assessment automation. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the assessments generated by this assessment automation. + * + * @param displayName the displayName value to set. + * @return the CustomAssessmentAutomationProperties object itself. + */ + public CustomAssessmentAutomationProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: The description to relate to the assessments generated by this assessment + * automation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description to relate to the assessments generated by this assessment + * automation. + * + * @param description the description value to set. + * @return the CustomAssessmentAutomationProperties object itself. + */ + public CustomAssessmentAutomationProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the remediationDescription property: The remediation description to relate to the assessments generated by + * this assessment automation. + * + * @return the remediationDescription value. + */ + public String remediationDescription() { + return this.remediationDescription; + } + + /** + * Set the remediationDescription property: The remediation description to relate to the assessments generated by + * this assessment automation. + * + * @param remediationDescription the remediationDescription value to set. + * @return the CustomAssessmentAutomationProperties object itself. + */ + public CustomAssessmentAutomationProperties withRemediationDescription(String remediationDescription) { + this.remediationDescription = remediationDescription; + return this; + } + + /** + * Get the assessmentKey property: The assessment metadata key used when an assessment is generated for this + * assessment automation. + * + * @return the assessmentKey value. + */ + public String assessmentKey() { + return this.assessmentKey; + } + + /** + * Set the assessmentKey property: The assessment metadata key used when an assessment is generated for this + * assessment automation. + * + * @param assessmentKey the assessmentKey value to set. + * @return the CustomAssessmentAutomationProperties object itself. + */ + public CustomAssessmentAutomationProperties withAssessmentKey(String assessmentKey) { + this.assessmentKey = assessmentKey; + 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/CustomAssessmentAutomationRequestProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationRequestProperties.java new file mode 100644 index 0000000000000..a688695325396 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationRequestProperties.java @@ -0,0 +1,193 @@ +// Copyright (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.SeverityEnum; +import com.azure.resourcemanager.security.models.SupportedCloudEnum; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** describes the Custom Assessment Automation properties. */ +@Fluent +public final class CustomAssessmentAutomationRequestProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomAssessmentAutomationRequestProperties.class); + + /* + * Base 64 encoded KQL query representing the assessment automation results + * required. + */ + @JsonProperty(value = "compressedQuery") + private String compressedQuery; + + /* + * Relevant cloud for the custom assessment automation. + */ + @JsonProperty(value = "supportedCloud") + private SupportedCloudEnum supportedCloud = SupportedCloudEnum.AWS; + + /* + * The severity to relate to the assessments generated by this assessment + * automation. + */ + @JsonProperty(value = "severity") + private SeverityEnum severity = SeverityEnum.LOW; + + /* + * The display name of the assessments generated by this assessment + * automation. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The description to relate to the assessments generated by this + * assessment automation. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The remediation description to relate to the assessments generated by + * this assessment automation. + */ + @JsonProperty(value = "remediationDescription") + private String remediationDescription; + + /** + * Get the compressedQuery property: Base 64 encoded KQL query representing the assessment automation results + * required. + * + * @return the compressedQuery value. + */ + public String compressedQuery() { + return this.compressedQuery; + } + + /** + * Set the compressedQuery property: Base 64 encoded KQL query representing the assessment automation results + * required. + * + * @param compressedQuery the compressedQuery value to set. + * @return the CustomAssessmentAutomationRequestProperties object itself. + */ + public CustomAssessmentAutomationRequestProperties withCompressedQuery(String compressedQuery) { + this.compressedQuery = compressedQuery; + return this; + } + + /** + * Get the supportedCloud property: Relevant cloud for the custom assessment automation. + * + * @return the supportedCloud value. + */ + public SupportedCloudEnum supportedCloud() { + return this.supportedCloud; + } + + /** + * Set the supportedCloud property: Relevant cloud for the custom assessment automation. + * + * @param supportedCloud the supportedCloud value to set. + * @return the CustomAssessmentAutomationRequestProperties object itself. + */ + public CustomAssessmentAutomationRequestProperties withSupportedCloud(SupportedCloudEnum supportedCloud) { + this.supportedCloud = supportedCloud; + return this; + } + + /** + * Get the severity property: The severity to relate to the assessments generated by this assessment automation. + * + * @return the severity value. + */ + public SeverityEnum severity() { + return this.severity; + } + + /** + * Set the severity property: The severity to relate to the assessments generated by this assessment automation. + * + * @param severity the severity value to set. + * @return the CustomAssessmentAutomationRequestProperties object itself. + */ + public CustomAssessmentAutomationRequestProperties withSeverity(SeverityEnum severity) { + this.severity = severity; + return this; + } + + /** + * Get the displayName property: The display name of the assessments generated by this assessment automation. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the assessments generated by this assessment automation. + * + * @param displayName the displayName value to set. + * @return the CustomAssessmentAutomationRequestProperties object itself. + */ + public CustomAssessmentAutomationRequestProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: The description to relate to the assessments generated by this assessment + * automation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description to relate to the assessments generated by this assessment + * automation. + * + * @param description the description value to set. + * @return the CustomAssessmentAutomationRequestProperties object itself. + */ + public CustomAssessmentAutomationRequestProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the remediationDescription property: The remediation description to relate to the assessments generated by + * this assessment automation. + * + * @return the remediationDescription value. + */ + public String remediationDescription() { + return this.remediationDescription; + } + + /** + * Set the remediationDescription property: The remediation description to relate to the assessments generated by + * this assessment automation. + * + * @param remediationDescription the remediationDescription value to set. + * @return the CustomAssessmentAutomationRequestProperties object itself. + */ + public CustomAssessmentAutomationRequestProperties withRemediationDescription(String remediationDescription) { + this.remediationDescription = remediationDescription; + 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/CustomEntityStoreAssignmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentInner.java new file mode 100644 index 0000000000000..1d945b678f5ea --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentInner.java @@ -0,0 +1,108 @@ +// Copyright (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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom entity store assignment. */ +@Fluent +public final class CustomEntityStoreAssignmentInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomEntityStoreAssignmentInner.class); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * describes custom entity store assignment properties. + */ + @JsonProperty(value = "properties") + private CustomEntityStoreAssignmentProperties innerProperties; + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: describes custom entity store assignment properties. + * + * @return the innerProperties value. + */ + private CustomEntityStoreAssignmentProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the principal property: The principal assigned with entity store. Format of principal is: [AAD + * type]=[PrincipalObjectId];[TenantId]. + * + * @return the principal value. + */ + public String principal() { + return this.innerProperties() == null ? null : this.innerProperties().principal(); + } + + /** + * Set the principal property: The principal assigned with entity store. Format of principal is: [AAD + * type]=[PrincipalObjectId];[TenantId]. + * + * @param principal the principal value to set. + * @return the CustomEntityStoreAssignmentInner object itself. + */ + public CustomEntityStoreAssignmentInner withPrincipal(String principal) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomEntityStoreAssignmentProperties(); + } + this.innerProperties().withPrincipal(principal); + return this; + } + + /** + * Get the entityStoreDatabaseLink property: The link to entity store database. + * + * @return the entityStoreDatabaseLink value. + */ + public String entityStoreDatabaseLink() { + return this.innerProperties() == null ? null : this.innerProperties().entityStoreDatabaseLink(); + } + + /** + * Set the entityStoreDatabaseLink property: The link to entity store database. + * + * @param entityStoreDatabaseLink the entityStoreDatabaseLink value to set. + * @return the CustomEntityStoreAssignmentInner object itself. + */ + public CustomEntityStoreAssignmentInner withEntityStoreDatabaseLink(String entityStoreDatabaseLink) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomEntityStoreAssignmentProperties(); + } + this.innerProperties().withEntityStoreDatabaseLink(entityStoreDatabaseLink); + 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/CustomEntityStoreAssignmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentProperties.java new file mode 100644 index 0000000000000..efa34bb4e06cc --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** describes the custom entity store assignment properties. */ +@Fluent +public final class CustomEntityStoreAssignmentProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomEntityStoreAssignmentProperties.class); + + /* + * The principal assigned with entity store. Format of principal is: [AAD + * type]=[PrincipalObjectId];[TenantId] + */ + @JsonProperty(value = "principal") + private String principal; + + /* + * The link to entity store database. + */ + @JsonProperty(value = "entityStoreDatabaseLink") + private String entityStoreDatabaseLink; + + /** + * Get the principal property: The principal assigned with entity store. Format of principal is: [AAD + * type]=[PrincipalObjectId];[TenantId]. + * + * @return the principal value. + */ + public String principal() { + return this.principal; + } + + /** + * Set the principal property: The principal assigned with entity store. Format of principal is: [AAD + * type]=[PrincipalObjectId];[TenantId]. + * + * @param principal the principal value to set. + * @return the CustomEntityStoreAssignmentProperties object itself. + */ + public CustomEntityStoreAssignmentProperties withPrincipal(String principal) { + this.principal = principal; + return this; + } + + /** + * Get the entityStoreDatabaseLink property: The link to entity store database. + * + * @return the entityStoreDatabaseLink value. + */ + public String entityStoreDatabaseLink() { + return this.entityStoreDatabaseLink; + } + + /** + * Set the entityStoreDatabaseLink property: The link to entity store database. + * + * @param entityStoreDatabaseLink the entityStoreDatabaseLink value to set. + * @return the CustomEntityStoreAssignmentProperties object itself. + */ + public CustomEntityStoreAssignmentProperties withEntityStoreDatabaseLink(String entityStoreDatabaseLink) { + this.entityStoreDatabaseLink = entityStoreDatabaseLink; + 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/CustomEntityStoreAssignmentRequestProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentRequestProperties.java new file mode 100644 index 0000000000000..599fa9062cd90 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentRequestProperties.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.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** describes properties of custom entity store assignment request. */ +@Fluent +public final class CustomEntityStoreAssignmentRequestProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(CustomEntityStoreAssignmentRequestProperties.class); + + /* + * The principal assigned with entity store. If not provided, will use + * caller principal. Format of principal is: [AAD + * type]=[PrincipalObjectId];[TenantId] + */ + @JsonProperty(value = "principal") + private String principal; + + /** + * Get the principal property: The principal assigned with entity store. If not provided, will use caller principal. + * Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. + * + * @return the principal value. + */ + public String principal() { + return this.principal; + } + + /** + * Set the principal property: The principal assigned with entity store. If not provided, will use caller principal. + * Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. + * + * @param principal the principal value to set. + * @return the CustomEntityStoreAssignmentRequestProperties object itself. + */ + public CustomEntityStoreAssignmentRequestProperties withPrincipal(String principal) { + this.principal = principal; + 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/DataExportSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DataExportSettingProperties.java new file mode 100644 index 0000000000000..fe701de762a96 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DataExportSettingProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The data export setting properties. */ +@Fluent +public final class DataExportSettingProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataExportSettingProperties.class); + + /* + * Is the data export setting enabled + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /** + * Get the enabled property: Is the data export setting enabled. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Is the data export setting enabled. + * + * @param enabled the enabled value to set. + * @return the DataExportSettingProperties object itself. + */ + public DataExportSettingProperties withEnabled(boolean enabled) { + this.enabled = enabled; + 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/DeviceInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceInner.java deleted file mode 100644 index 7c2676265df72..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceInner.java +++ /dev/null @@ -1,493 +0,0 @@ -// Copyright (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.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.AuthorizationState; -import com.azure.resourcemanager.security.models.DeviceCriticality; -import com.azure.resourcemanager.security.models.DeviceStatus; -import com.azure.resourcemanager.security.models.Firmware; -import com.azure.resourcemanager.security.models.ManagementState; -import com.azure.resourcemanager.security.models.NetworkInterface; -import com.azure.resourcemanager.security.models.ProgrammingState; -import com.azure.resourcemanager.security.models.Protocol; -import com.azure.resourcemanager.security.models.PurdueLevel; -import com.azure.resourcemanager.security.models.ScanningFunctionality; -import com.azure.resourcemanager.security.models.Sensor; -import com.azure.resourcemanager.security.models.Site; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Device model. */ -@JsonFlatten -@Fluent -public class DeviceInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeviceInner.class); - - /* - * Device display name given by the collector - */ - @JsonProperty(value = "properties.displayName") - private String displayName; - - /* - * Device type. - */ - @JsonProperty(value = "properties.deviceType") - private String deviceType; - - /* - * The source that created the device - */ - @JsonProperty(value = "properties.sourceName", access = JsonProperty.Access.WRITE_ONLY) - private String sourceName; - - /* - * List of network interfaces. - */ - @JsonProperty(value = "properties.networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) - private List networkInterfaces; - - /* - * Device vendor - */ - @JsonProperty(value = "properties.vendor", access = JsonProperty.Access.WRITE_ONLY) - private String vendor; - - /* - * Device operating system name. - */ - @JsonProperty(value = "properties.osName") - private String osName; - - /* - * List of protocols. - */ - @JsonProperty(value = "properties.protocols", access = JsonProperty.Access.WRITE_ONLY) - private List protocols; - - /* - * last time the device was active in the network - */ - @JsonProperty(value = "properties.lastActiveTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastActiveTime; - - /* - * last time the device was updated - */ - @JsonProperty(value = "properties.lastUpdateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastUpdateTime; - - /* - * Managed state of the device. - */ - @JsonProperty(value = "properties.managementState", access = JsonProperty.Access.WRITE_ONLY) - private ManagementState managementState; - - /* - * Authorized state of the device. - */ - @JsonProperty(value = "properties.authorizationState") - private AuthorizationState authorizationState; - - /* - * Device criticality. - */ - @JsonProperty(value = "properties.deviceCriticality") - private DeviceCriticality deviceCriticality; - - /* - * Purdue level of the device. - */ - @JsonProperty(value = "properties.purdueLevel") - private PurdueLevel purdueLevel; - - /* - * user notes for the device, up to 300 characters. - */ - @JsonProperty(value = "properties.notes") - private String notes; - - /* - * List of device firmwares. - */ - @JsonProperty(value = "properties.firmwares", access = JsonProperty.Access.WRITE_ONLY) - private List firmwares; - - /* - * Discovered time of the device. - */ - @JsonProperty(value = "properties.discoveryTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime discoveryTime; - - /* - * Indicates whether this device is programming - */ - @JsonProperty(value = "properties.programmingState", access = JsonProperty.Access.WRITE_ONLY) - private ProgrammingState programmingState; - - /* - * last time the device was programming or programed. - */ - @JsonProperty(value = "properties.lastProgrammingTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastProgrammingTime; - - /* - * Indicates whether the device is a scanner - */ - @JsonProperty(value = "properties.scanningFunctionality", access = JsonProperty.Access.WRITE_ONLY) - private ScanningFunctionality scanningFunctionality; - - /* - * last time the device was scanning. - */ - @JsonProperty(value = "properties.lastScanTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastScanTime; - - /* - * risk score of the device. - */ - @JsonProperty(value = "properties.riskScore", access = JsonProperty.Access.WRITE_ONLY) - private Integer riskScore; - - /* - * List of sensors that scanned this device. - */ - @JsonProperty(value = "properties.sensors", access = JsonProperty.Access.WRITE_ONLY) - private List sensors; - - /* - * Site data - */ - @JsonProperty(value = "properties.site", access = JsonProperty.Access.WRITE_ONLY) - private Site site; - - /* - * Device status. - */ - @JsonProperty(value = "properties.deviceStatus", access = JsonProperty.Access.WRITE_ONLY) - private DeviceStatus deviceStatus; - - /** - * Get the displayName property: Device display name given by the collector. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Device display name given by the collector. - * - * @param displayName the displayName value to set. - * @return the DeviceInner object itself. - */ - public DeviceInner withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the deviceType property: Device type. - * - * @return the deviceType value. - */ - public String deviceType() { - return this.deviceType; - } - - /** - * Set the deviceType property: Device type. - * - * @param deviceType the deviceType value to set. - * @return the DeviceInner object itself. - */ - public DeviceInner withDeviceType(String deviceType) { - this.deviceType = deviceType; - return this; - } - - /** - * Get the sourceName property: The source that created the device. - * - * @return the sourceName value. - */ - public String sourceName() { - return this.sourceName; - } - - /** - * Get the networkInterfaces property: List of network interfaces. - * - * @return the networkInterfaces value. - */ - public List networkInterfaces() { - return this.networkInterfaces; - } - - /** - * Get the vendor property: Device vendor. - * - * @return the vendor value. - */ - public String vendor() { - return this.vendor; - } - - /** - * Get the osName property: Device operating system name. - * - * @return the osName value. - */ - public String osName() { - return this.osName; - } - - /** - * Set the osName property: Device operating system name. - * - * @param osName the osName value to set. - * @return the DeviceInner object itself. - */ - public DeviceInner withOsName(String osName) { - this.osName = osName; - return this; - } - - /** - * Get the protocols property: List of protocols. - * - * @return the protocols value. - */ - public List protocols() { - return this.protocols; - } - - /** - * Get the lastActiveTime property: last time the device was active in the network. - * - * @return the lastActiveTime value. - */ - public OffsetDateTime lastActiveTime() { - return this.lastActiveTime; - } - - /** - * Get the lastUpdateTime property: last time the device was updated. - * - * @return the lastUpdateTime value. - */ - public OffsetDateTime lastUpdateTime() { - return this.lastUpdateTime; - } - - /** - * Get the managementState property: Managed state of the device. - * - * @return the managementState value. - */ - public ManagementState managementState() { - return this.managementState; - } - - /** - * Get the authorizationState property: Authorized state of the device. - * - * @return the authorizationState value. - */ - public AuthorizationState authorizationState() { - return this.authorizationState; - } - - /** - * Set the authorizationState property: Authorized state of the device. - * - * @param authorizationState the authorizationState value to set. - * @return the DeviceInner object itself. - */ - public DeviceInner withAuthorizationState(AuthorizationState authorizationState) { - this.authorizationState = authorizationState; - return this; - } - - /** - * Get the deviceCriticality property: Device criticality. - * - * @return the deviceCriticality value. - */ - public DeviceCriticality deviceCriticality() { - return this.deviceCriticality; - } - - /** - * Set the deviceCriticality property: Device criticality. - * - * @param deviceCriticality the deviceCriticality value to set. - * @return the DeviceInner object itself. - */ - public DeviceInner withDeviceCriticality(DeviceCriticality deviceCriticality) { - this.deviceCriticality = deviceCriticality; - return this; - } - - /** - * Get the purdueLevel property: Purdue level of the device. - * - * @return the purdueLevel value. - */ - public PurdueLevel purdueLevel() { - return this.purdueLevel; - } - - /** - * Set the purdueLevel property: Purdue level of the device. - * - * @param purdueLevel the purdueLevel value to set. - * @return the DeviceInner object itself. - */ - public DeviceInner withPurdueLevel(PurdueLevel purdueLevel) { - this.purdueLevel = purdueLevel; - return this; - } - - /** - * Get the notes property: user notes for the device, up to 300 characters. - * - * @return the notes value. - */ - public String notes() { - return this.notes; - } - - /** - * Set the notes property: user notes for the device, up to 300 characters. - * - * @param notes the notes value to set. - * @return the DeviceInner object itself. - */ - public DeviceInner withNotes(String notes) { - this.notes = notes; - return this; - } - - /** - * Get the firmwares property: List of device firmwares. - * - * @return the firmwares value. - */ - public List firmwares() { - return this.firmwares; - } - - /** - * Get the discoveryTime property: Discovered time of the device. - * - * @return the discoveryTime value. - */ - public OffsetDateTime discoveryTime() { - return this.discoveryTime; - } - - /** - * Get the programmingState property: Indicates whether this device is programming. - * - * @return the programmingState value. - */ - public ProgrammingState programmingState() { - return this.programmingState; - } - - /** - * Get the lastProgrammingTime property: last time the device was programming or programed. - * - * @return the lastProgrammingTime value. - */ - public OffsetDateTime lastProgrammingTime() { - return this.lastProgrammingTime; - } - - /** - * Get the scanningFunctionality property: Indicates whether the device is a scanner. - * - * @return the scanningFunctionality value. - */ - public ScanningFunctionality scanningFunctionality() { - return this.scanningFunctionality; - } - - /** - * Get the lastScanTime property: last time the device was scanning. - * - * @return the lastScanTime value. - */ - public OffsetDateTime lastScanTime() { - return this.lastScanTime; - } - - /** - * Get the riskScore property: risk score of the device. - * - * @return the riskScore value. - */ - public Integer riskScore() { - return this.riskScore; - } - - /** - * Get the sensors property: List of sensors that scanned this device. - * - * @return the sensors value. - */ - public List sensors() { - return this.sensors; - } - - /** - * Get the site property: Site data. - * - * @return the site value. - */ - public Site site() { - return this.site; - } - - /** - * Get the deviceStatus property: Device status. - * - * @return the deviceStatus value. - */ - public DeviceStatus deviceStatus() { - return this.deviceStatus; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkInterfaces() != null) { - networkInterfaces().forEach(e -> e.validate()); - } - if (protocols() != null) { - protocols().forEach(e -> e.validate()); - } - if (firmwares() != null) { - firmwares().forEach(e -> e.validate()); - } - if (sensors() != null) { - sensors().forEach(e -> e.validate()); - } - if (site() != null) { - site().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupInner.java index 8e79718371e8b..ee7b81ed92113 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.AllowlistCustomAlertRule; @@ -17,34 +16,24 @@ import java.util.List; /** The device security group resource. */ -@JsonFlatten @Fluent -public class DeviceSecurityGroupInner extends ProxyResource { +public final class DeviceSecurityGroupInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(DeviceSecurityGroupInner.class); /* - * The list of custom alert threshold rules. + * Device Security group data */ - @JsonProperty(value = "properties.thresholdRules") - private List thresholdRules; + @JsonProperty(value = "properties") + private DeviceSecurityGroupProperties innerProperties; - /* - * The list of custom alert time-window rules. - */ - @JsonProperty(value = "properties.timeWindowRules") - private List timeWindowRules; - - /* - * The allow-list custom alert rules. - */ - @JsonProperty(value = "properties.allowlistRules") - private List allowlistRules; - - /* - * The deny-list custom alert rules. + /** + * Get the innerProperties property: Device Security group data. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.denylistRules") - private List denylistRules; + private DeviceSecurityGroupProperties innerProperties() { + return this.innerProperties; + } /** * Get the thresholdRules property: The list of custom alert threshold rules. @@ -52,7 +41,7 @@ public class DeviceSecurityGroupInner extends ProxyResource { * @return the thresholdRules value. */ public List thresholdRules() { - return this.thresholdRules; + return this.innerProperties() == null ? null : this.innerProperties().thresholdRules(); } /** @@ -62,7 +51,10 @@ public List thresholdRules() { * @return the DeviceSecurityGroupInner object itself. */ public DeviceSecurityGroupInner withThresholdRules(List thresholdRules) { - this.thresholdRules = thresholdRules; + if (this.innerProperties() == null) { + this.innerProperties = new DeviceSecurityGroupProperties(); + } + this.innerProperties().withThresholdRules(thresholdRules); return this; } @@ -72,7 +64,7 @@ public DeviceSecurityGroupInner withThresholdRules(List timeWindowRules() { - return this.timeWindowRules; + return this.innerProperties() == null ? null : this.innerProperties().timeWindowRules(); } /** @@ -82,7 +74,10 @@ public List timeWindowRules() { * @return the DeviceSecurityGroupInner object itself. */ public DeviceSecurityGroupInner withTimeWindowRules(List timeWindowRules) { - this.timeWindowRules = timeWindowRules; + if (this.innerProperties() == null) { + this.innerProperties = new DeviceSecurityGroupProperties(); + } + this.innerProperties().withTimeWindowRules(timeWindowRules); return this; } @@ -92,7 +87,7 @@ public DeviceSecurityGroupInner withTimeWindowRules(List allowlistRules() { - return this.allowlistRules; + return this.innerProperties() == null ? null : this.innerProperties().allowlistRules(); } /** @@ -102,7 +97,10 @@ public List allowlistRules() { * @return the DeviceSecurityGroupInner object itself. */ public DeviceSecurityGroupInner withAllowlistRules(List allowlistRules) { - this.allowlistRules = allowlistRules; + if (this.innerProperties() == null) { + this.innerProperties = new DeviceSecurityGroupProperties(); + } + this.innerProperties().withAllowlistRules(allowlistRules); return this; } @@ -112,7 +110,7 @@ public DeviceSecurityGroupInner withAllowlistRules(List denylistRules() { - return this.denylistRules; + return this.innerProperties() == null ? null : this.innerProperties().denylistRules(); } /** @@ -122,7 +120,10 @@ public List denylistRules() { * @return the DeviceSecurityGroupInner object itself. */ public DeviceSecurityGroupInner withDenylistRules(List denylistRules) { - this.denylistRules = denylistRules; + if (this.innerProperties() == null) { + this.innerProperties = new DeviceSecurityGroupProperties(); + } + this.innerProperties().withDenylistRules(denylistRules); return this; } @@ -132,17 +133,8 @@ public DeviceSecurityGroupInner withDenylistRules(List * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (thresholdRules() != null) { - thresholdRules().forEach(e -> e.validate()); - } - if (timeWindowRules() != null) { - timeWindowRules().forEach(e -> e.validate()); - } - if (allowlistRules() != null) { - allowlistRules().forEach(e -> e.validate()); - } - if (denylistRules() != null) { - denylistRules().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupProperties.java new file mode 100644 index 0000000000000..faad7bb509f33 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupProperties.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +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 com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** describes properties of a security group. */ +@Fluent +public final class DeviceSecurityGroupProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeviceSecurityGroupProperties.class); + + /* + * The list of custom alert threshold rules. + */ + @JsonProperty(value = "thresholdRules") + private List thresholdRules; + + /* + * The list of custom alert time-window rules. + */ + @JsonProperty(value = "timeWindowRules") + private List timeWindowRules; + + /* + * The allow-list custom alert rules. + */ + @JsonProperty(value = "allowlistRules") + private List allowlistRules; + + /* + * The deny-list custom alert rules. + */ + @JsonProperty(value = "denylistRules") + private List denylistRules; + + /** + * Get the thresholdRules property: The list of custom alert threshold rules. + * + * @return the thresholdRules value. + */ + public List thresholdRules() { + return this.thresholdRules; + } + + /** + * Set the thresholdRules property: The list of custom alert threshold rules. + * + * @param thresholdRules the thresholdRules value to set. + * @return the DeviceSecurityGroupProperties object itself. + */ + public DeviceSecurityGroupProperties withThresholdRules(List thresholdRules) { + this.thresholdRules = thresholdRules; + return this; + } + + /** + * Get the timeWindowRules property: The list of custom alert time-window rules. + * + * @return the timeWindowRules value. + */ + public List timeWindowRules() { + return this.timeWindowRules; + } + + /** + * Set the timeWindowRules property: The list of custom alert time-window rules. + * + * @param timeWindowRules the timeWindowRules value to set. + * @return the DeviceSecurityGroupProperties object itself. + */ + public DeviceSecurityGroupProperties withTimeWindowRules(List timeWindowRules) { + this.timeWindowRules = timeWindowRules; + return this; + } + + /** + * Get the allowlistRules property: The allow-list custom alert rules. + * + * @return the allowlistRules value. + */ + public List allowlistRules() { + return this.allowlistRules; + } + + /** + * Set the allowlistRules property: The allow-list custom alert rules. + * + * @param allowlistRules the allowlistRules value to set. + * @return the DeviceSecurityGroupProperties object itself. + */ + public DeviceSecurityGroupProperties withAllowlistRules(List allowlistRules) { + this.allowlistRules = allowlistRules; + return this; + } + + /** + * Get the denylistRules property: The deny-list custom alert rules. + * + * @return the denylistRules value. + */ + public List denylistRules() { + return this.denylistRules; + } + + /** + * Set the denylistRules property: The deny-list custom alert rules. + * + * @param denylistRules the denylistRules value to set. + * @return the DeviceSecurityGroupProperties object itself. + */ + public DeviceSecurityGroupProperties withDenylistRules(List denylistRules) { + this.denylistRules = denylistRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (thresholdRules() != null) { + thresholdRules().forEach(e -> e.validate()); + } + if (timeWindowRules() != null) { + timeWindowRules().forEach(e -> e.validate()); + } + if (allowlistRules() != null) { + allowlistRules().forEach(e -> e.validate()); + } + if (denylistRules() != null) { + denylistRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionInner.java index e176ea96fe7a4..a149034d522c5 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.SecurityFamily; @@ -13,40 +12,39 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** The DiscoveredSecuritySolution model. */ -@JsonFlatten @Fluent -public class DiscoveredSecuritySolutionInner extends ProxyResource { +public final class DiscoveredSecuritySolutionInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(DiscoveredSecuritySolutionInner.class); /* - * The security family of the discovered solution + * The properties property. */ - @JsonProperty(value = "properties.securityFamily", required = true) - private SecurityFamily securityFamily; + @JsonProperty(value = "properties", required = true) + private DiscoveredSecuritySolutionProperties innerProperties = new DiscoveredSecuritySolutionProperties(); /* - * The security solutions' image offer - */ - @JsonProperty(value = "properties.offer", required = true) - private String offer; - - /* - * The security solutions' image publisher + * Location where the resource is stored */ - @JsonProperty(value = "properties.publisher", required = true) - private String publisher; + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; - /* - * The security solutions' image sku + /** + * Get the innerProperties property: The properties property. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.sku", required = true) - private String sku; + private DiscoveredSecuritySolutionProperties innerProperties() { + return this.innerProperties; + } - /* - * Location where the resource is stored + /** + * Get the location property: Location where the resource is stored. + * + * @return the location value. */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; + public String location() { + return this.location; + } /** * Get the securityFamily property: The security family of the discovered solution. @@ -54,7 +52,7 @@ public class DiscoveredSecuritySolutionInner extends ProxyResource { * @return the securityFamily value. */ public SecurityFamily securityFamily() { - return this.securityFamily; + return this.innerProperties() == null ? null : this.innerProperties().securityFamily(); } /** @@ -64,7 +62,10 @@ public SecurityFamily securityFamily() { * @return the DiscoveredSecuritySolutionInner object itself. */ public DiscoveredSecuritySolutionInner withSecurityFamily(SecurityFamily securityFamily) { - this.securityFamily = securityFamily; + if (this.innerProperties() == null) { + this.innerProperties = new DiscoveredSecuritySolutionProperties(); + } + this.innerProperties().withSecurityFamily(securityFamily); return this; } @@ -74,7 +75,7 @@ public DiscoveredSecuritySolutionInner withSecurityFamily(SecurityFamily securit * @return the offer value. */ public String offer() { - return this.offer; + return this.innerProperties() == null ? null : this.innerProperties().offer(); } /** @@ -84,7 +85,10 @@ public String offer() { * @return the DiscoveredSecuritySolutionInner object itself. */ public DiscoveredSecuritySolutionInner withOffer(String offer) { - this.offer = offer; + if (this.innerProperties() == null) { + this.innerProperties = new DiscoveredSecuritySolutionProperties(); + } + this.innerProperties().withOffer(offer); return this; } @@ -94,7 +98,7 @@ public DiscoveredSecuritySolutionInner withOffer(String offer) { * @return the publisher value. */ public String publisher() { - return this.publisher; + return this.innerProperties() == null ? null : this.innerProperties().publisher(); } /** @@ -104,7 +108,10 @@ public String publisher() { * @return the DiscoveredSecuritySolutionInner object itself. */ public DiscoveredSecuritySolutionInner withPublisher(String publisher) { - this.publisher = publisher; + if (this.innerProperties() == null) { + this.innerProperties = new DiscoveredSecuritySolutionProperties(); + } + this.innerProperties().withPublisher(publisher); return this; } @@ -114,7 +121,7 @@ public DiscoveredSecuritySolutionInner withPublisher(String publisher) { * @return the sku value. */ public String sku() { - return this.sku; + return this.innerProperties() == null ? null : this.innerProperties().sku(); } /** @@ -124,48 +131,26 @@ public String sku() { * @return the DiscoveredSecuritySolutionInner object itself. */ public DiscoveredSecuritySolutionInner withSku(String sku) { - this.sku = sku; + if (this.innerProperties() == null) { + this.innerProperties = new DiscoveredSecuritySolutionProperties(); + } + this.innerProperties().withSku(sku); return this; } - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (securityFamily() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property securityFamily in model DiscoveredSecuritySolutionInner")); - } - if (offer() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property offer in model DiscoveredSecuritySolutionInner")); - } - if (publisher() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property publisher in model DiscoveredSecuritySolutionInner")); - } - if (sku() == null) { + if (innerProperties() == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - "Missing required property sku in model DiscoveredSecuritySolutionInner")); + "Missing required property innerProperties in model DiscoveredSecuritySolutionInner")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionProperties.java new file mode 100644 index 0000000000000..01b5dc5ae2b44 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionProperties.java @@ -0,0 +1,153 @@ +// Copyright (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.SecurityFamily; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The DiscoveredSecuritySolutionProperties model. */ +@Fluent +public final class DiscoveredSecuritySolutionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiscoveredSecuritySolutionProperties.class); + + /* + * The security family of the discovered solution + */ + @JsonProperty(value = "securityFamily", required = true) + private SecurityFamily securityFamily; + + /* + * The security solutions' image offer + */ + @JsonProperty(value = "offer", required = true) + private String offer; + + /* + * The security solutions' image publisher + */ + @JsonProperty(value = "publisher", required = true) + private String publisher; + + /* + * The security solutions' image sku + */ + @JsonProperty(value = "sku", required = true) + private String sku; + + /** + * Get the securityFamily property: The security family of the discovered solution. + * + * @return the securityFamily value. + */ + public SecurityFamily securityFamily() { + return this.securityFamily; + } + + /** + * Set the securityFamily property: The security family of the discovered solution. + * + * @param securityFamily the securityFamily value to set. + * @return the DiscoveredSecuritySolutionProperties object itself. + */ + public DiscoveredSecuritySolutionProperties withSecurityFamily(SecurityFamily securityFamily) { + this.securityFamily = securityFamily; + return this; + } + + /** + * Get the offer property: The security solutions' image offer. + * + * @return the offer value. + */ + public String offer() { + return this.offer; + } + + /** + * Set the offer property: The security solutions' image offer. + * + * @param offer the offer value to set. + * @return the DiscoveredSecuritySolutionProperties object itself. + */ + public DiscoveredSecuritySolutionProperties withOffer(String offer) { + this.offer = offer; + return this; + } + + /** + * Get the publisher property: The security solutions' image publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The security solutions' image publisher. + * + * @param publisher the publisher value to set. + * @return the DiscoveredSecuritySolutionProperties object itself. + */ + public DiscoveredSecuritySolutionProperties withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the sku property: The security solutions' image sku. + * + * @return the sku value. + */ + public String sku() { + return this.sku; + } + + /** + * Set the sku property: The security solutions' image sku. + * + * @param sku the sku value to set. + * @return the DiscoveredSecuritySolutionProperties object itself. + */ + public DiscoveredSecuritySolutionProperties withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (securityFamily() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property securityFamily in model DiscoveredSecuritySolutionProperties")); + } + if (offer() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property offer in model DiscoveredSecuritySolutionProperties")); + } + if (publisher() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publisher in model DiscoveredSecuritySolutionProperties")); + } + if (sku() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sku in model DiscoveredSecuritySolutionProperties")); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyInner.java index 58ffc98ba14fa..a3e73b99ef7bb 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.InformationType; @@ -16,34 +15,24 @@ import java.util.Map; /** Information protection policy. */ -@JsonFlatten @Fluent -public class InformationProtectionPolicyInner extends ProxyResource { +public final class InformationProtectionPolicyInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(InformationProtectionPolicyInner.class); /* - * Describes the last UTC time the policy was modified. + * Information protection policy data */ - @JsonProperty(value = "properties.lastModifiedUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedUtc; + @JsonProperty(value = "properties") + private InformationProtectionPolicyProperties innerProperties; - /* - * Describes the version of the policy. - */ - @JsonProperty(value = "properties.version", access = JsonProperty.Access.WRITE_ONLY) - private String version; - - /* - * Dictionary of sensitivity labels. - */ - @JsonProperty(value = "properties.labels") - private Map labels; - - /* - * The sensitivity information types. + /** + * Get the innerProperties property: Information protection policy data. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.informationTypes") - private Map informationTypes; + private InformationProtectionPolicyProperties innerProperties() { + return this.innerProperties; + } /** * Get the lastModifiedUtc property: Describes the last UTC time the policy was modified. @@ -51,7 +40,7 @@ public class InformationProtectionPolicyInner extends ProxyResource { * @return the lastModifiedUtc value. */ public OffsetDateTime lastModifiedUtc() { - return this.lastModifiedUtc; + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedUtc(); } /** @@ -60,7 +49,7 @@ public OffsetDateTime lastModifiedUtc() { * @return the version value. */ public String version() { - return this.version; + return this.innerProperties() == null ? null : this.innerProperties().version(); } /** @@ -69,7 +58,7 @@ public String version() { * @return the labels value. */ public Map labels() { - return this.labels; + return this.innerProperties() == null ? null : this.innerProperties().labels(); } /** @@ -79,7 +68,10 @@ public Map labels() { * @return the InformationProtectionPolicyInner object itself. */ public InformationProtectionPolicyInner withLabels(Map labels) { - this.labels = labels; + if (this.innerProperties() == null) { + this.innerProperties = new InformationProtectionPolicyProperties(); + } + this.innerProperties().withLabels(labels); return this; } @@ -89,7 +81,7 @@ public InformationProtectionPolicyInner withLabels(Map * @return the informationTypes value. */ public Map informationTypes() { - return this.informationTypes; + return this.innerProperties() == null ? null : this.innerProperties().informationTypes(); } /** @@ -99,7 +91,10 @@ public Map informationTypes() { * @return the InformationProtectionPolicyInner object itself. */ public InformationProtectionPolicyInner withInformationTypes(Map informationTypes) { - this.informationTypes = informationTypes; + if (this.innerProperties() == null) { + this.innerProperties = new InformationProtectionPolicyProperties(); + } + this.innerProperties().withInformationTypes(informationTypes); return this; } @@ -109,25 +104,8 @@ public InformationProtectionPolicyInner withInformationTypes(Map { - if (e != null) { - e.validate(); - } - }); - } - if (informationTypes() != null) { - informationTypes() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyProperties.java new file mode 100644 index 0000000000000..b04a628c21d7b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyProperties.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.InformationType; +import com.azure.resourcemanager.security.models.SensitivityLabel; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** describes properties of an information protection policy. */ +@Fluent +public final class InformationProtectionPolicyProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InformationProtectionPolicyProperties.class); + + /* + * Describes the last UTC time the policy was modified. + */ + @JsonProperty(value = "lastModifiedUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedUtc; + + /* + * Describes the version of the policy. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * Dictionary of sensitivity labels. + */ + @JsonProperty(value = "labels") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map labels; + + /* + * The sensitivity information types. + */ + @JsonProperty(value = "informationTypes") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map informationTypes; + + /** + * Get the lastModifiedUtc property: Describes the last UTC time the policy was modified. + * + * @return the lastModifiedUtc value. + */ + public OffsetDateTime lastModifiedUtc() { + return this.lastModifiedUtc; + } + + /** + * Get the version property: Describes the version of the policy. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the labels property: Dictionary of sensitivity labels. + * + * @return the labels value. + */ + public Map labels() { + return this.labels; + } + + /** + * Set the labels property: Dictionary of sensitivity labels. + * + * @param labels the labels value to set. + * @return the InformationProtectionPolicyProperties object itself. + */ + public InformationProtectionPolicyProperties withLabels(Map labels) { + this.labels = labels; + return this; + } + + /** + * Get the informationTypes property: The sensitivity information types. + * + * @return the informationTypes value. + */ + public Map informationTypes() { + return this.informationTypes; + } + + /** + * Set the informationTypes property: The sensitivity information types. + * + * @param informationTypes the informationTypes value to set. + * @return the InformationProtectionPolicyProperties object itself. + */ + public InformationProtectionPolicyProperties withInformationTypes(Map informationTypes) { + this.informationTypes = informationTypes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (labels() != null) { + labels() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (informationTypes() != null) { + informationTypes() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertInner.java index e63895b8af854..d6aa8548263b9 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertInner.java @@ -5,107 +5,63 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem; import com.azure.resourcemanager.security.models.ReportedSeverity; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.LocalDate; import java.util.List; import java.util.Map; /** Security Solution Aggregated Alert information. */ -@JsonFlatten @Fluent -public class IoTSecurityAggregatedAlertInner extends ProxyResource { +public final class IoTSecurityAggregatedAlertInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(IoTSecurityAggregatedAlertInner.class); /* - * Name of the alert type. + * IoT Security solution aggregated alert details. */ - @JsonProperty(value = "properties.alertType", access = JsonProperty.Access.WRITE_ONLY) - private String alertType; + @JsonProperty(value = "properties") + private IoTSecurityAggregatedAlertProperties innerProperties; /* - * Display name of the alert type. - */ - @JsonProperty(value = "properties.alertDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String alertDisplayName; - - /* - * Date of detection. - */ - @JsonProperty(value = "properties.aggregatedDateUtc", access = JsonProperty.Access.WRITE_ONLY) - private LocalDate aggregatedDateUtc; - - /* - * Name of the organization that raised the alert. - */ - @JsonProperty(value = "properties.vendorName", access = JsonProperty.Access.WRITE_ONLY) - private String vendorName; - - /* - * Assessed alert severity. - */ - @JsonProperty(value = "properties.reportedSeverity", access = JsonProperty.Access.WRITE_ONLY) - private ReportedSeverity reportedSeverity; - - /* - * Recommended steps for remediation. - */ - @JsonProperty(value = "properties.remediationSteps", access = JsonProperty.Access.WRITE_ONLY) - private String remediationSteps; - - /* - * Description of the suspected vulnerability and meaning. - */ - @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * Number of alerts occurrences within the aggregated time window. - */ - @JsonProperty(value = "properties.count", access = JsonProperty.Access.WRITE_ONLY) - private Long count; - - /* - * Azure resource ID of the resource that received the alerts. - */ - @JsonProperty(value = "properties.effectedResourceType", access = JsonProperty.Access.WRITE_ONLY) - private String effectedResourceType; - - /* - * The type of the alerted resource (Azure, Non-Azure). - */ - @JsonProperty(value = "properties.systemSource", access = JsonProperty.Access.WRITE_ONLY) - private String systemSource; - - /* - * IoT Security solution alert response. + * Resource tags */ - @JsonProperty(value = "properties.actionTaken", access = JsonProperty.Access.WRITE_ONLY) - private String actionTaken; + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; - /* - * Log analytics query for getting the list of affected devices/alerts. + /** + * Get the innerProperties property: IoT Security solution aggregated alert details. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.logAnalyticsQuery", access = JsonProperty.Access.WRITE_ONLY) - private String logAnalyticsQuery; + private IoTSecurityAggregatedAlertProperties innerProperties() { + return this.innerProperties; + } - /* - * 10 devices with the highest number of occurrences of this alert type, on - * this day. + /** + * Get the tags property: Resource tags. + * + * @return the tags value. */ - @JsonProperty(value = "properties.topDevicesList", access = JsonProperty.Access.WRITE_ONLY) - private List topDevicesList; + public Map tags() { + return this.tags; + } - /* - * Resource tags + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the IoTSecurityAggregatedAlertInner object itself. */ - @JsonProperty(value = "tags") - private Map tags; + public IoTSecurityAggregatedAlertInner withTags(Map tags) { + this.tags = tags; + return this; + } /** * Get the alertType property: Name of the alert type. @@ -113,7 +69,7 @@ public class IoTSecurityAggregatedAlertInner extends ProxyResource { * @return the alertType value. */ public String alertType() { - return this.alertType; + return this.innerProperties() == null ? null : this.innerProperties().alertType(); } /** @@ -122,7 +78,7 @@ public String alertType() { * @return the alertDisplayName value. */ public String alertDisplayName() { - return this.alertDisplayName; + return this.innerProperties() == null ? null : this.innerProperties().alertDisplayName(); } /** @@ -131,7 +87,7 @@ public String alertDisplayName() { * @return the aggregatedDateUtc value. */ public LocalDate aggregatedDateUtc() { - return this.aggregatedDateUtc; + return this.innerProperties() == null ? null : this.innerProperties().aggregatedDateUtc(); } /** @@ -140,7 +96,7 @@ public LocalDate aggregatedDateUtc() { * @return the vendorName value. */ public String vendorName() { - return this.vendorName; + return this.innerProperties() == null ? null : this.innerProperties().vendorName(); } /** @@ -149,7 +105,7 @@ public String vendorName() { * @return the reportedSeverity value. */ public ReportedSeverity reportedSeverity() { - return this.reportedSeverity; + return this.innerProperties() == null ? null : this.innerProperties().reportedSeverity(); } /** @@ -158,7 +114,7 @@ public ReportedSeverity reportedSeverity() { * @return the remediationSteps value. */ public String remediationSteps() { - return this.remediationSteps; + return this.innerProperties() == null ? null : this.innerProperties().remediationSteps(); } /** @@ -167,7 +123,7 @@ public String remediationSteps() { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -176,7 +132,7 @@ public String description() { * @return the count value. */ public Long count() { - return this.count; + return this.innerProperties() == null ? null : this.innerProperties().count(); } /** @@ -185,7 +141,7 @@ public Long count() { * @return the effectedResourceType value. */ public String effectedResourceType() { - return this.effectedResourceType; + return this.innerProperties() == null ? null : this.innerProperties().effectedResourceType(); } /** @@ -194,7 +150,7 @@ public String effectedResourceType() { * @return the systemSource value. */ public String systemSource() { - return this.systemSource; + return this.innerProperties() == null ? null : this.innerProperties().systemSource(); } /** @@ -203,7 +159,7 @@ public String systemSource() { * @return the actionTaken value. */ public String actionTaken() { - return this.actionTaken; + return this.innerProperties() == null ? null : this.innerProperties().actionTaken(); } /** @@ -212,7 +168,7 @@ public String actionTaken() { * @return the logAnalyticsQuery value. */ public String logAnalyticsQuery() { - return this.logAnalyticsQuery; + return this.innerProperties() == null ? null : this.innerProperties().logAnalyticsQuery(); } /** @@ -222,27 +178,7 @@ public String logAnalyticsQuery() { * @return the topDevicesList value. */ public List topDevicesList() { - return this.topDevicesList; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the IoTSecurityAggregatedAlertInner object itself. - */ - public IoTSecurityAggregatedAlertInner withTags(Map tags) { - this.tags = tags; - return this; + return this.innerProperties() == null ? null : this.innerProperties().topDevicesList(); } /** @@ -251,8 +187,8 @@ public IoTSecurityAggregatedAlertInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (topDevicesList() != null) { - topDevicesList().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertProperties.java new file mode 100644 index 0000000000000..1ea5d7a2daacc --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertProperties.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem; +import com.azure.resourcemanager.security.models.ReportedSeverity; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.LocalDate; +import java.util.List; + +/** IoT Security solution aggregated alert details. */ +@Immutable +public final class IoTSecurityAggregatedAlertProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IoTSecurityAggregatedAlertProperties.class); + + /* + * Name of the alert type. + */ + @JsonProperty(value = "alertType", access = JsonProperty.Access.WRITE_ONLY) + private String alertType; + + /* + * Display name of the alert type. + */ + @JsonProperty(value = "alertDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String alertDisplayName; + + /* + * Date of detection. + */ + @JsonProperty(value = "aggregatedDateUtc", access = JsonProperty.Access.WRITE_ONLY) + private LocalDate aggregatedDateUtc; + + /* + * Name of the organization that raised the alert. + */ + @JsonProperty(value = "vendorName", access = JsonProperty.Access.WRITE_ONLY) + private String vendorName; + + /* + * Assessed alert severity. + */ + @JsonProperty(value = "reportedSeverity", access = JsonProperty.Access.WRITE_ONLY) + private ReportedSeverity reportedSeverity; + + /* + * Recommended steps for remediation. + */ + @JsonProperty(value = "remediationSteps", access = JsonProperty.Access.WRITE_ONLY) + private String remediationSteps; + + /* + * Description of the suspected vulnerability and meaning. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * Number of alerts occurrences within the aggregated time window. + */ + @JsonProperty(value = "count", access = JsonProperty.Access.WRITE_ONLY) + private Long count; + + /* + * Azure resource ID of the resource that received the alerts. + */ + @JsonProperty(value = "effectedResourceType", access = JsonProperty.Access.WRITE_ONLY) + private String effectedResourceType; + + /* + * The type of the alerted resource (Azure, Non-Azure). + */ + @JsonProperty(value = "systemSource", access = JsonProperty.Access.WRITE_ONLY) + private String systemSource; + + /* + * IoT Security solution alert response. + */ + @JsonProperty(value = "actionTaken", access = JsonProperty.Access.WRITE_ONLY) + private String actionTaken; + + /* + * Log analytics query for getting the list of affected devices/alerts. + */ + @JsonProperty(value = "logAnalyticsQuery", access = JsonProperty.Access.WRITE_ONLY) + private String logAnalyticsQuery; + + /* + * 10 devices with the highest number of occurrences of this alert type, on + * this day. + */ + @JsonProperty(value = "topDevicesList", access = JsonProperty.Access.WRITE_ONLY) + private List topDevicesList; + + /** + * Get the alertType property: Name of the alert type. + * + * @return the alertType value. + */ + public String alertType() { + return this.alertType; + } + + /** + * Get the alertDisplayName property: Display name of the alert type. + * + * @return the alertDisplayName value. + */ + public String alertDisplayName() { + return this.alertDisplayName; + } + + /** + * Get the aggregatedDateUtc property: Date of detection. + * + * @return the aggregatedDateUtc value. + */ + public LocalDate aggregatedDateUtc() { + return this.aggregatedDateUtc; + } + + /** + * Get the vendorName property: Name of the organization that raised the alert. + * + * @return the vendorName value. + */ + public String vendorName() { + return this.vendorName; + } + + /** + * Get the reportedSeverity property: Assessed alert severity. + * + * @return the reportedSeverity value. + */ + public ReportedSeverity reportedSeverity() { + return this.reportedSeverity; + } + + /** + * Get the remediationSteps property: Recommended steps for remediation. + * + * @return the remediationSteps value. + */ + public String remediationSteps() { + return this.remediationSteps; + } + + /** + * Get the description property: Description of the suspected vulnerability and meaning. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the count property: Number of alerts occurrences within the aggregated time window. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Get the effectedResourceType property: Azure resource ID of the resource that received the alerts. + * + * @return the effectedResourceType value. + */ + public String effectedResourceType() { + return this.effectedResourceType; + } + + /** + * Get the systemSource property: The type of the alerted resource (Azure, Non-Azure). + * + * @return the systemSource value. + */ + public String systemSource() { + return this.systemSource; + } + + /** + * Get the actionTaken property: IoT Security solution alert response. + * + * @return the actionTaken value. + */ + public String actionTaken() { + return this.actionTaken; + } + + /** + * Get the logAnalyticsQuery property: Log analytics query for getting the list of affected devices/alerts. + * + * @return the logAnalyticsQuery value. + */ + public String logAnalyticsQuery() { + return this.logAnalyticsQuery; + } + + /** + * Get the topDevicesList property: 10 devices with the highest number of occurrences of this alert type, on this + * day. + * + * @return the topDevicesList value. + */ + public List topDevicesList() { + return this.topDevicesList; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (topDevicesList() != null) { + topDevicesList().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationInner.java index c75f4c6ded38d..089a9b2098561 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationInner.java @@ -5,85 +5,60 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.ReportedSeverity; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** IoT Security solution recommendation information. */ -@JsonFlatten @Fluent -public class IoTSecurityAggregatedRecommendationInner extends ProxyResource { +public final class IoTSecurityAggregatedRecommendationInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(IoTSecurityAggregatedRecommendationInner.class); /* - * Name of the recommendation. + * Security Solution data */ - @JsonProperty(value = "properties.recommendationName") - private String recommendationName; + @JsonProperty(value = "properties") + private IoTSecurityAggregatedRecommendationProperties innerProperties; /* - * Display name of the recommendation type. - */ - @JsonProperty(value = "properties.recommendationDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String recommendationDisplayName; - - /* - * Description of the suspected vulnerability and meaning. - */ - @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * Recommendation-type GUID. - */ - @JsonProperty(value = "properties.recommendationTypeId", access = JsonProperty.Access.WRITE_ONLY) - private String recommendationTypeId; - - /* - * Name of the organization that made the recommendation. - */ - @JsonProperty(value = "properties.detectedBy", access = JsonProperty.Access.WRITE_ONLY) - private String detectedBy; - - /* - * Recommended steps for remediation - */ - @JsonProperty(value = "properties.remediationSteps", access = JsonProperty.Access.WRITE_ONLY) - private String remediationSteps; - - /* - * Assessed recommendation severity. - */ - @JsonProperty(value = "properties.reportedSeverity", access = JsonProperty.Access.WRITE_ONLY) - private ReportedSeverity reportedSeverity; - - /* - * Number of healthy devices within the IoT Security solution. + * Resource tags */ - @JsonProperty(value = "properties.healthyDevices", access = JsonProperty.Access.WRITE_ONLY) - private Long healthyDevices; + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; - /* - * Number of unhealthy devices within the IoT Security solution. + /** + * Get the innerProperties property: Security Solution data. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.unhealthyDeviceCount", access = JsonProperty.Access.WRITE_ONLY) - private Long unhealthyDeviceCount; + private IoTSecurityAggregatedRecommendationProperties innerProperties() { + return this.innerProperties; + } - /* - * Log analytics query for getting the list of affected devices/alerts. + /** + * Get the tags property: Resource tags. + * + * @return the tags value. */ - @JsonProperty(value = "properties.logAnalyticsQuery", access = JsonProperty.Access.WRITE_ONLY) - private String logAnalyticsQuery; + public Map tags() { + return this.tags; + } - /* - * Resource tags + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the IoTSecurityAggregatedRecommendationInner object itself. */ - @JsonProperty(value = "tags") - private Map tags; + public IoTSecurityAggregatedRecommendationInner withTags(Map tags) { + this.tags = tags; + return this; + } /** * Get the recommendationName property: Name of the recommendation. @@ -91,7 +66,7 @@ public class IoTSecurityAggregatedRecommendationInner extends ProxyResource { * @return the recommendationName value. */ public String recommendationName() { - return this.recommendationName; + return this.innerProperties() == null ? null : this.innerProperties().recommendationName(); } /** @@ -101,7 +76,10 @@ public String recommendationName() { * @return the IoTSecurityAggregatedRecommendationInner object itself. */ public IoTSecurityAggregatedRecommendationInner withRecommendationName(String recommendationName) { - this.recommendationName = recommendationName; + if (this.innerProperties() == null) { + this.innerProperties = new IoTSecurityAggregatedRecommendationProperties(); + } + this.innerProperties().withRecommendationName(recommendationName); return this; } @@ -111,7 +89,7 @@ public IoTSecurityAggregatedRecommendationInner withRecommendationName(String re * @return the recommendationDisplayName value. */ public String recommendationDisplayName() { - return this.recommendationDisplayName; + return this.innerProperties() == null ? null : this.innerProperties().recommendationDisplayName(); } /** @@ -120,7 +98,7 @@ public String recommendationDisplayName() { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -129,7 +107,7 @@ public String description() { * @return the recommendationTypeId value. */ public String recommendationTypeId() { - return this.recommendationTypeId; + return this.innerProperties() == null ? null : this.innerProperties().recommendationTypeId(); } /** @@ -138,7 +116,7 @@ public String recommendationTypeId() { * @return the detectedBy value. */ public String detectedBy() { - return this.detectedBy; + return this.innerProperties() == null ? null : this.innerProperties().detectedBy(); } /** @@ -147,7 +125,7 @@ public String detectedBy() { * @return the remediationSteps value. */ public String remediationSteps() { - return this.remediationSteps; + return this.innerProperties() == null ? null : this.innerProperties().remediationSteps(); } /** @@ -156,7 +134,7 @@ public String remediationSteps() { * @return the reportedSeverity value. */ public ReportedSeverity reportedSeverity() { - return this.reportedSeverity; + return this.innerProperties() == null ? null : this.innerProperties().reportedSeverity(); } /** @@ -165,7 +143,7 @@ public ReportedSeverity reportedSeverity() { * @return the healthyDevices value. */ public Long healthyDevices() { - return this.healthyDevices; + return this.innerProperties() == null ? null : this.innerProperties().healthyDevices(); } /** @@ -174,7 +152,7 @@ public Long healthyDevices() { * @return the unhealthyDeviceCount value. */ public Long unhealthyDeviceCount() { - return this.unhealthyDeviceCount; + return this.innerProperties() == null ? null : this.innerProperties().unhealthyDeviceCount(); } /** @@ -183,27 +161,7 @@ public Long unhealthyDeviceCount() { * @return the logAnalyticsQuery value. */ public String logAnalyticsQuery() { - return this.logAnalyticsQuery; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the IoTSecurityAggregatedRecommendationInner object itself. - */ - public IoTSecurityAggregatedRecommendationInner withTags(Map tags) { - this.tags = tags; - return this; + return this.innerProperties() == null ? null : this.innerProperties().logAnalyticsQuery(); } /** @@ -212,5 +170,8 @@ public IoTSecurityAggregatedRecommendationInner withTags(Map tag * @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/IoTSecurityAggregatedRecommendationProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationProperties.java new file mode 100644 index 0000000000000..42c0211d52419 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationProperties.java @@ -0,0 +1,187 @@ +// Copyright (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.ReportedSeverity; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IoT Security solution aggregated recommendation information. */ +@Fluent +public final class IoTSecurityAggregatedRecommendationProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(IoTSecurityAggregatedRecommendationProperties.class); + + /* + * Name of the recommendation. + */ + @JsonProperty(value = "recommendationName") + private String recommendationName; + + /* + * Display name of the recommendation type. + */ + @JsonProperty(value = "recommendationDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String recommendationDisplayName; + + /* + * Description of the suspected vulnerability and meaning. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * Recommendation-type GUID. + */ + @JsonProperty(value = "recommendationTypeId", access = JsonProperty.Access.WRITE_ONLY) + private String recommendationTypeId; + + /* + * Name of the organization that made the recommendation. + */ + @JsonProperty(value = "detectedBy", access = JsonProperty.Access.WRITE_ONLY) + private String detectedBy; + + /* + * Recommended steps for remediation + */ + @JsonProperty(value = "remediationSteps", access = JsonProperty.Access.WRITE_ONLY) + private String remediationSteps; + + /* + * Assessed recommendation severity. + */ + @JsonProperty(value = "reportedSeverity", access = JsonProperty.Access.WRITE_ONLY) + private ReportedSeverity reportedSeverity; + + /* + * Number of healthy devices within the IoT Security solution. + */ + @JsonProperty(value = "healthyDevices", access = JsonProperty.Access.WRITE_ONLY) + private Long healthyDevices; + + /* + * Number of unhealthy devices within the IoT Security solution. + */ + @JsonProperty(value = "unhealthyDeviceCount", access = JsonProperty.Access.WRITE_ONLY) + private Long unhealthyDeviceCount; + + /* + * Log analytics query for getting the list of affected devices/alerts. + */ + @JsonProperty(value = "logAnalyticsQuery", access = JsonProperty.Access.WRITE_ONLY) + private String logAnalyticsQuery; + + /** + * Get the recommendationName property: Name of the recommendation. + * + * @return the recommendationName value. + */ + public String recommendationName() { + return this.recommendationName; + } + + /** + * Set the recommendationName property: Name of the recommendation. + * + * @param recommendationName the recommendationName value to set. + * @return the IoTSecurityAggregatedRecommendationProperties object itself. + */ + public IoTSecurityAggregatedRecommendationProperties withRecommendationName(String recommendationName) { + this.recommendationName = recommendationName; + return this; + } + + /** + * Get the recommendationDisplayName property: Display name of the recommendation type. + * + * @return the recommendationDisplayName value. + */ + public String recommendationDisplayName() { + return this.recommendationDisplayName; + } + + /** + * Get the description property: Description of the suspected vulnerability and meaning. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the recommendationTypeId property: Recommendation-type GUID. + * + * @return the recommendationTypeId value. + */ + public String recommendationTypeId() { + return this.recommendationTypeId; + } + + /** + * Get the detectedBy property: Name of the organization that made the recommendation. + * + * @return the detectedBy value. + */ + public String detectedBy() { + return this.detectedBy; + } + + /** + * Get the remediationSteps property: Recommended steps for remediation. + * + * @return the remediationSteps value. + */ + public String remediationSteps() { + return this.remediationSteps; + } + + /** + * Get the reportedSeverity property: Assessed recommendation severity. + * + * @return the reportedSeverity value. + */ + public ReportedSeverity reportedSeverity() { + return this.reportedSeverity; + } + + /** + * Get the healthyDevices property: Number of healthy devices within the IoT Security solution. + * + * @return the healthyDevices value. + */ + public Long healthyDevices() { + return this.healthyDevices; + } + + /** + * Get the unhealthyDeviceCount property: Number of unhealthy devices within the IoT Security solution. + * + * @return the unhealthyDeviceCount value. + */ + public Long unhealthyDeviceCount() { + return this.unhealthyDeviceCount; + } + + /** + * Get the logAnalyticsQuery property: Log analytics query for getting the list of affected devices/alerts. + * + * @return the logAnalyticsQuery value. + */ + public String logAnalyticsQuery() { + return this.logAnalyticsQuery; + } + + /** + * 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/IoTSecuritySolutionAnalyticsModelInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelInner.java index b4896011a2ce3..981e968627af2 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.IoTSecurityAlertedDevice; @@ -18,46 +17,24 @@ import java.util.List; /** Security analytics of your IoT Security solution. */ -@JsonFlatten @Fluent -public class IoTSecuritySolutionAnalyticsModelInner extends ProxyResource { +public final class IoTSecuritySolutionAnalyticsModelInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(IoTSecuritySolutionAnalyticsModelInner.class); /* - * Security analytics of your IoT Security solution. + * Security Solution Aggregated Alert data */ - @JsonProperty(value = "properties.metrics", access = JsonProperty.Access.WRITE_ONLY) - private IoTSeverityMetrics metrics; + @JsonProperty(value = "properties") + private IoTSecuritySolutionAnalyticsModelProperties innerProperties; - /* - * Number of unhealthy devices within your IoT Security solution. - */ - @JsonProperty(value = "properties.unhealthyDeviceCount", access = JsonProperty.Access.WRITE_ONLY) - private Long unhealthyDeviceCount; - - /* - * List of device metrics by the aggregation date. - */ - @JsonProperty(value = "properties.devicesMetrics", access = JsonProperty.Access.WRITE_ONLY) - private List devicesMetrics; - - /* - * List of the 3 devices with the most alerts. - */ - @JsonProperty(value = "properties.topAlertedDevices") - private List topAlertedDevices; - - /* - * List of the 3 most prevalent device alerts. - */ - @JsonProperty(value = "properties.mostPrevalentDeviceAlerts") - private List mostPrevalentDeviceAlerts; - - /* - * List of the 3 most prevalent device recommendations. + /** + * Get the innerProperties property: Security Solution Aggregated Alert data. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.mostPrevalentDeviceRecommendations") - private List mostPrevalentDeviceRecommendations; + private IoTSecuritySolutionAnalyticsModelProperties innerProperties() { + return this.innerProperties; + } /** * Get the metrics property: Security analytics of your IoT Security solution. @@ -65,7 +42,7 @@ public class IoTSecuritySolutionAnalyticsModelInner extends ProxyResource { * @return the metrics value. */ public IoTSeverityMetrics metrics() { - return this.metrics; + return this.innerProperties() == null ? null : this.innerProperties().metrics(); } /** @@ -74,7 +51,7 @@ public IoTSeverityMetrics metrics() { * @return the unhealthyDeviceCount value. */ public Long unhealthyDeviceCount() { - return this.unhealthyDeviceCount; + return this.innerProperties() == null ? null : this.innerProperties().unhealthyDeviceCount(); } /** @@ -83,7 +60,7 @@ public Long unhealthyDeviceCount() { * @return the devicesMetrics value. */ public List devicesMetrics() { - return this.devicesMetrics; + return this.innerProperties() == null ? null : this.innerProperties().devicesMetrics(); } /** @@ -92,7 +69,7 @@ public List devic * @return the topAlertedDevices value. */ public List topAlertedDevices() { - return this.topAlertedDevices; + return this.innerProperties() == null ? null : this.innerProperties().topAlertedDevices(); } /** @@ -103,7 +80,10 @@ public List topAlertedDevices() { */ public IoTSecuritySolutionAnalyticsModelInner withTopAlertedDevices( List topAlertedDevices) { - this.topAlertedDevices = topAlertedDevices; + if (this.innerProperties() == null) { + this.innerProperties = new IoTSecuritySolutionAnalyticsModelProperties(); + } + this.innerProperties().withTopAlertedDevices(topAlertedDevices); return this; } @@ -113,7 +93,7 @@ public IoTSecuritySolutionAnalyticsModelInner withTopAlertedDevices( * @return the mostPrevalentDeviceAlerts value. */ public List mostPrevalentDeviceAlerts() { - return this.mostPrevalentDeviceAlerts; + return this.innerProperties() == null ? null : this.innerProperties().mostPrevalentDeviceAlerts(); } /** @@ -124,7 +104,10 @@ public List mostPrevalentDeviceAlerts() { */ public IoTSecuritySolutionAnalyticsModelInner withMostPrevalentDeviceAlerts( List mostPrevalentDeviceAlerts) { - this.mostPrevalentDeviceAlerts = mostPrevalentDeviceAlerts; + if (this.innerProperties() == null) { + this.innerProperties = new IoTSecuritySolutionAnalyticsModelProperties(); + } + this.innerProperties().withMostPrevalentDeviceAlerts(mostPrevalentDeviceAlerts); return this; } @@ -134,7 +117,7 @@ public IoTSecuritySolutionAnalyticsModelInner withMostPrevalentDeviceAlerts( * @return the mostPrevalentDeviceRecommendations value. */ public List mostPrevalentDeviceRecommendations() { - return this.mostPrevalentDeviceRecommendations; + return this.innerProperties() == null ? null : this.innerProperties().mostPrevalentDeviceRecommendations(); } /** @@ -145,7 +128,10 @@ public List mostPrevalentDeviceRecommendations( */ public IoTSecuritySolutionAnalyticsModelInner withMostPrevalentDeviceRecommendations( List mostPrevalentDeviceRecommendations) { - this.mostPrevalentDeviceRecommendations = mostPrevalentDeviceRecommendations; + if (this.innerProperties() == null) { + this.innerProperties = new IoTSecuritySolutionAnalyticsModelProperties(); + } + this.innerProperties().withMostPrevalentDeviceRecommendations(mostPrevalentDeviceRecommendations); return this; } @@ -155,20 +141,8 @@ public IoTSecuritySolutionAnalyticsModelInner withMostPrevalentDeviceRecommendat * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (metrics() != null) { - metrics().validate(); - } - if (devicesMetrics() != null) { - devicesMetrics().forEach(e -> e.validate()); - } - if (topAlertedDevices() != null) { - topAlertedDevices().forEach(e -> e.validate()); - } - if (mostPrevalentDeviceAlerts() != null) { - mostPrevalentDeviceAlerts().forEach(e -> e.validate()); - } - if (mostPrevalentDeviceRecommendations() != null) { - mostPrevalentDeviceRecommendations().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelProperties.java new file mode 100644 index 0000000000000..6505fc2ce4d68 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.IoTSecurityAlertedDevice; +import com.azure.resourcemanager.security.models.IoTSecurityDeviceAlert; +import com.azure.resourcemanager.security.models.IoTSecurityDeviceRecommendation; +import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem; +import com.azure.resourcemanager.security.models.IoTSeverityMetrics; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Security analytics properties of your IoT Security solution. */ +@Fluent +public final class IoTSecuritySolutionAnalyticsModelProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IoTSecuritySolutionAnalyticsModelProperties.class); + + /* + * Security analytics of your IoT Security solution. + */ + @JsonProperty(value = "metrics", access = JsonProperty.Access.WRITE_ONLY) + private IoTSeverityMetrics metrics; + + /* + * Number of unhealthy devices within your IoT Security solution. + */ + @JsonProperty(value = "unhealthyDeviceCount", access = JsonProperty.Access.WRITE_ONLY) + private Long unhealthyDeviceCount; + + /* + * List of device metrics by the aggregation date. + */ + @JsonProperty(value = "devicesMetrics", access = JsonProperty.Access.WRITE_ONLY) + private List devicesMetrics; + + /* + * List of the 3 devices with the most alerts. + */ + @JsonProperty(value = "topAlertedDevices") + private List topAlertedDevices; + + /* + * List of the 3 most prevalent device alerts. + */ + @JsonProperty(value = "mostPrevalentDeviceAlerts") + private List mostPrevalentDeviceAlerts; + + /* + * List of the 3 most prevalent device recommendations. + */ + @JsonProperty(value = "mostPrevalentDeviceRecommendations") + private List mostPrevalentDeviceRecommendations; + + /** + * Get the metrics property: Security analytics of your IoT Security solution. + * + * @return the metrics value. + */ + public IoTSeverityMetrics metrics() { + return this.metrics; + } + + /** + * Get the unhealthyDeviceCount property: Number of unhealthy devices within your IoT Security solution. + * + * @return the unhealthyDeviceCount value. + */ + public Long unhealthyDeviceCount() { + return this.unhealthyDeviceCount; + } + + /** + * Get the devicesMetrics property: List of device metrics by the aggregation date. + * + * @return the devicesMetrics value. + */ + public List devicesMetrics() { + return this.devicesMetrics; + } + + /** + * Get the topAlertedDevices property: List of the 3 devices with the most alerts. + * + * @return the topAlertedDevices value. + */ + public List topAlertedDevices() { + return this.topAlertedDevices; + } + + /** + * Set the topAlertedDevices property: List of the 3 devices with the most alerts. + * + * @param topAlertedDevices the topAlertedDevices value to set. + * @return the IoTSecuritySolutionAnalyticsModelProperties object itself. + */ + public IoTSecuritySolutionAnalyticsModelProperties withTopAlertedDevices( + List topAlertedDevices) { + this.topAlertedDevices = topAlertedDevices; + return this; + } + + /** + * Get the mostPrevalentDeviceAlerts property: List of the 3 most prevalent device alerts. + * + * @return the mostPrevalentDeviceAlerts value. + */ + public List mostPrevalentDeviceAlerts() { + return this.mostPrevalentDeviceAlerts; + } + + /** + * Set the mostPrevalentDeviceAlerts property: List of the 3 most prevalent device alerts. + * + * @param mostPrevalentDeviceAlerts the mostPrevalentDeviceAlerts value to set. + * @return the IoTSecuritySolutionAnalyticsModelProperties object itself. + */ + public IoTSecuritySolutionAnalyticsModelProperties withMostPrevalentDeviceAlerts( + List mostPrevalentDeviceAlerts) { + this.mostPrevalentDeviceAlerts = mostPrevalentDeviceAlerts; + return this; + } + + /** + * Get the mostPrevalentDeviceRecommendations property: List of the 3 most prevalent device recommendations. + * + * @return the mostPrevalentDeviceRecommendations value. + */ + public List mostPrevalentDeviceRecommendations() { + return this.mostPrevalentDeviceRecommendations; + } + + /** + * Set the mostPrevalentDeviceRecommendations property: List of the 3 most prevalent device recommendations. + * + * @param mostPrevalentDeviceRecommendations the mostPrevalentDeviceRecommendations value to set. + * @return the IoTSecuritySolutionAnalyticsModelProperties object itself. + */ + public IoTSecuritySolutionAnalyticsModelProperties withMostPrevalentDeviceRecommendations( + List mostPrevalentDeviceRecommendations) { + this.mostPrevalentDeviceRecommendations = mostPrevalentDeviceRecommendations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metrics() != null) { + metrics().validate(); + } + if (devicesMetrics() != null) { + devicesMetrics().forEach(e -> e.validate()); + } + if (topAlertedDevices() != null) { + topAlertedDevices().forEach(e -> e.validate()); + } + if (mostPrevalentDeviceAlerts() != null) { + mostPrevalentDeviceAlerts().forEach(e -> e.validate()); + } + if (mostPrevalentDeviceRecommendations() != null) { + mostPrevalentDeviceRecommendations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionModelInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionModelInner.java index b4fba2e83a4b8..6cdab7b0ae962 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionModelInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionModelInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; @@ -17,14 +16,14 @@ import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; /** IoT Security solution configuration and resource information. */ -@JsonFlatten @Fluent -public class IoTSecuritySolutionModelInner extends ProxyResource { +public final class IoTSecuritySolutionModelInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(IoTSecuritySolutionModelInner.class); /* @@ -33,6 +32,12 @@ public class IoTSecuritySolutionModelInner extends ProxyResource { @JsonProperty(value = "location") private String location; + /* + * Security Solution data + */ + @JsonProperty(value = "properties") + private IoTSecuritySolutionProperties innerProperties; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy * information. @@ -40,78 +45,11 @@ public class IoTSecuritySolutionModelInner extends ProxyResource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /* - * Workspace resource ID - */ - @JsonProperty(value = "properties.workspace") - private String workspace; - - /* - * Resource display name. - */ - @JsonProperty(value = "properties.displayName") - private String displayName; - - /* - * Status of the IoT Security solution. - */ - @JsonProperty(value = "properties.status") - private SecuritySolutionStatus status; - - /* - * List of additional options for exporting to workspace data. - */ - @JsonProperty(value = "properties.export") - private List export; - - /* - * Disabled data sources. Disabling these data sources compromises the - * system. - */ - @JsonProperty(value = "properties.disabledDataSources") - private List disabledDataSources; - - /* - * IoT Hub resource IDs - */ - @JsonProperty(value = "properties.iotHubs") - private List iotHubs; - - /* - * Properties of the IoT Security solution's user defined resources. - */ - @JsonProperty(value = "properties.userDefinedResources") - private UserDefinedResourcesProperties userDefinedResources; - - /* - * List of resources that were automatically discovered as relevant to the - * security solution. - */ - @JsonProperty(value = "properties.autoDiscoveredResources", access = JsonProperty.Access.WRITE_ONLY) - private List autoDiscoveredResources; - - /* - * List of the configuration status for each recommendation type. - */ - @JsonProperty(value = "properties.recommendationsConfiguration") - private List recommendationsConfiguration; - - /* - * Unmasked IP address logging status - */ - @JsonProperty(value = "properties.unmaskedIpLoggingStatus") - private UnmaskedIpLoggingStatus unmaskedIpLoggingStatus; - - /* - * List of additional workspaces - */ - @JsonProperty(value = "properties.additionalWorkspaces") - private List additionalWorkspaces; - /* * Resource tags */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** @@ -134,6 +72,15 @@ public IoTSecuritySolutionModelInner withLocation(String location) { return this; } + /** + * Get the innerProperties property: Security Solution data. + * + * @return the innerProperties value. + */ + private IoTSecuritySolutionProperties innerProperties() { + return this.innerProperties; + } + /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -143,13 +90,33 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the IoTSecuritySolutionModelInner object itself. + */ + public IoTSecuritySolutionModelInner withTags(Map tags) { + this.tags = tags; + return this; + } + /** * Get the workspace property: Workspace resource ID. * * @return the workspace value. */ public String workspace() { - return this.workspace; + return this.innerProperties() == null ? null : this.innerProperties().workspace(); } /** @@ -159,7 +126,10 @@ public String workspace() { * @return the IoTSecuritySolutionModelInner object itself. */ public IoTSecuritySolutionModelInner withWorkspace(String workspace) { - this.workspace = workspace; + if (this.innerProperties() == null) { + this.innerProperties = new IoTSecuritySolutionProperties(); + } + this.innerProperties().withWorkspace(workspace); return this; } @@ -169,7 +139,7 @@ public IoTSecuritySolutionModelInner withWorkspace(String workspace) { * @return the displayName value. */ public String displayName() { - return this.displayName; + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** @@ -179,7 +149,10 @@ public String displayName() { * @return the IoTSecuritySolutionModelInner object itself. */ public IoTSecuritySolutionModelInner withDisplayName(String displayName) { - this.displayName = displayName; + if (this.innerProperties() == null) { + this.innerProperties = new IoTSecuritySolutionProperties(); + } + this.innerProperties().withDisplayName(displayName); return this; } @@ -189,7 +162,7 @@ public IoTSecuritySolutionModelInner withDisplayName(String displayName) { * @return the status value. */ public SecuritySolutionStatus status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -199,7 +172,10 @@ public SecuritySolutionStatus status() { * @return the IoTSecuritySolutionModelInner object itself. */ public IoTSecuritySolutionModelInner withStatus(SecuritySolutionStatus status) { - this.status = status; + if (this.innerProperties() == null) { + this.innerProperties = new IoTSecuritySolutionProperties(); + } + this.innerProperties().withStatus(status); return this; } @@ -209,7 +185,7 @@ public IoTSecuritySolutionModelInner withStatus(SecuritySolutionStatus status) { * @return the export value. */ public List export() { - return this.export; + return this.innerProperties() == null ? null : this.innerProperties().export(); } /** @@ -219,7 +195,10 @@ public List export() { * @return the IoTSecuritySolutionModelInner object itself. */ public IoTSecuritySolutionModelInner withExport(List export) { - this.export = export; + if (this.innerProperties() == null) { + this.innerProperties = new IoTSecuritySolutionProperties(); + } + this.innerProperties().withExport(export); return this; } @@ -229,7 +208,7 @@ public IoTSecuritySolutionModelInner withExport(List export) { * @return the disabledDataSources value. */ public List disabledDataSources() { - return this.disabledDataSources; + return this.innerProperties() == null ? null : this.innerProperties().disabledDataSources(); } /** @@ -239,7 +218,10 @@ public List disabledDataSources() { * @return the IoTSecuritySolutionModelInner object itself. */ public IoTSecuritySolutionModelInner withDisabledDataSources(List disabledDataSources) { - this.disabledDataSources = disabledDataSources; + if (this.innerProperties() == null) { + this.innerProperties = new IoTSecuritySolutionProperties(); + } + this.innerProperties().withDisabledDataSources(disabledDataSources); return this; } @@ -249,7 +231,7 @@ public IoTSecuritySolutionModelInner withDisabledDataSources(List di * @return the iotHubs value. */ public List iotHubs() { - return this.iotHubs; + return this.innerProperties() == null ? null : this.innerProperties().iotHubs(); } /** @@ -259,7 +241,10 @@ public List iotHubs() { * @return the IoTSecuritySolutionModelInner object itself. */ public IoTSecuritySolutionModelInner withIotHubs(List iotHubs) { - this.iotHubs = iotHubs; + if (this.innerProperties() == null) { + this.innerProperties = new IoTSecuritySolutionProperties(); + } + this.innerProperties().withIotHubs(iotHubs); return this; } @@ -269,7 +254,7 @@ public IoTSecuritySolutionModelInner withIotHubs(List iotHubs) { * @return the userDefinedResources value. */ public UserDefinedResourcesProperties userDefinedResources() { - return this.userDefinedResources; + return this.innerProperties() == null ? null : this.innerProperties().userDefinedResources(); } /** @@ -279,7 +264,10 @@ public UserDefinedResourcesProperties userDefinedResources() { * @return the IoTSecuritySolutionModelInner object itself. */ public IoTSecuritySolutionModelInner withUserDefinedResources(UserDefinedResourcesProperties userDefinedResources) { - this.userDefinedResources = userDefinedResources; + if (this.innerProperties() == null) { + this.innerProperties = new IoTSecuritySolutionProperties(); + } + this.innerProperties().withUserDefinedResources(userDefinedResources); return this; } @@ -290,7 +278,7 @@ public IoTSecuritySolutionModelInner withUserDefinedResources(UserDefinedResourc * @return the autoDiscoveredResources value. */ public List autoDiscoveredResources() { - return this.autoDiscoveredResources; + return this.innerProperties() == null ? null : this.innerProperties().autoDiscoveredResources(); } /** @@ -299,7 +287,7 @@ public List autoDiscoveredResources() { * @return the recommendationsConfiguration value. */ public List recommendationsConfiguration() { - return this.recommendationsConfiguration; + return this.innerProperties() == null ? null : this.innerProperties().recommendationsConfiguration(); } /** @@ -310,7 +298,10 @@ public List recommendationsConfiguration( */ public IoTSecuritySolutionModelInner withRecommendationsConfiguration( List recommendationsConfiguration) { - this.recommendationsConfiguration = recommendationsConfiguration; + if (this.innerProperties() == null) { + this.innerProperties = new IoTSecuritySolutionProperties(); + } + this.innerProperties().withRecommendationsConfiguration(recommendationsConfiguration); return this; } @@ -320,7 +311,7 @@ public IoTSecuritySolutionModelInner withRecommendationsConfiguration( * @return the unmaskedIpLoggingStatus value. */ public UnmaskedIpLoggingStatus unmaskedIpLoggingStatus() { - return this.unmaskedIpLoggingStatus; + return this.innerProperties() == null ? null : this.innerProperties().unmaskedIpLoggingStatus(); } /** @@ -330,7 +321,10 @@ public UnmaskedIpLoggingStatus unmaskedIpLoggingStatus() { * @return the IoTSecuritySolutionModelInner object itself. */ public IoTSecuritySolutionModelInner withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus unmaskedIpLoggingStatus) { - this.unmaskedIpLoggingStatus = unmaskedIpLoggingStatus; + if (this.innerProperties() == null) { + this.innerProperties = new IoTSecuritySolutionProperties(); + } + this.innerProperties().withUnmaskedIpLoggingStatus(unmaskedIpLoggingStatus); return this; } @@ -340,7 +334,7 @@ public IoTSecuritySolutionModelInner withUnmaskedIpLoggingStatus(UnmaskedIpLoggi * @return the additionalWorkspaces value. */ public List additionalWorkspaces() { - return this.additionalWorkspaces; + return this.innerProperties() == null ? null : this.innerProperties().additionalWorkspaces(); } /** @@ -351,27 +345,10 @@ public List additionalWorkspaces() { */ public IoTSecuritySolutionModelInner withAdditionalWorkspaces( List additionalWorkspaces) { - this.additionalWorkspaces = additionalWorkspaces; - return this; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withTags(Map tags) { - this.tags = tags; + if (this.innerProperties() == null) { + this.innerProperties = new IoTSecuritySolutionProperties(); + } + this.innerProperties().withAdditionalWorkspaces(additionalWorkspaces); return this; } @@ -381,14 +358,8 @@ public IoTSecuritySolutionModelInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (userDefinedResources() != null) { - userDefinedResources().validate(); - } - if (recommendationsConfiguration() != null) { - recommendationsConfiguration().forEach(e -> e.validate()); - } - if (additionalWorkspaces() != null) { - additionalWorkspaces().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionProperties.java new file mode 100644 index 0000000000000..37b1fcf3b5a1c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionProperties.java @@ -0,0 +1,333 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +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.RecommendationConfigurationProperties; +import com.azure.resourcemanager.security.models.SecuritySolutionStatus; +import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; +import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Security Solution setting data. */ +@Fluent +public final class IoTSecuritySolutionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IoTSecuritySolutionProperties.class); + + /* + * Workspace resource ID + */ + @JsonProperty(value = "workspace") + private String workspace; + + /* + * Resource display name. + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * Status of the IoT Security solution. + */ + @JsonProperty(value = "status") + private SecuritySolutionStatus status; + + /* + * List of additional options for exporting to workspace data. + */ + @JsonProperty(value = "export") + private List export; + + /* + * Disabled data sources. Disabling these data sources compromises the + * system. + */ + @JsonProperty(value = "disabledDataSources") + private List disabledDataSources; + + /* + * IoT Hub resource IDs + */ + @JsonProperty(value = "iotHubs", required = true) + private List iotHubs; + + /* + * Properties of the IoT Security solution's user defined resources. + */ + @JsonProperty(value = "userDefinedResources") + private UserDefinedResourcesProperties userDefinedResources; + + /* + * List of resources that were automatically discovered as relevant to the + * security solution. + */ + @JsonProperty(value = "autoDiscoveredResources", access = JsonProperty.Access.WRITE_ONLY) + private List autoDiscoveredResources; + + /* + * List of the configuration status for each recommendation type. + */ + @JsonProperty(value = "recommendationsConfiguration") + private List recommendationsConfiguration; + + /* + * Unmasked IP address logging status + */ + @JsonProperty(value = "unmaskedIpLoggingStatus") + private UnmaskedIpLoggingStatus unmaskedIpLoggingStatus; + + /* + * List of additional workspaces + */ + @JsonProperty(value = "additionalWorkspaces") + private List additionalWorkspaces; + + /** + * Get the workspace property: Workspace resource ID. + * + * @return the workspace value. + */ + public String workspace() { + return this.workspace; + } + + /** + * Set the workspace property: Workspace resource ID. + * + * @param workspace the workspace value to set. + * @return the IoTSecuritySolutionProperties object itself. + */ + public IoTSecuritySolutionProperties withWorkspace(String workspace) { + this.workspace = workspace; + return this; + } + + /** + * Get the displayName property: Resource display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Resource display name. + * + * @param displayName the displayName value to set. + * @return the IoTSecuritySolutionProperties object itself. + */ + public IoTSecuritySolutionProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the status property: Status of the IoT Security solution. + * + * @return the status value. + */ + public SecuritySolutionStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the IoT Security solution. + * + * @param status the status value to set. + * @return the IoTSecuritySolutionProperties object itself. + */ + public IoTSecuritySolutionProperties withStatus(SecuritySolutionStatus status) { + this.status = status; + return this; + } + + /** + * Get the export property: List of additional options for exporting to workspace data. + * + * @return the export value. + */ + public List export() { + return this.export; + } + + /** + * Set the export property: List of additional options for exporting to workspace data. + * + * @param export the export value to set. + * @return the IoTSecuritySolutionProperties object itself. + */ + public IoTSecuritySolutionProperties withExport(List export) { + this.export = export; + return this; + } + + /** + * Get the disabledDataSources property: Disabled data sources. Disabling these data sources compromises the system. + * + * @return the disabledDataSources value. + */ + public List disabledDataSources() { + return this.disabledDataSources; + } + + /** + * Set the disabledDataSources property: Disabled data sources. Disabling these data sources compromises the system. + * + * @param disabledDataSources the disabledDataSources value to set. + * @return the IoTSecuritySolutionProperties object itself. + */ + public IoTSecuritySolutionProperties withDisabledDataSources(List disabledDataSources) { + this.disabledDataSources = disabledDataSources; + return this; + } + + /** + * Get the iotHubs property: IoT Hub resource IDs. + * + * @return the iotHubs value. + */ + public List iotHubs() { + return this.iotHubs; + } + + /** + * Set the iotHubs property: IoT Hub resource IDs. + * + * @param iotHubs the iotHubs value to set. + * @return the IoTSecuritySolutionProperties object itself. + */ + public IoTSecuritySolutionProperties withIotHubs(List iotHubs) { + this.iotHubs = iotHubs; + return this; + } + + /** + * Get the userDefinedResources property: Properties of the IoT Security solution's user defined resources. + * + * @return the userDefinedResources value. + */ + public UserDefinedResourcesProperties userDefinedResources() { + return this.userDefinedResources; + } + + /** + * Set the userDefinedResources property: Properties of the IoT Security solution's user defined resources. + * + * @param userDefinedResources the userDefinedResources value to set. + * @return the IoTSecuritySolutionProperties object itself. + */ + public IoTSecuritySolutionProperties withUserDefinedResources(UserDefinedResourcesProperties userDefinedResources) { + this.userDefinedResources = userDefinedResources; + return this; + } + + /** + * Get the autoDiscoveredResources property: List of resources that were automatically discovered as relevant to the + * security solution. + * + * @return the autoDiscoveredResources value. + */ + public List autoDiscoveredResources() { + return this.autoDiscoveredResources; + } + + /** + * Get the recommendationsConfiguration property: List of the configuration status for each recommendation type. + * + * @return the recommendationsConfiguration value. + */ + public List recommendationsConfiguration() { + return this.recommendationsConfiguration; + } + + /** + * Set the recommendationsConfiguration property: List of the configuration status for each recommendation type. + * + * @param recommendationsConfiguration the recommendationsConfiguration value to set. + * @return the IoTSecuritySolutionProperties object itself. + */ + public IoTSecuritySolutionProperties withRecommendationsConfiguration( + List recommendationsConfiguration) { + this.recommendationsConfiguration = recommendationsConfiguration; + return this; + } + + /** + * Get the unmaskedIpLoggingStatus property: Unmasked IP address logging status. + * + * @return the unmaskedIpLoggingStatus value. + */ + public UnmaskedIpLoggingStatus unmaskedIpLoggingStatus() { + return this.unmaskedIpLoggingStatus; + } + + /** + * Set the unmaskedIpLoggingStatus property: Unmasked IP address logging status. + * + * @param unmaskedIpLoggingStatus the unmaskedIpLoggingStatus value to set. + * @return the IoTSecuritySolutionProperties object itself. + */ + public IoTSecuritySolutionProperties withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus unmaskedIpLoggingStatus) { + this.unmaskedIpLoggingStatus = unmaskedIpLoggingStatus; + return this; + } + + /** + * Get the additionalWorkspaces property: List of additional workspaces. + * + * @return the additionalWorkspaces value. + */ + public List additionalWorkspaces() { + return this.additionalWorkspaces; + } + + /** + * Set the additionalWorkspaces property: List of additional workspaces. + * + * @param additionalWorkspaces the additionalWorkspaces value to set. + * @return the IoTSecuritySolutionProperties object itself. + */ + public IoTSecuritySolutionProperties withAdditionalWorkspaces( + List additionalWorkspaces) { + this.additionalWorkspaces = additionalWorkspaces; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (displayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property displayName in model IoTSecuritySolutionProperties")); + } + if (iotHubs() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property iotHubs in model IoTSecuritySolutionProperties")); + } + if (userDefinedResources() != null) { + userDefinedResources().validate(); + } + if (recommendationsConfiguration() != null) { + recommendationsConfiguration().forEach(e -> e.validate()); + } + if (additionalWorkspaces() != null) { + additionalWorkspaces().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotAlertModelInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotAlertModelInner.java deleted file mode 100644 index f6fe3964e991c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotAlertModelInner.java +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (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.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** IoT alert. */ -@JsonFlatten -@Fluent -public class IotAlertModelInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotAlertModelInner.class); - - /* - * Holds the product canonical identifier of the alert within the scope of - * a product - */ - @JsonProperty(value = "properties.systemAlertId", access = JsonProperty.Access.WRITE_ONLY) - private String systemAlertId; - - /* - * Display name of the main entity being reported on - */ - @JsonProperty(value = "properties.compromisedEntity", access = JsonProperty.Access.WRITE_ONLY) - private String compromisedEntity; - - /* - * The type name of the alert - */ - @JsonProperty(value = "properties.alertType", access = JsonProperty.Access.WRITE_ONLY) - private String alertType; - - /* - * The impact start time of the alert (the time of the first event or - * activity included in the alert) - */ - @JsonProperty(value = "properties.startTimeUtc", access = JsonProperty.Access.WRITE_ONLY) - private String startTimeUtc; - - /* - * The impact end time of the alert (the time of the last event or activity - * included in the alert) - */ - @JsonProperty(value = "properties.endTimeUtc", access = JsonProperty.Access.WRITE_ONLY) - private String endTimeUtc; - - /* - * A list of entities related to the alert - */ - @JsonProperty(value = "properties.entities") - private List entities; - - /* - * A bag of fields which extends the alert information - */ - @JsonProperty(value = "properties.extendedProperties") - private Object extendedProperties; - - /** - * Get the systemAlertId property: Holds the product canonical identifier of the alert within the scope of a - * product. - * - * @return the systemAlertId value. - */ - public String systemAlertId() { - return this.systemAlertId; - } - - /** - * Get the compromisedEntity property: Display name of the main entity being reported on. - * - * @return the compromisedEntity value. - */ - public String compromisedEntity() { - return this.compromisedEntity; - } - - /** - * Get the alertType property: The type name of the alert. - * - * @return the alertType value. - */ - public String alertType() { - return this.alertType; - } - - /** - * Get the startTimeUtc property: The impact start time of the alert (the time of the first event or activity - * included in the alert). - * - * @return the startTimeUtc value. - */ - public String startTimeUtc() { - return this.startTimeUtc; - } - - /** - * Get the endTimeUtc property: The impact end time of the alert (the time of the last event or activity included in - * the alert). - * - * @return the endTimeUtc value. - */ - public String endTimeUtc() { - return this.endTimeUtc; - } - - /** - * Get the entities property: A list of entities related to the alert. - * - * @return the entities value. - */ - public List entities() { - return this.entities; - } - - /** - * Set the entities property: A list of entities related to the alert. - * - * @param entities the entities value to set. - * @return the IotAlertModelInner object itself. - */ - public IotAlertModelInner withEntities(List entities) { - this.entities = entities; - return this; - } - - /** - * Get the extendedProperties property: A bag of fields which extends the alert information. - * - * @return the extendedProperties value. - */ - public Object extendedProperties() { - return this.extendedProperties; - } - - /** - * Set the extendedProperties property: A bag of fields which extends the alert information. - * - * @param extendedProperties the extendedProperties value to set. - * @return the IotAlertModelInner object itself. - */ - public IotAlertModelInner withExtendedProperties(Object extendedProperties) { - this.extendedProperties = extendedProperties; - 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/IotAlertTypeInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotAlertTypeInner.java deleted file mode 100644 index 180a9cf7a0bbf..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotAlertTypeInner.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (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.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.AlertIntent; -import com.azure.resourcemanager.security.models.AlertSeverity; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** IoT alert type. */ -@JsonFlatten -@Immutable -public class IotAlertTypeInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotAlertTypeInner.class); - - /* - * The display name of the alert - */ - @JsonProperty(value = "properties.alertDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String alertDisplayName; - - /* - * The severity of the alert - */ - @JsonProperty(value = "properties.severity", access = JsonProperty.Access.WRITE_ONLY) - private AlertSeverity severity; - - /* - * Description of the suspected vulnerability and meaning. - */ - @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * The name of the alert provider or internal partner - */ - @JsonProperty(value = "properties.providerName", access = JsonProperty.Access.WRITE_ONLY) - private String providerName; - - /* - * The name of the product which published this alert - */ - @JsonProperty(value = "properties.productName", access = JsonProperty.Access.WRITE_ONLY) - private String productName; - - /* - * The name of a component inside the product which generated the alert - */ - @JsonProperty(value = "properties.productComponentName", access = JsonProperty.Access.WRITE_ONLY) - private String productComponentName; - - /* - * The name of the vendor that raise the alert - */ - @JsonProperty(value = "properties.vendorName", access = JsonProperty.Access.WRITE_ONLY) - private String vendorName; - - /* - * Kill chain related intent behind the alert. Could contain multiple enum - * values (separated by commas) - */ - @JsonProperty(value = "properties.intent", access = JsonProperty.Access.WRITE_ONLY) - private AlertIntent intent; - - /* - * Manual action items to take to remediate the alert - */ - @JsonProperty(value = "properties.remediationSteps", access = JsonProperty.Access.WRITE_ONLY) - private List remediationSteps; - - /** - * Get the alertDisplayName property: The display name of the alert. - * - * @return the alertDisplayName value. - */ - public String alertDisplayName() { - return this.alertDisplayName; - } - - /** - * Get the severity property: The severity of the alert. - * - * @return the severity value. - */ - public AlertSeverity severity() { - return this.severity; - } - - /** - * Get the description property: Description of the suspected vulnerability and meaning. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the providerName property: The name of the alert provider or internal partner. - * - * @return the providerName value. - */ - public String providerName() { - return this.providerName; - } - - /** - * Get the productName property: The name of the product which published this alert. - * - * @return the productName value. - */ - public String productName() { - return this.productName; - } - - /** - * Get the productComponentName property: The name of a component inside the product which generated the alert. - * - * @return the productComponentName value. - */ - public String productComponentName() { - return this.productComponentName; - } - - /** - * Get the vendorName property: The name of the vendor that raise the alert. - * - * @return the vendorName value. - */ - public String vendorName() { - return this.vendorName; - } - - /** - * Get the intent property: Kill chain related intent behind the alert. Could contain multiple enum values - * (separated by commas). - * - * @return the intent value. - */ - public AlertIntent intent() { - return this.intent; - } - - /** - * Get the remediationSteps property: Manual action items to take to remediate the alert. - * - * @return the remediationSteps value. - */ - public List remediationSteps() { - return this.remediationSteps; - } - - /** - * 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/IotDefenderSettingsListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotDefenderSettingsListInner.java deleted file mode 100644 index 26fb0a90bee16..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotDefenderSettingsListInner.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.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of IoT Defender settings. */ -@Immutable -public final class IotDefenderSettingsListInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotDefenderSettingsListInner.class); - - /* - * List data - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /** - * Get the value property: List data. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * 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/IotDefenderSettingsModelInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotDefenderSettingsModelInner.java deleted file mode 100644 index 0619dc3c8394b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotDefenderSettingsModelInner.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (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.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.OnboardingKind; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** IoT Defender settings. */ -@JsonFlatten -@Fluent -public class IotDefenderSettingsModelInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotDefenderSettingsModelInner.class); - - /* - * Size of the device quota (as a opposed to a Pay as You Go billing - * model). Value is required to be in multiples of 1000. - */ - @JsonProperty(value = "properties.deviceQuota") - private Integer deviceQuota; - - /* - * Sentinel Workspace Resource Ids - */ - @JsonProperty(value = "properties.sentinelWorkspaceResourceIds") - private List sentinelWorkspaceResourceIds; - - /* - * The kind of onboarding for the subscription - */ - @JsonProperty(value = "properties.onboardingKind") - private OnboardingKind onboardingKind; - - /* - * End time of the evaluation period, if such exist - */ - @JsonProperty(value = "properties.evaluationEndTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime evaluationEndTime; - - /** - * Get the deviceQuota property: Size of the device quota (as a opposed to a Pay as You Go billing model). Value is - * required to be in multiples of 1000. - * - * @return the deviceQuota value. - */ - public Integer deviceQuota() { - return this.deviceQuota; - } - - /** - * Set the deviceQuota property: Size of the device quota (as a opposed to a Pay as You Go billing model). Value is - * required to be in multiples of 1000. - * - * @param deviceQuota the deviceQuota value to set. - * @return the IotDefenderSettingsModelInner object itself. - */ - public IotDefenderSettingsModelInner withDeviceQuota(Integer deviceQuota) { - this.deviceQuota = deviceQuota; - return this; - } - - /** - * Get the sentinelWorkspaceResourceIds property: Sentinel Workspace Resource Ids. - * - * @return the sentinelWorkspaceResourceIds value. - */ - public List sentinelWorkspaceResourceIds() { - return this.sentinelWorkspaceResourceIds; - } - - /** - * Set the sentinelWorkspaceResourceIds property: Sentinel Workspace Resource Ids. - * - * @param sentinelWorkspaceResourceIds the sentinelWorkspaceResourceIds value to set. - * @return the IotDefenderSettingsModelInner object itself. - */ - public IotDefenderSettingsModelInner withSentinelWorkspaceResourceIds(List sentinelWorkspaceResourceIds) { - this.sentinelWorkspaceResourceIds = sentinelWorkspaceResourceIds; - return this; - } - - /** - * Get the onboardingKind property: The kind of onboarding for the subscription. - * - * @return the onboardingKind value. - */ - public OnboardingKind onboardingKind() { - return this.onboardingKind; - } - - /** - * Set the onboardingKind property: The kind of onboarding for the subscription. - * - * @param onboardingKind the onboardingKind value to set. - * @return the IotDefenderSettingsModelInner object itself. - */ - public IotDefenderSettingsModelInner withOnboardingKind(OnboardingKind onboardingKind) { - this.onboardingKind = onboardingKind; - return this; - } - - /** - * Get the evaluationEndTime property: End time of the evaluation period, if such exist. - * - * @return the evaluationEndTime value. - */ - public OffsetDateTime evaluationEndTime() { - return this.evaluationEndTime; - } - - /** - * 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/IotRecommendationModelInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotRecommendationModelInner.java deleted file mode 100644 index b094b7940c0cd..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotRecommendationModelInner.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (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.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** IoT recommendation. */ -@JsonFlatten -@Fluent -public class IotRecommendationModelInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotRecommendationModelInner.class); - - /* - * Identifier of the device being reported on - */ - @JsonProperty(value = "properties.deviceId", access = JsonProperty.Access.WRITE_ONLY) - private String deviceId; - - /* - * The type name of the recommendation - */ - @JsonProperty(value = "properties.recommendationType", access = JsonProperty.Access.WRITE_ONLY) - private String recommendationType; - - /* - * The discovery time of the recommendation - */ - @JsonProperty(value = "properties.discoveredTimeUtc", access = JsonProperty.Access.WRITE_ONLY) - private String discoveredTimeUtc; - - /* - * A bag of fields which extends the recommendation information - */ - @JsonProperty(value = "properties.recommendationAdditionalData") - private Object recommendationAdditionalData; - - /** - * Get the deviceId property: Identifier of the device being reported on. - * - * @return the deviceId value. - */ - public String deviceId() { - return this.deviceId; - } - - /** - * Get the recommendationType property: The type name of the recommendation. - * - * @return the recommendationType value. - */ - public String recommendationType() { - return this.recommendationType; - } - - /** - * Get the discoveredTimeUtc property: The discovery time of the recommendation. - * - * @return the discoveredTimeUtc value. - */ - public String discoveredTimeUtc() { - return this.discoveredTimeUtc; - } - - /** - * Get the recommendationAdditionalData property: A bag of fields which extends the recommendation information. - * - * @return the recommendationAdditionalData value. - */ - public Object recommendationAdditionalData() { - return this.recommendationAdditionalData; - } - - /** - * Set the recommendationAdditionalData property: A bag of fields which extends the recommendation information. - * - * @param recommendationAdditionalData the recommendationAdditionalData value to set. - * @return the IotRecommendationModelInner object itself. - */ - public IotRecommendationModelInner withRecommendationAdditionalData(Object recommendationAdditionalData) { - this.recommendationAdditionalData = recommendationAdditionalData; - 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/IotRecommendationTypeInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotRecommendationTypeInner.java deleted file mode 100644 index eaca53fa1320b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotRecommendationTypeInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (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.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.RecommendationSeverity; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** IoT recommendation type. */ -@JsonFlatten -@Immutable -public class IotRecommendationTypeInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotRecommendationTypeInner.class); - - /* - * The display name of the recommendation - */ - @JsonProperty(value = "properties.recommendationDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String recommendationDisplayName; - - /* - * The severity of the recommendation - */ - @JsonProperty(value = "properties.severity", access = JsonProperty.Access.WRITE_ONLY) - private RecommendationSeverity severity; - - /* - * Description of the suspected vulnerability and meaning. - */ - @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * The name of the product which published this recommendation - */ - @JsonProperty(value = "properties.productName", access = JsonProperty.Access.WRITE_ONLY) - private String productName; - - /* - * The name of a component inside the product which generated the - * recommendation - */ - @JsonProperty(value = "properties.productComponentName", access = JsonProperty.Access.WRITE_ONLY) - private String productComponentName; - - /* - * The name of the vendor that raised the recommendation - */ - @JsonProperty(value = "properties.vendorName", access = JsonProperty.Access.WRITE_ONLY) - private String vendorName; - - /* - * The name of the recommendation's control category - */ - @JsonProperty(value = "properties.control", access = JsonProperty.Access.WRITE_ONLY) - private String control; - - /* - * Manual action items to take to resolve the recommendation - */ - @JsonProperty(value = "properties.remediationSteps", access = JsonProperty.Access.WRITE_ONLY) - private List remediationSteps; - - /* - * The alert's data source - */ - @JsonProperty(value = "properties.dataSource", access = JsonProperty.Access.WRITE_ONLY) - private String dataSource; - - /** - * Get the recommendationDisplayName property: The display name of the recommendation. - * - * @return the recommendationDisplayName value. - */ - public String recommendationDisplayName() { - return this.recommendationDisplayName; - } - - /** - * Get the severity property: The severity of the recommendation. - * - * @return the severity value. - */ - public RecommendationSeverity severity() { - return this.severity; - } - - /** - * Get the description property: Description of the suspected vulnerability and meaning. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the productName property: The name of the product which published this recommendation. - * - * @return the productName value. - */ - public String productName() { - return this.productName; - } - - /** - * Get the productComponentName property: The name of a component inside the product which generated the - * recommendation. - * - * @return the productComponentName value. - */ - public String productComponentName() { - return this.productComponentName; - } - - /** - * Get the vendorName property: The name of the vendor that raised the recommendation. - * - * @return the vendorName value. - */ - public String vendorName() { - return this.vendorName; - } - - /** - * Get the control property: The name of the recommendation's control category. - * - * @return the control value. - */ - public String control() { - return this.control; - } - - /** - * Get the remediationSteps property: Manual action items to take to resolve the recommendation. - * - * @return the remediationSteps value. - */ - public List remediationSteps() { - return this.remediationSteps; - } - - /** - * Get the dataSource property: The alert's data source. - * - * @return the dataSource value. - */ - public String dataSource() { - return this.dataSource; - } - - /** - * 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/IotSensorsModelInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSensorsModelInner.java deleted file mode 100644 index b29eeacb9c94f..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSensorsModelInner.java +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (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.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.SensorStatus; -import com.azure.resourcemanager.security.models.SensorType; -import com.azure.resourcemanager.security.models.TiStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** IoT sensor model. */ -@JsonFlatten -@Fluent -public class IotSensorsModelInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotSensorsModelInner.class); - - /* - * Last connectivity time of the IoT sensor - */ - @JsonProperty(value = "properties.connectivityTime", access = JsonProperty.Access.WRITE_ONLY) - private String connectivityTime; - - /* - * Creation time of the IoT sensor - */ - @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) - private String creationTime; - - /* - * Dynamic mode status of the IoT sensor - */ - @JsonProperty(value = "properties.dynamicLearning", access = JsonProperty.Access.WRITE_ONLY) - private Boolean dynamicLearning; - - /* - * Learning mode status of the IoT sensor - */ - @JsonProperty(value = "properties.learningMode", access = JsonProperty.Access.WRITE_ONLY) - private Boolean learningMode; - - /* - * Status of the IoT sensor - */ - @JsonProperty(value = "properties.sensorStatus", access = JsonProperty.Access.WRITE_ONLY) - private SensorStatus sensorStatus; - - /* - * Version of the IoT sensor - */ - @JsonProperty(value = "properties.sensorVersion", access = JsonProperty.Access.WRITE_ONLY) - private String sensorVersion; - - /* - * TI Automatic mode status of the IoT sensor - */ - @JsonProperty(value = "properties.tiAutomaticUpdates") - private Boolean tiAutomaticUpdates; - - /* - * TI Status of the IoT sensor - */ - @JsonProperty(value = "properties.tiStatus", access = JsonProperty.Access.WRITE_ONLY) - private TiStatus tiStatus; - - /* - * TI Version of the IoT sensor - */ - @JsonProperty(value = "properties.tiVersion", access = JsonProperty.Access.WRITE_ONLY) - private String tiVersion; - - /* - * Zone of the IoT sensor - */ - @JsonProperty(value = "properties.zone") - private String zone; - - /* - * Type of sensor - */ - @JsonProperty(value = "properties.sensorType") - private SensorType sensorType; - - /** - * Get the connectivityTime property: Last connectivity time of the IoT sensor. - * - * @return the connectivityTime value. - */ - public String connectivityTime() { - return this.connectivityTime; - } - - /** - * Get the creationTime property: Creation time of the IoT sensor. - * - * @return the creationTime value. - */ - public String creationTime() { - return this.creationTime; - } - - /** - * Get the dynamicLearning property: Dynamic mode status of the IoT sensor. - * - * @return the dynamicLearning value. - */ - public Boolean dynamicLearning() { - return this.dynamicLearning; - } - - /** - * Get the learningMode property: Learning mode status of the IoT sensor. - * - * @return the learningMode value. - */ - public Boolean learningMode() { - return this.learningMode; - } - - /** - * Get the sensorStatus property: Status of the IoT sensor. - * - * @return the sensorStatus value. - */ - public SensorStatus sensorStatus() { - return this.sensorStatus; - } - - /** - * Get the sensorVersion property: Version of the IoT sensor. - * - * @return the sensorVersion value. - */ - public String sensorVersion() { - return this.sensorVersion; - } - - /** - * Get the tiAutomaticUpdates property: TI Automatic mode status of the IoT sensor. - * - * @return the tiAutomaticUpdates value. - */ - public Boolean tiAutomaticUpdates() { - return this.tiAutomaticUpdates; - } - - /** - * Set the tiAutomaticUpdates property: TI Automatic mode status of the IoT sensor. - * - * @param tiAutomaticUpdates the tiAutomaticUpdates value to set. - * @return the IotSensorsModelInner object itself. - */ - public IotSensorsModelInner withTiAutomaticUpdates(Boolean tiAutomaticUpdates) { - this.tiAutomaticUpdates = tiAutomaticUpdates; - return this; - } - - /** - * Get the tiStatus property: TI Status of the IoT sensor. - * - * @return the tiStatus value. - */ - public TiStatus tiStatus() { - return this.tiStatus; - } - - /** - * Get the tiVersion property: TI Version of the IoT sensor. - * - * @return the tiVersion value. - */ - public String tiVersion() { - return this.tiVersion; - } - - /** - * Get the zone property: Zone of the IoT sensor. - * - * @return the zone value. - */ - public String zone() { - return this.zone; - } - - /** - * Set the zone property: Zone of the IoT sensor. - * - * @param zone the zone value to set. - * @return the IotSensorsModelInner object itself. - */ - public IotSensorsModelInner withZone(String zone) { - this.zone = zone; - return this; - } - - /** - * Get the sensorType property: Type of sensor. - * - * @return the sensorType value. - */ - public SensorType sensorType() { - return this.sensorType; - } - - /** - * Set the sensorType property: Type of sensor. - * - * @param sensorType the sensorType value to set. - * @return the IotSensorsModelInner object itself. - */ - public IotSensorsModelInner withSensorType(SensorType sensorType) { - this.sensorType = sensorType; - 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/IotSitesListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSitesListInner.java deleted file mode 100644 index d2a2937205952..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSitesListInner.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.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of IoT sites. */ -@Immutable -public final class IotSitesListInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotSitesListInner.class); - - /* - * List data - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /** - * Get the value property: List data. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * 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/IotSitesModelInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSitesModelInner.java deleted file mode 100644 index d9b9d727f3d2e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotSitesModelInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** IoT site model. */ -@JsonFlatten -@Fluent -public class IotSitesModelInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotSitesModelInner.class); - - /* - * Display name of the IoT site - */ - @JsonProperty(value = "properties.displayName") - private String displayName; - - /* - * Tags of the IoT site - */ - @JsonProperty(value = "properties.tags") - private Map tags; - - /** - * Get the displayName property: Display name of the IoT site. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Display name of the IoT site. - * - * @param displayName the displayName value to set. - * @return the IotSitesModelInner object itself. - */ - public IotSitesModelInner withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the tags property: Tags of the IoT site. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Tags of the IoT site. - * - * @param tags the tags value to set. - * @return the IotSitesModelInner object itself. - */ - public IotSitesModelInner withTags(Map tags) { - this.tags = tags; - 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/JitNetworkAccessPolicyInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyInner.java index c75297e547f48..29440d858ba86 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyVirtualMachine; @@ -14,28 +13,15 @@ import java.util.List; /** The JitNetworkAccessPolicy model. */ -@JsonFlatten @Fluent -public class JitNetworkAccessPolicyInner extends ProxyResource { +public final class JitNetworkAccessPolicyInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(JitNetworkAccessPolicyInner.class); /* - * Configurations for Microsoft.Compute/virtualMachines resource type. + * The properties property. */ - @JsonProperty(value = "properties.virtualMachines", required = true) - private List virtualMachines; - - /* - * The requests property. - */ - @JsonProperty(value = "properties.requests") - private List requests; - - /* - * Gets the provisioning state of the Just-in-Time policy. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + @JsonProperty(value = "properties", required = true) + private JitNetworkAccessPolicyProperties innerProperties = new JitNetworkAccessPolicyProperties(); /* * Kind of the resource @@ -50,81 +36,96 @@ public class JitNetworkAccessPolicyInner extends ProxyResource { private String location; /** - * Get the virtualMachines property: Configurations for Microsoft.Compute/virtualMachines resource type. + * Get the innerProperties property: The properties property. * - * @return the virtualMachines value. + * @return the innerProperties value. */ - public List virtualMachines() { - return this.virtualMachines; + private JitNetworkAccessPolicyProperties innerProperties() { + return this.innerProperties; } /** - * Set the virtualMachines property: Configurations for Microsoft.Compute/virtualMachines resource type. + * Get the kind property: Kind of the resource. * - * @param virtualMachines the virtualMachines value to set. + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: Kind of the resource. + * + * @param kind the kind value to set. * @return the JitNetworkAccessPolicyInner object itself. */ - public JitNetworkAccessPolicyInner withVirtualMachines(List virtualMachines) { - this.virtualMachines = virtualMachines; + public JitNetworkAccessPolicyInner withKind(String kind) { + this.kind = kind; return this; } /** - * Get the requests property: The requests property. + * Get the location property: Location where the resource is stored. * - * @return the requests value. + * @return the location value. */ - public List requests() { - return this.requests; + public String location() { + return this.location; } /** - * Set the requests property: The requests property. + * Get the virtualMachines property: Configurations for Microsoft.Compute/virtualMachines resource type. * - * @param requests the requests value to set. - * @return the JitNetworkAccessPolicyInner object itself. + * @return the virtualMachines value. */ - public JitNetworkAccessPolicyInner withRequests(List requests) { - this.requests = requests; - return this; + public List virtualMachines() { + return this.innerProperties() == null ? null : this.innerProperties().virtualMachines(); } /** - * Get the provisioningState property: Gets the provisioning state of the Just-in-Time policy. + * Set the virtualMachines property: Configurations for Microsoft.Compute/virtualMachines resource type. * - * @return the provisioningState value. + * @param virtualMachines the virtualMachines value to set. + * @return the JitNetworkAccessPolicyInner object itself. */ - public String provisioningState() { - return this.provisioningState; + public JitNetworkAccessPolicyInner withVirtualMachines(List virtualMachines) { + if (this.innerProperties() == null) { + this.innerProperties = new JitNetworkAccessPolicyProperties(); + } + this.innerProperties().withVirtualMachines(virtualMachines); + return this; } /** - * Get the kind property: Kind of the resource. + * Get the requests property: The requests property. * - * @return the kind value. + * @return the requests value. */ - public String kind() { - return this.kind; + public List requests() { + return this.innerProperties() == null ? null : this.innerProperties().requests(); } /** - * Set the kind property: Kind of the resource. + * Set the requests property: The requests property. * - * @param kind the kind value to set. + * @param requests the requests value to set. * @return the JitNetworkAccessPolicyInner object itself. */ - public JitNetworkAccessPolicyInner withKind(String kind) { - this.kind = kind; + public JitNetworkAccessPolicyInner withRequests(List requests) { + if (this.innerProperties() == null) { + this.innerProperties = new JitNetworkAccessPolicyProperties(); + } + this.innerProperties().withRequests(requests); return this; } /** - * Get the location property: Location where the resource is stored. + * Get the provisioningState property: Gets the provisioning state of the Just-in-Time policy. * - * @return the location value. + * @return the provisioningState value. */ - public String location() { - return this.location; + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -133,16 +134,13 @@ public String location() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (virtualMachines() == null) { + if (innerProperties() == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - "Missing required property virtualMachines in model JitNetworkAccessPolicyInner")); + "Missing required property innerProperties in model JitNetworkAccessPolicyInner")); } else { - virtualMachines().forEach(e -> e.validate()); - } - if (requests() != null) { - requests().forEach(e -> e.validate()); + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyProperties.java new file mode 100644 index 0000000000000..f2e3f0922a40c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyVirtualMachine; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JitNetworkAccessPolicyProperties model. */ +@Fluent +public final class JitNetworkAccessPolicyProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JitNetworkAccessPolicyProperties.class); + + /* + * Configurations for Microsoft.Compute/virtualMachines resource type. + */ + @JsonProperty(value = "virtualMachines", required = true) + private List virtualMachines; + + /* + * The requests property. + */ + @JsonProperty(value = "requests") + private List requests; + + /* + * Gets the provisioning state of the Just-in-Time policy. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the virtualMachines property: Configurations for Microsoft.Compute/virtualMachines resource type. + * + * @return the virtualMachines value. + */ + public List virtualMachines() { + return this.virtualMachines; + } + + /** + * Set the virtualMachines property: Configurations for Microsoft.Compute/virtualMachines resource type. + * + * @param virtualMachines the virtualMachines value to set. + * @return the JitNetworkAccessPolicyProperties object itself. + */ + public JitNetworkAccessPolicyProperties withVirtualMachines( + List virtualMachines) { + this.virtualMachines = virtualMachines; + return this; + } + + /** + * Get the requests property: The requests property. + * + * @return the requests value. + */ + public List requests() { + return this.requests; + } + + /** + * Set the requests property: The requests property. + * + * @param requests the requests value to set. + * @return the JitNetworkAccessPolicyProperties object itself. + */ + public JitNetworkAccessPolicyProperties withRequests(List requests) { + this.requests = requests; + return this; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the Just-in-Time policy. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualMachines() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property virtualMachines in model JitNetworkAccessPolicyProperties")); + } else { + virtualMachines().forEach(e -> e.validate()); + } + if (requests() != null) { + requests().forEach(e -> e.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 new file mode 100644 index 0000000000000..f86dae0740187 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataInner.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource of the configuration or data needed to onboard the machine to MDE. */ +@Fluent +public final class MdeOnboardingDataInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MdeOnboardingDataInner.class); + + /* + * Properties of the MDE configuration or data parameter needed to onboard + * the machine to MDE + */ + @JsonProperty(value = "properties") + private MdeOnboardingDataProperties innerProperties; + + /** + * Get the innerProperties property: Properties of the MDE configuration or data parameter needed to onboard the + * machine to MDE. + * + * @return the innerProperties value. + */ + private MdeOnboardingDataProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the onboardingPackageWindows property: The onboarding package used to onboard Windows machines to MDE, coded + * in base64. This can also be used for onboarding using the dedicated VM Extension. + * + * @return the onboardingPackageWindows value. + */ + public byte[] onboardingPackageWindows() { + return this.innerProperties() == null ? new byte[0] : this.innerProperties().onboardingPackageWindows(); + } + + /** + * Set the onboardingPackageWindows property: The onboarding package used to onboard Windows machines to MDE, coded + * in base64. This can also be used for onboarding using the dedicated VM Extension. + * + * @param onboardingPackageWindows the onboardingPackageWindows value to set. + * @return the MdeOnboardingDataInner object itself. + */ + public MdeOnboardingDataInner withOnboardingPackageWindows(byte[] onboardingPackageWindows) { + if (this.innerProperties() == null) { + this.innerProperties = new MdeOnboardingDataProperties(); + } + this.innerProperties().withOnboardingPackageWindows(onboardingPackageWindows); + return this; + } + + /** + * Get the onboardingPackageLinux property: The onboarding package used to onboard Linux machines to MDE, coded in + * base64. This can also be used for onboarding using the dedicated VM Extension. + * + * @return the onboardingPackageLinux value. + */ + public byte[] onboardingPackageLinux() { + return this.innerProperties() == null ? new byte[0] : this.innerProperties().onboardingPackageLinux(); + } + + /** + * Set the onboardingPackageLinux property: The onboarding package used to onboard Linux machines to MDE, coded in + * base64. This can also be used for onboarding using the dedicated VM Extension. + * + * @param onboardingPackageLinux the onboardingPackageLinux value to set. + * @return the MdeOnboardingDataInner object itself. + */ + public MdeOnboardingDataInner withOnboardingPackageLinux(byte[] onboardingPackageLinux) { + if (this.innerProperties() == null) { + this.innerProperties = new MdeOnboardingDataProperties(); + } + this.innerProperties().withOnboardingPackageLinux(onboardingPackageLinux); + 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/IotRecommendationTypeListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataListInner.java similarity index 58% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotRecommendationTypeListInner.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataListInner.java index 72028c184a28a..3790010f535f8 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IotRecommendationTypeListInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataListInner.java @@ -10,33 +10,34 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of recommendation types. */ +/** List of all MDE onboarding data resources. */ @Fluent -public final class IotRecommendationTypeListInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotRecommendationTypeListInner.class); +public final class MdeOnboardingDataListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MdeOnboardingDataListInner.class); /* - * List data + * List of the resources of the configuration or data needed to onboard the + * machine to MDE */ @JsonProperty(value = "value") - private List value; + private List value; /** - * Get the value property: List data. + * Get the value property: List of the resources of the configuration or data needed to onboard the machine to MDE. * * @return the value value. */ - public List value() { + public List value() { return this.value; } /** - * Set the value property: List data. + * Set the value property: List of the resources of the configuration or data needed to onboard the machine to MDE. * * @param value the value value to set. - * @return the IotRecommendationTypeListInner object itself. + * @return the MdeOnboardingDataListInner object itself. */ - public IotRecommendationTypeListInner withValue(List value) { + public MdeOnboardingDataListInner withValue(List value) { this.value = value; return this; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataProperties.java new file mode 100644 index 0000000000000..f18879c728049 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the MDE configuration or data parameter needed to onboard the machine to MDE. */ +@Fluent +public final class MdeOnboardingDataProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MdeOnboardingDataProperties.class); + + /* + * The onboarding package used to onboard Windows machines to MDE, coded in + * base64. This can also be used for onboarding using the dedicated VM + * Extension + */ + @JsonProperty(value = "onboardingPackageWindows") + private byte[] onboardingPackageWindows; + + /* + * The onboarding package used to onboard Linux machines to MDE, coded in + * base64. This can also be used for onboarding using the dedicated VM + * Extension + */ + @JsonProperty(value = "onboardingPackageLinux") + private byte[] onboardingPackageLinux; + + /** + * Get the onboardingPackageWindows property: The onboarding package used to onboard Windows machines to MDE, coded + * in base64. This can also be used for onboarding using the dedicated VM Extension. + * + * @return the onboardingPackageWindows value. + */ + public byte[] onboardingPackageWindows() { + return CoreUtils.clone(this.onboardingPackageWindows); + } + + /** + * Set the onboardingPackageWindows property: The onboarding package used to onboard Windows machines to MDE, coded + * in base64. This can also be used for onboarding using the dedicated VM Extension. + * + * @param onboardingPackageWindows the onboardingPackageWindows value to set. + * @return the MdeOnboardingDataProperties object itself. + */ + public MdeOnboardingDataProperties withOnboardingPackageWindows(byte[] onboardingPackageWindows) { + this.onboardingPackageWindows = CoreUtils.clone(onboardingPackageWindows); + return this; + } + + /** + * Get the onboardingPackageLinux property: The onboarding package used to onboard Linux machines to MDE, coded in + * base64. This can also be used for onboarding using the dedicated VM Extension. + * + * @return the onboardingPackageLinux value. + */ + public byte[] onboardingPackageLinux() { + return CoreUtils.clone(this.onboardingPackageLinux); + } + + /** + * Set the onboardingPackageLinux property: The onboarding package used to onboard Linux machines to MDE, coded in + * base64. This can also be used for onboarding using the dedicated VM Extension. + * + * @param onboardingPackageLinux the onboardingPackageLinux value to set. + * @return the MdeOnboardingDataProperties object itself. + */ + public MdeOnboardingDataProperties withOnboardingPackageLinux(byte[] onboardingPackageLinux) { + this.onboardingPackageLinux = CoreUtils.clone(onboardingPackageLinux); + 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/OnPremiseIotSensorInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OnPremiseIotSensorInner.java deleted file mode 100644 index fd611d7dcc160..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OnPremiseIotSensorInner.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.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** On-premise IoT sensor. */ -@Fluent -public final class OnPremiseIotSensorInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OnPremiseIotSensorInner.class); - - /* - * On-premise IoT sensor properties - */ - @JsonProperty(value = "properties") - private Object properties; - - /** - * Get the properties property: On-premise IoT sensor properties. - * - * @return the properties value. - */ - public Object properties() { - return this.properties; - } - - /** - * Set the properties property: On-premise IoT sensor properties. - * - * @param properties the properties value to set. - * @return the OnPremiseIotSensorInner object itself. - */ - public OnPremiseIotSensorInner 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/OnPremiseIotSensorsListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OnPremiseIotSensorsListInner.java deleted file mode 100644 index a1b2eae47e53b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OnPremiseIotSensorsListInner.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.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of on-premise IoT sensors. */ -@Immutable -public final class OnPremiseIotSensorsListInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OnPremiseIotSensorsListInner.class); - - /* - * List data - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /** - * Get the value property: List data. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * 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/PackageDownloadsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PackageDownloadsInner.java deleted file mode 100644 index 63aa43ea9fd58..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PackageDownloadsInner.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (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.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.PackageDownloadInfo; -import com.azure.resourcemanager.security.models.PackageDownloadsCentralManager; -import com.azure.resourcemanager.security.models.PackageDownloadsSensor; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Information about package downloads. */ -@Immutable -public final class PackageDownloadsInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PackageDownloadsInner.class); - - /* - * Contains all Sensor binary downloads - */ - @JsonProperty(value = "sensor", access = JsonProperty.Access.WRITE_ONLY) - private PackageDownloadsSensor sensor; - - /* - * All downloads for Central Manager - */ - @JsonProperty(value = "centralManager", access = JsonProperty.Access.WRITE_ONLY) - private PackageDownloadsCentralManager centralManager; - - /* - * All downloads for threat intelligence - */ - @JsonProperty(value = "threatIntelligence", access = JsonProperty.Access.WRITE_ONLY) - private List threatIntelligence; - - /* - * SNMP Server file - */ - @JsonProperty(value = "snmp", access = JsonProperty.Access.WRITE_ONLY) - private List snmp; - - /* - * Used for local configuration export - */ - @JsonProperty(value = "wmiTool", access = JsonProperty.Access.WRITE_ONLY) - private List wmiTool; - - /* - * Authorized devices import template - */ - @JsonProperty(value = "authorizedDevicesImportTemplate", access = JsonProperty.Access.WRITE_ONLY) - private List authorizedDevicesImportTemplate; - - /* - * Authorized devices import template - */ - @JsonProperty(value = "deviceInformationUpdateImportTemplate", access = JsonProperty.Access.WRITE_ONLY) - private List deviceInformationUpdateImportTemplate; - - /** - * Get the sensor property: Contains all Sensor binary downloads. - * - * @return the sensor value. - */ - public PackageDownloadsSensor sensor() { - return this.sensor; - } - - /** - * Get the centralManager property: All downloads for Central Manager. - * - * @return the centralManager value. - */ - public PackageDownloadsCentralManager centralManager() { - return this.centralManager; - } - - /** - * Get the threatIntelligence property: All downloads for threat intelligence. - * - * @return the threatIntelligence value. - */ - public List threatIntelligence() { - return this.threatIntelligence; - } - - /** - * Get the snmp property: SNMP Server file. - * - * @return the snmp value. - */ - public List snmp() { - return this.snmp; - } - - /** - * Get the wmiTool property: Used for local configuration export. - * - * @return the wmiTool value. - */ - public List wmiTool() { - return this.wmiTool; - } - - /** - * Get the authorizedDevicesImportTemplate property: Authorized devices import template. - * - * @return the authorizedDevicesImportTemplate value. - */ - public List authorizedDevicesImportTemplate() { - return this.authorizedDevicesImportTemplate; - } - - /** - * Get the deviceInformationUpdateImportTemplate property: Authorized devices import template. - * - * @return the deviceInformationUpdateImportTemplate value. - */ - public List deviceInformationUpdateImportTemplate() { - return this.deviceInformationUpdateImportTemplate; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sensor() != null) { - sensor().validate(); - } - if (centralManager() != null) { - centralManager().validate(); - } - if (threatIntelligence() != null) { - threatIntelligence().forEach(e -> e.validate()); - } - if (snmp() != null) { - snmp().forEach(e -> e.validate()); - } - if (wmiTool() != null) { - wmiTool().forEach(e -> e.validate()); - } - if (authorizedDevicesImportTemplate() != null) { - authorizedDevicesImportTemplate().forEach(e -> e.validate()); - } - if (deviceInformationUpdateImportTemplate() != null) { - deviceInformationUpdateImportTemplate().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingInner.java index 8549af68dab3b..4308de32eaec4 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.PricingTier; @@ -18,26 +17,24 @@ * trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security * features. */ -@JsonFlatten @Fluent -public class PricingInner extends ProxyResource { +public final class PricingInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PricingInner.class); /* - * The pricing tier value. Azure Security Center is provided in two pricing - * tiers: free and standard, with the standard tier available with a trial - * period. The standard tier offers advanced security capabilities, while - * the free tier offers basic security features. + * Pricing data */ - @JsonProperty(value = "properties.pricingTier") - private PricingTier pricingTier; + @JsonProperty(value = "properties") + private PricingProperties innerProperties; - /* - * The duration left for the subscriptions free trial period - in ISO 8601 - * format (e.g. P3Y6M4DT12H30M5S). + /** + * Get the innerProperties property: Pricing data. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.freeTrialRemainingTime", access = JsonProperty.Access.WRITE_ONLY) - private Duration freeTrialRemainingTime; + private PricingProperties innerProperties() { + return this.innerProperties; + } /** * Get the pricingTier property: The pricing tier value. Azure Security Center is provided in two pricing tiers: @@ -47,7 +44,7 @@ public class PricingInner extends ProxyResource { * @return the pricingTier value. */ public PricingTier pricingTier() { - return this.pricingTier; + return this.innerProperties() == null ? null : this.innerProperties().pricingTier(); } /** @@ -59,7 +56,10 @@ public PricingTier pricingTier() { * @return the PricingInner object itself. */ public PricingInner withPricingTier(PricingTier pricingTier) { - this.pricingTier = pricingTier; + if (this.innerProperties() == null) { + this.innerProperties = new PricingProperties(); + } + this.innerProperties().withPricingTier(pricingTier); return this; } @@ -70,7 +70,7 @@ public PricingInner withPricingTier(PricingTier pricingTier) { * @return the freeTrialRemainingTime value. */ public Duration freeTrialRemainingTime() { - return this.freeTrialRemainingTime; + return this.innerProperties() == null ? null : this.innerProperties().freeTrialRemainingTime(); } /** @@ -79,5 +79,8 @@ public Duration freeTrialRemainingTime() { * @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/PricingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingProperties.java new file mode 100644 index 0000000000000..593d9ee23d595 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.PricingTier; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; + +/** Pricing properties for the relevant scope. */ +@Fluent +public final class PricingProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PricingProperties.class); + + /* + * The pricing tier value. Azure Security Center is provided in two pricing + * tiers: free and standard, with the standard tier available with a trial + * period. The standard tier offers advanced security capabilities, while + * the free tier offers basic security features. + */ + @JsonProperty(value = "pricingTier", required = true) + private PricingTier pricingTier; + + /* + * The duration left for the subscriptions free trial period - in ISO 8601 + * format (e.g. P3Y6M4DT12H30M5S). + */ + @JsonProperty(value = "freeTrialRemainingTime", access = JsonProperty.Access.WRITE_ONLY) + private Duration freeTrialRemainingTime; + + /** + * Get the pricingTier property: The pricing tier value. Azure Security Center is provided in two pricing tiers: + * free and standard, with the standard tier available with a trial period. The standard tier offers advanced + * security capabilities, while the free tier offers basic security features. + * + * @return the pricingTier value. + */ + public PricingTier pricingTier() { + return this.pricingTier; + } + + /** + * Set the pricingTier property: The pricing tier value. Azure Security Center is provided in two pricing tiers: + * free and standard, with the standard tier available with a trial period. The standard tier offers advanced + * security capabilities, while the free tier offers basic security features. + * + * @param pricingTier the pricingTier value to set. + * @return the PricingProperties object itself. + */ + public PricingProperties withPricingTier(PricingTier pricingTier) { + this.pricingTier = pricingTier; + return this; + } + + /** + * Get the freeTrialRemainingTime property: The duration left for the subscriptions free trial period - in ISO 8601 + * format (e.g. P3Y6M4DT12H30M5S). + * + * @return the freeTrialRemainingTime value. + */ + public Duration freeTrialRemainingTime() { + return this.freeTrialRemainingTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (pricingTier() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property pricingTier in model PricingProperties")); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentInner.java index b0907822e9530..6ba89c9e9d717 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.State; @@ -13,59 +12,24 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** Regulatory compliance assessment details and state. */ -@JsonFlatten @Fluent -public class RegulatoryComplianceAssessmentInner extends ProxyResource { +public final class RegulatoryComplianceAssessmentInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(RegulatoryComplianceAssessmentInner.class); /* - * The description of the regulatory compliance assessment + * Regulatory compliance assessment data */ - @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) - private String description; + @JsonProperty(value = "properties") + private RegulatoryComplianceAssessmentProperties innerProperties; - /* - * The expected type of assessment contained in the AssessmentDetailsLink - */ - @JsonProperty(value = "properties.assessmentType", access = JsonProperty.Access.WRITE_ONLY) - private String assessmentType; - - /* - * Link to more detailed assessment results data. The response type will be - * according to the assessmentType field - */ - @JsonProperty(value = "properties.assessmentDetailsLink", access = JsonProperty.Access.WRITE_ONLY) - private String assessmentDetailsLink; - - /* - * Aggregative state based on the assessment's scanned resources states - */ - @JsonProperty(value = "properties.state") - private State state; - - /* - * The given assessment's related resources count with passed state. - */ - @JsonProperty(value = "properties.passedResources", access = JsonProperty.Access.WRITE_ONLY) - private Integer passedResources; - - /* - * The given assessment's related resources count with failed state. - */ - @JsonProperty(value = "properties.failedResources", access = JsonProperty.Access.WRITE_ONLY) - private Integer failedResources; - - /* - * The given assessment's related resources count with skipped state. - */ - @JsonProperty(value = "properties.skippedResources", access = JsonProperty.Access.WRITE_ONLY) - private Integer skippedResources; - - /* - * The given assessment's related resources count with unsupported state. + /** + * Get the innerProperties property: Regulatory compliance assessment data. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.unsupportedResources", access = JsonProperty.Access.WRITE_ONLY) - private Integer unsupportedResources; + private RegulatoryComplianceAssessmentProperties innerProperties() { + return this.innerProperties; + } /** * Get the description property: The description of the regulatory compliance assessment. @@ -73,7 +37,7 @@ public class RegulatoryComplianceAssessmentInner extends ProxyResource { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -82,7 +46,7 @@ public String description() { * @return the assessmentType value. */ public String assessmentType() { - return this.assessmentType; + return this.innerProperties() == null ? null : this.innerProperties().assessmentType(); } /** @@ -92,7 +56,7 @@ public String assessmentType() { * @return the assessmentDetailsLink value. */ public String assessmentDetailsLink() { - return this.assessmentDetailsLink; + return this.innerProperties() == null ? null : this.innerProperties().assessmentDetailsLink(); } /** @@ -101,7 +65,7 @@ public String assessmentDetailsLink() { * @return the state value. */ public State state() { - return this.state; + return this.innerProperties() == null ? null : this.innerProperties().state(); } /** @@ -111,7 +75,10 @@ public State state() { * @return the RegulatoryComplianceAssessmentInner object itself. */ public RegulatoryComplianceAssessmentInner withState(State state) { - this.state = state; + if (this.innerProperties() == null) { + this.innerProperties = new RegulatoryComplianceAssessmentProperties(); + } + this.innerProperties().withState(state); return this; } @@ -121,7 +88,7 @@ public RegulatoryComplianceAssessmentInner withState(State state) { * @return the passedResources value. */ public Integer passedResources() { - return this.passedResources; + return this.innerProperties() == null ? null : this.innerProperties().passedResources(); } /** @@ -130,7 +97,7 @@ public Integer passedResources() { * @return the failedResources value. */ public Integer failedResources() { - return this.failedResources; + return this.innerProperties() == null ? null : this.innerProperties().failedResources(); } /** @@ -139,7 +106,7 @@ public Integer failedResources() { * @return the skippedResources value. */ public Integer skippedResources() { - return this.skippedResources; + return this.innerProperties() == null ? null : this.innerProperties().skippedResources(); } /** @@ -148,7 +115,7 @@ public Integer skippedResources() { * @return the unsupportedResources value. */ public Integer unsupportedResources() { - return this.unsupportedResources; + return this.innerProperties() == null ? null : this.innerProperties().unsupportedResources(); } /** @@ -157,5 +124,8 @@ public Integer unsupportedResources() { * @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/RegulatoryComplianceAssessmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentProperties.java new file mode 100644 index 0000000000000..79a51a882d389 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentProperties.java @@ -0,0 +1,158 @@ +// Copyright (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.State; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Regulatory compliance assessment data. */ +@Fluent +public final class RegulatoryComplianceAssessmentProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegulatoryComplianceAssessmentProperties.class); + + /* + * The description of the regulatory compliance assessment + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The expected type of assessment contained in the AssessmentDetailsLink + */ + @JsonProperty(value = "assessmentType", access = JsonProperty.Access.WRITE_ONLY) + private String assessmentType; + + /* + * Link to more detailed assessment results data. The response type will be + * according to the assessmentType field + */ + @JsonProperty(value = "assessmentDetailsLink", access = JsonProperty.Access.WRITE_ONLY) + private String assessmentDetailsLink; + + /* + * Aggregative state based on the assessment's scanned resources states + */ + @JsonProperty(value = "state") + private State state; + + /* + * The given assessment's related resources count with passed state. + */ + @JsonProperty(value = "passedResources", access = JsonProperty.Access.WRITE_ONLY) + private Integer passedResources; + + /* + * The given assessment's related resources count with failed state. + */ + @JsonProperty(value = "failedResources", access = JsonProperty.Access.WRITE_ONLY) + private Integer failedResources; + + /* + * The given assessment's related resources count with skipped state. + */ + @JsonProperty(value = "skippedResources", access = JsonProperty.Access.WRITE_ONLY) + private Integer skippedResources; + + /* + * The given assessment's related resources count with unsupported state. + */ + @JsonProperty(value = "unsupportedResources", access = JsonProperty.Access.WRITE_ONLY) + private Integer unsupportedResources; + + /** + * Get the description property: The description of the regulatory compliance assessment. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the assessmentType property: The expected type of assessment contained in the AssessmentDetailsLink. + * + * @return the assessmentType value. + */ + public String assessmentType() { + return this.assessmentType; + } + + /** + * Get the assessmentDetailsLink property: Link to more detailed assessment results data. The response type will be + * according to the assessmentType field. + * + * @return the assessmentDetailsLink value. + */ + public String assessmentDetailsLink() { + return this.assessmentDetailsLink; + } + + /** + * Get the state property: Aggregative state based on the assessment's scanned resources states. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Set the state property: Aggregative state based on the assessment's scanned resources states. + * + * @param state the state value to set. + * @return the RegulatoryComplianceAssessmentProperties object itself. + */ + public RegulatoryComplianceAssessmentProperties withState(State state) { + this.state = state; + return this; + } + + /** + * Get the passedResources property: The given assessment's related resources count with passed state. + * + * @return the passedResources value. + */ + public Integer passedResources() { + return this.passedResources; + } + + /** + * Get the failedResources property: The given assessment's related resources count with failed state. + * + * @return the failedResources value. + */ + public Integer failedResources() { + return this.failedResources; + } + + /** + * Get the skippedResources property: The given assessment's related resources count with skipped state. + * + * @return the skippedResources value. + */ + public Integer skippedResources() { + return this.skippedResources; + } + + /** + * Get the unsupportedResources property: The given assessment's related resources count with unsupported state. + * + * @return the unsupportedResources value. + */ + public Integer unsupportedResources() { + return this.unsupportedResources; + } + + /** + * 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/RegulatoryComplianceControlInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlInner.java index 2b4b62b951606..2866d14cce93b 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.State; @@ -13,43 +12,24 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** Regulatory compliance control details and state. */ -@JsonFlatten @Fluent -public class RegulatoryComplianceControlInner extends ProxyResource { +public final class RegulatoryComplianceControlInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(RegulatoryComplianceControlInner.class); /* - * The description of the regulatory compliance control + * Regulatory compliance control data */ - @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) - private String description; + @JsonProperty(value = "properties") + private RegulatoryComplianceControlProperties innerProperties; - /* - * Aggregative state based on the control's supported assessments states - */ - @JsonProperty(value = "properties.state") - private State state; - - /* - * The number of supported regulatory compliance assessments of the given - * control with a passed state - */ - @JsonProperty(value = "properties.passedAssessments", access = JsonProperty.Access.WRITE_ONLY) - private Integer passedAssessments; - - /* - * The number of supported regulatory compliance assessments of the given - * control with a failed state - */ - @JsonProperty(value = "properties.failedAssessments", access = JsonProperty.Access.WRITE_ONLY) - private Integer failedAssessments; - - /* - * The number of supported regulatory compliance assessments of the given - * control with a skipped state + /** + * Get the innerProperties property: Regulatory compliance control data. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.skippedAssessments", access = JsonProperty.Access.WRITE_ONLY) - private Integer skippedAssessments; + private RegulatoryComplianceControlProperties innerProperties() { + return this.innerProperties; + } /** * Get the description property: The description of the regulatory compliance control. @@ -57,7 +37,7 @@ public class RegulatoryComplianceControlInner extends ProxyResource { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -66,7 +46,7 @@ public String description() { * @return the state value. */ public State state() { - return this.state; + return this.innerProperties() == null ? null : this.innerProperties().state(); } /** @@ -76,7 +56,10 @@ public State state() { * @return the RegulatoryComplianceControlInner object itself. */ public RegulatoryComplianceControlInner withState(State state) { - this.state = state; + if (this.innerProperties() == null) { + this.innerProperties = new RegulatoryComplianceControlProperties(); + } + this.innerProperties().withState(state); return this; } @@ -87,7 +70,7 @@ public RegulatoryComplianceControlInner withState(State state) { * @return the passedAssessments value. */ public Integer passedAssessments() { - return this.passedAssessments; + return this.innerProperties() == null ? null : this.innerProperties().passedAssessments(); } /** @@ -97,7 +80,7 @@ public Integer passedAssessments() { * @return the failedAssessments value. */ public Integer failedAssessments() { - return this.failedAssessments; + return this.innerProperties() == null ? null : this.innerProperties().failedAssessments(); } /** @@ -107,7 +90,7 @@ public Integer failedAssessments() { * @return the skippedAssessments value. */ public Integer skippedAssessments() { - return this.skippedAssessments; + return this.innerProperties() == null ? null : this.innerProperties().skippedAssessments(); } /** @@ -116,5 +99,8 @@ public Integer skippedAssessments() { * @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/RegulatoryComplianceControlProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlProperties.java new file mode 100644 index 0000000000000..c3627695956b1 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlProperties.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.State; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Regulatory compliance control data. */ +@Fluent +public final class RegulatoryComplianceControlProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegulatoryComplianceControlProperties.class); + + /* + * The description of the regulatory compliance control + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * Aggregative state based on the control's supported assessments states + */ + @JsonProperty(value = "state") + private State state; + + /* + * The number of supported regulatory compliance assessments of the given + * control with a passed state + */ + @JsonProperty(value = "passedAssessments", access = JsonProperty.Access.WRITE_ONLY) + private Integer passedAssessments; + + /* + * The number of supported regulatory compliance assessments of the given + * control with a failed state + */ + @JsonProperty(value = "failedAssessments", access = JsonProperty.Access.WRITE_ONLY) + private Integer failedAssessments; + + /* + * The number of supported regulatory compliance assessments of the given + * control with a skipped state + */ + @JsonProperty(value = "skippedAssessments", access = JsonProperty.Access.WRITE_ONLY) + private Integer skippedAssessments; + + /** + * Get the description property: The description of the regulatory compliance control. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the state property: Aggregative state based on the control's supported assessments states. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Set the state property: Aggregative state based on the control's supported assessments states. + * + * @param state the state value to set. + * @return the RegulatoryComplianceControlProperties object itself. + */ + public RegulatoryComplianceControlProperties withState(State state) { + this.state = state; + return this; + } + + /** + * Get the passedAssessments property: The number of supported regulatory compliance assessments of the given + * control with a passed state. + * + * @return the passedAssessments value. + */ + public Integer passedAssessments() { + return this.passedAssessments; + } + + /** + * Get the failedAssessments property: The number of supported regulatory compliance assessments of the given + * control with a failed state. + * + * @return the failedAssessments value. + */ + public Integer failedAssessments() { + return this.failedAssessments; + } + + /** + * Get the skippedAssessments property: The number of supported regulatory compliance assessments of the given + * control with a skipped state. + * + * @return the skippedAssessments value. + */ + public Integer skippedAssessments() { + return this.skippedAssessments; + } + + /** + * 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/RegulatoryComplianceStandardInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardInner.java index 4915169a0ebfa..5a1386e02dfa2 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.State; @@ -13,44 +12,24 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** Regulatory compliance standard details and state. */ -@JsonFlatten @Fluent -public class RegulatoryComplianceStandardInner extends ProxyResource { +public final class RegulatoryComplianceStandardInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(RegulatoryComplianceStandardInner.class); /* - * Aggregative state based on the standard's supported controls states + * Regulatory compliance standard data */ - @JsonProperty(value = "properties.state") - private State state; + @JsonProperty(value = "properties") + private RegulatoryComplianceStandardProperties innerProperties; - /* - * The number of supported regulatory compliance controls of the given - * standard with a passed state - */ - @JsonProperty(value = "properties.passedControls", access = JsonProperty.Access.WRITE_ONLY) - private Integer passedControls; - - /* - * The number of supported regulatory compliance controls of the given - * standard with a failed state - */ - @JsonProperty(value = "properties.failedControls", access = JsonProperty.Access.WRITE_ONLY) - private Integer failedControls; - - /* - * The number of supported regulatory compliance controls of the given - * standard with a skipped state - */ - @JsonProperty(value = "properties.skippedControls", access = JsonProperty.Access.WRITE_ONLY) - private Integer skippedControls; - - /* - * The number of regulatory compliance controls of the given standard which - * are unsupported by automated assessments + /** + * Get the innerProperties property: Regulatory compliance standard data. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.unsupportedControls", access = JsonProperty.Access.WRITE_ONLY) - private Integer unsupportedControls; + private RegulatoryComplianceStandardProperties innerProperties() { + return this.innerProperties; + } /** * Get the state property: Aggregative state based on the standard's supported controls states. @@ -58,7 +37,7 @@ public class RegulatoryComplianceStandardInner extends ProxyResource { * @return the state value. */ public State state() { - return this.state; + return this.innerProperties() == null ? null : this.innerProperties().state(); } /** @@ -68,7 +47,10 @@ public State state() { * @return the RegulatoryComplianceStandardInner object itself. */ public RegulatoryComplianceStandardInner withState(State state) { - this.state = state; + if (this.innerProperties() == null) { + this.innerProperties = new RegulatoryComplianceStandardProperties(); + } + this.innerProperties().withState(state); return this; } @@ -79,7 +61,7 @@ public RegulatoryComplianceStandardInner withState(State state) { * @return the passedControls value. */ public Integer passedControls() { - return this.passedControls; + return this.innerProperties() == null ? null : this.innerProperties().passedControls(); } /** @@ -89,7 +71,7 @@ public Integer passedControls() { * @return the failedControls value. */ public Integer failedControls() { - return this.failedControls; + return this.innerProperties() == null ? null : this.innerProperties().failedControls(); } /** @@ -99,7 +81,7 @@ public Integer failedControls() { * @return the skippedControls value. */ public Integer skippedControls() { - return this.skippedControls; + return this.innerProperties() == null ? null : this.innerProperties().skippedControls(); } /** @@ -109,7 +91,7 @@ public Integer skippedControls() { * @return the unsupportedControls value. */ public Integer unsupportedControls() { - return this.unsupportedControls; + return this.innerProperties() == null ? null : this.innerProperties().unsupportedControls(); } /** @@ -118,5 +100,8 @@ public Integer unsupportedControls() { * @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/RegulatoryComplianceStandardProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardProperties.java new file mode 100644 index 0000000000000..0085f6cfdd889 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardProperties.java @@ -0,0 +1,119 @@ +// Copyright (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.State; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Regulatory compliance standard data. */ +@Fluent +public final class RegulatoryComplianceStandardProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegulatoryComplianceStandardProperties.class); + + /* + * Aggregative state based on the standard's supported controls states + */ + @JsonProperty(value = "state") + private State state; + + /* + * The number of supported regulatory compliance controls of the given + * standard with a passed state + */ + @JsonProperty(value = "passedControls", access = JsonProperty.Access.WRITE_ONLY) + private Integer passedControls; + + /* + * The number of supported regulatory compliance controls of the given + * standard with a failed state + */ + @JsonProperty(value = "failedControls", access = JsonProperty.Access.WRITE_ONLY) + private Integer failedControls; + + /* + * The number of supported regulatory compliance controls of the given + * standard with a skipped state + */ + @JsonProperty(value = "skippedControls", access = JsonProperty.Access.WRITE_ONLY) + private Integer skippedControls; + + /* + * The number of regulatory compliance controls of the given standard which + * are unsupported by automated assessments + */ + @JsonProperty(value = "unsupportedControls", access = JsonProperty.Access.WRITE_ONLY) + private Integer unsupportedControls; + + /** + * Get the state property: Aggregative state based on the standard's supported controls states. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Set the state property: Aggregative state based on the standard's supported controls states. + * + * @param state the state value to set. + * @return the RegulatoryComplianceStandardProperties object itself. + */ + public RegulatoryComplianceStandardProperties withState(State state) { + this.state = state; + return this; + } + + /** + * Get the passedControls property: The number of supported regulatory compliance controls of the given standard + * with a passed state. + * + * @return the passedControls value. + */ + public Integer passedControls() { + return this.passedControls; + } + + /** + * Get the failedControls property: The number of supported regulatory compliance controls of the given standard + * with a failed state. + * + * @return the failedControls value. + */ + public Integer failedControls() { + return this.failedControls; + } + + /** + * Get the skippedControls property: The number of supported regulatory compliance controls of the given standard + * with a skipped state. + * + * @return the skippedControls value. + */ + public Integer skippedControls() { + return this.skippedControls; + } + + /** + * Get the unsupportedControls property: The number of regulatory compliance controls of the given standard which + * are unsupported by automated assessments. + * + * @return the unsupportedControls value. + */ + public Integer unsupportedControls() { + return this.unsupportedControls; + } + + /** + * 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/ScoreDetails.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScoreDetails.java new file mode 100644 index 0000000000000..4734cc80a4297 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScoreDetails.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Calculation result data. */ +@Immutable +public final class ScoreDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScoreDetails.class); + + /* + * Maximum score available + */ + @JsonProperty(value = "max", access = JsonProperty.Access.WRITE_ONLY) + private Integer max; + + /* + * Current score + */ + @JsonProperty(value = "current", access = JsonProperty.Access.WRITE_ONLY) + private Double current; + + /* + * Ratio of the current score divided by the maximum. Rounded to 4 digits + * after the decimal point + */ + @JsonProperty(value = "percentage", access = JsonProperty.Access.WRITE_ONLY) + private Double percentage; + + /** + * Get the max property: Maximum score available. + * + * @return the max value. + */ + public Integer max() { + return this.max; + } + + /** + * Get the current property: Current score. + * + * @return the current value. + */ + public Double current() { + return this.current; + } + + /** + * Get the percentage property: Ratio of the current score divided by the maximum. Rounded to 4 digits after the + * decimal point. + * + * @return the percentage value. + */ + public Double percentage() { + return this.percentage; + } + + /** + * 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/SecureScoreControlDefinitionItemInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemInner.java index a4c873eeb2d09..af5ce23394be4 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemInner.java @@ -4,8 +4,7 @@ package com.azure.resourcemanager.security.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.AzureResourceLink; @@ -15,41 +14,24 @@ import java.util.List; /** Information about the security control. */ -@JsonFlatten -@Immutable -public class SecureScoreControlDefinitionItemInner extends ProxyResource { +@Fluent +public final class SecureScoreControlDefinitionItemInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(SecureScoreControlDefinitionItemInner.class); /* - * User friendly display name of the control + * Security Control Definition Properties. */ - @JsonProperty(value = "properties.displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; + @JsonProperty(value = "properties") + private SecureScoreControlDefinitionItemProperties innerProperties; - /* - * User friendly description of the control - */ - @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * Maximum control score (0..10) - */ - @JsonProperty(value = "properties.maxScore", access = JsonProperty.Access.WRITE_ONLY) - private Integer maxScore; - - /* - * Source object from which the control was created - */ - @JsonProperty(value = "properties.source", access = JsonProperty.Access.WRITE_ONLY) - private SecureScoreControlDefinitionSource source; - - /* - * Array of assessments metadata IDs that are included in this security - * control + /** + * Get the innerProperties property: Security Control Definition Properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.assessmentDefinitions", access = JsonProperty.Access.WRITE_ONLY) - private List assessmentDefinitions; + private SecureScoreControlDefinitionItemProperties innerProperties() { + return this.innerProperties; + } /** * Get the displayName property: User friendly display name of the control. @@ -57,7 +39,7 @@ public class SecureScoreControlDefinitionItemInner extends ProxyResource { * @return the displayName value. */ public String displayName() { - return this.displayName; + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** @@ -66,7 +48,7 @@ public String displayName() { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -75,7 +57,7 @@ public String description() { * @return the maxScore value. */ public Integer maxScore() { - return this.maxScore; + return this.innerProperties() == null ? null : this.innerProperties().maxScore(); } /** @@ -84,7 +66,7 @@ public Integer maxScore() { * @return the source value. */ public SecureScoreControlDefinitionSource source() { - return this.source; + return this.innerProperties() == null ? null : this.innerProperties().source(); } /** @@ -94,7 +76,7 @@ public SecureScoreControlDefinitionSource source() { * @return the assessmentDefinitions value. */ public List assessmentDefinitions() { - return this.assessmentDefinitions; + return this.innerProperties() == null ? null : this.innerProperties().assessmentDefinitions(); } /** @@ -103,11 +85,8 @@ public List assessmentDefinitions() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (source() != null) { - source().validate(); - } - if (assessmentDefinitions() != null) { - assessmentDefinitions().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemProperties.java new file mode 100644 index 0000000000000..14df96c2182de --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemProperties.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.AzureResourceLink; +import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionSource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Security Control Definition Properties. */ +@Immutable +public final class SecureScoreControlDefinitionItemProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecureScoreControlDefinitionItemProperties.class); + + /* + * User friendly display name of the control + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * User friendly description of the control + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * Maximum control score (0..10) + */ + @JsonProperty(value = "maxScore", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxScore; + + /* + * Source object from which the control was created + */ + @JsonProperty(value = "source", access = JsonProperty.Access.WRITE_ONLY) + private SecureScoreControlDefinitionSource source; + + /* + * Array of assessments metadata IDs that are included in this security + * control + */ + @JsonProperty(value = "assessmentDefinitions", access = JsonProperty.Access.WRITE_ONLY) + private List assessmentDefinitions; + + /** + * Get the displayName property: User friendly display name of the control. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the description property: User friendly description of the control. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the maxScore property: Maximum control score (0..10). + * + * @return the maxScore value. + */ + public Integer maxScore() { + return this.maxScore; + } + + /** + * Get the source property: Source object from which the control was created. + * + * @return the source value. + */ + public SecureScoreControlDefinitionSource source() { + return this.source; + } + + /** + * Get the assessmentDefinitions property: Array of assessments metadata IDs that are included in this security + * control. + * + * @return the assessmentDefinitions value. + */ + public List assessmentDefinitions() { + return this.assessmentDefinitions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() != null) { + source().validate(); + } + if (assessmentDefinitions() != null) { + assessmentDefinitions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDetailsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDetailsInner.java index d824307e25815..83a789c0ff1c0 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDetailsInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDetailsInner.java @@ -5,74 +5,30 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Details of the security control, its score, and the health status of the relevant resources. */ -@JsonFlatten @Fluent -public class SecureScoreControlDetailsInner extends ProxyResource { +public final class SecureScoreControlDetailsInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(SecureScoreControlDetailsInner.class); /* - * User friendly display name of the control + * Calculation result data in control level */ - @JsonProperty(value = "properties.displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; + @JsonProperty(value = "properties") + private SecureScoreControlScoreDetailsInner innerProperties; - /* - * Number of healthy resources in the control - */ - @JsonProperty(value = "properties.healthyResourceCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer healthyResourceCount; - - /* - * Number of unhealthy resources in the control - */ - @JsonProperty(value = "properties.unhealthyResourceCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer unhealthyResourceCount; - - /* - * Number of not applicable resources in the control - */ - @JsonProperty(value = "properties.notApplicableResourceCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer notApplicableResourceCount; - - /* - * The relative weight for this specific control in each of your - * subscriptions. Used when calculating an aggregated score for this - * control across all of your subscriptions. - */ - @JsonProperty(value = "properties.weight", access = JsonProperty.Access.WRITE_ONLY) - private Long weight; - - /* - * Information about the security control. - */ - @JsonProperty(value = "properties.definition") - private SecureScoreControlDefinitionItemInner definition; - - /* - * Maximum score available - */ - @JsonProperty(value = "properties.score.max", access = JsonProperty.Access.WRITE_ONLY) - private Integer max; - - /* - * Current score - */ - @JsonProperty(value = "properties.score.current", access = JsonProperty.Access.WRITE_ONLY) - private Double current; - - /* - * Ratio of the current score divided by the maximum. Rounded to 4 digits - * after the decimal point + /** + * Get the innerProperties property: Calculation result data in control level. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.score.percentage", access = JsonProperty.Access.WRITE_ONLY) - private Double percentage; + private SecureScoreControlScoreDetailsInner innerProperties() { + return this.innerProperties; + } /** * Get the displayName property: User friendly display name of the control. @@ -80,7 +36,7 @@ public class SecureScoreControlDetailsInner extends ProxyResource { * @return the displayName value. */ public String displayName() { - return this.displayName; + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** @@ -89,7 +45,7 @@ public String displayName() { * @return the healthyResourceCount value. */ public Integer healthyResourceCount() { - return this.healthyResourceCount; + return this.innerProperties() == null ? null : this.innerProperties().healthyResourceCount(); } /** @@ -98,7 +54,7 @@ public Integer healthyResourceCount() { * @return the unhealthyResourceCount value. */ public Integer unhealthyResourceCount() { - return this.unhealthyResourceCount; + return this.innerProperties() == null ? null : this.innerProperties().unhealthyResourceCount(); } /** @@ -107,7 +63,7 @@ public Integer unhealthyResourceCount() { * @return the notApplicableResourceCount value. */ public Integer notApplicableResourceCount() { - return this.notApplicableResourceCount; + return this.innerProperties() == null ? null : this.innerProperties().notApplicableResourceCount(); } /** @@ -117,7 +73,7 @@ public Integer notApplicableResourceCount() { * @return the weight value. */ public Long weight() { - return this.weight; + return this.innerProperties() == null ? null : this.innerProperties().weight(); } /** @@ -126,7 +82,7 @@ public Long weight() { * @return the definition value. */ public SecureScoreControlDefinitionItemInner definition() { - return this.definition; + return this.innerProperties() == null ? null : this.innerProperties().definition(); } /** @@ -136,7 +92,10 @@ public SecureScoreControlDefinitionItemInner definition() { * @return the SecureScoreControlDetailsInner object itself. */ public SecureScoreControlDetailsInner withDefinition(SecureScoreControlDefinitionItemInner definition) { - this.definition = definition; + if (this.innerProperties() == null) { + this.innerProperties = new SecureScoreControlScoreDetailsInner(); + } + this.innerProperties().withDefinition(definition); return this; } @@ -146,7 +105,7 @@ public SecureScoreControlDetailsInner withDefinition(SecureScoreControlDefinitio * @return the max value. */ public Integer max() { - return this.max; + return this.innerProperties() == null ? null : this.innerProperties().max(); } /** @@ -155,7 +114,7 @@ public Integer max() { * @return the current value. */ public Double current() { - return this.current; + return this.innerProperties() == null ? null : this.innerProperties().current(); } /** @@ -165,7 +124,7 @@ public Double current() { * @return the percentage value. */ public Double percentage() { - return this.percentage; + return this.innerProperties() == null ? null : this.innerProperties().percentage(); } /** @@ -174,8 +133,8 @@ public Double percentage() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (definition() != null) { - definition().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlScoreDetailsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlScoreDetailsInner.java new file mode 100644 index 0000000000000..3bc81f385728a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlScoreDetailsInner.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Calculation result data in control level. */ +@Fluent +public final class SecureScoreControlScoreDetailsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecureScoreControlScoreDetailsInner.class); + + /* + * User friendly display name of the control + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * Actual score object for the control + */ + @JsonProperty(value = "score", access = JsonProperty.Access.WRITE_ONLY) + private ScoreDetails innerScore; + + /* + * Number of healthy resources in the control + */ + @JsonProperty(value = "healthyResourceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer healthyResourceCount; + + /* + * Number of unhealthy resources in the control + */ + @JsonProperty(value = "unhealthyResourceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer unhealthyResourceCount; + + /* + * Number of not applicable resources in the control + */ + @JsonProperty(value = "notApplicableResourceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer notApplicableResourceCount; + + /* + * The relative weight for this specific control in each of your + * subscriptions. Used when calculating an aggregated score for this + * control across all of your subscriptions. + */ + @JsonProperty(value = "weight", access = JsonProperty.Access.WRITE_ONLY) + private Long weight; + + /* + * Information about the security control. + */ + @JsonProperty(value = "definition") + private SecureScoreControlDefinitionItemInner definition; + + /** + * Get the displayName property: User friendly display name of the control. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the innerScore property: Actual score object for the control. + * + * @return the innerScore value. + */ + private ScoreDetails innerScore() { + return this.innerScore; + } + + /** + * Get the healthyResourceCount property: Number of healthy resources in the control. + * + * @return the healthyResourceCount value. + */ + public Integer healthyResourceCount() { + return this.healthyResourceCount; + } + + /** + * Get the unhealthyResourceCount property: Number of unhealthy resources in the control. + * + * @return the unhealthyResourceCount value. + */ + public Integer unhealthyResourceCount() { + return this.unhealthyResourceCount; + } + + /** + * Get the notApplicableResourceCount property: Number of not applicable resources in the control. + * + * @return the notApplicableResourceCount value. + */ + public Integer notApplicableResourceCount() { + return this.notApplicableResourceCount; + } + + /** + * Get the weight property: The relative weight for this specific control in each of your subscriptions. Used when + * calculating an aggregated score for this control across all of your subscriptions. + * + * @return the weight value. + */ + public Long weight() { + return this.weight; + } + + /** + * Get the definition property: Information about the security control. + * + * @return the definition value. + */ + public SecureScoreControlDefinitionItemInner definition() { + return this.definition; + } + + /** + * Set the definition property: Information about the security control. + * + * @param definition the definition value to set. + * @return the SecureScoreControlScoreDetailsInner object itself. + */ + public SecureScoreControlScoreDetailsInner withDefinition(SecureScoreControlDefinitionItemInner definition) { + this.definition = definition; + return this; + } + + /** + * Get the max property: Maximum score available. + * + * @return the max value. + */ + public Integer max() { + return this.innerScore() == null ? null : this.innerScore().max(); + } + + /** + * Get the current property: Current score. + * + * @return the current value. + */ + public Double current() { + return this.innerScore() == null ? null : this.innerScore().current(); + } + + /** + * Get the percentage property: Ratio of the current score divided by the maximum. Rounded to 4 digits after the + * decimal point. + * + * @return the percentage value. + */ + public Double percentage() { + return this.innerScore() == null ? null : this.innerScore().percentage(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerScore() != null) { + innerScore().validate(); + } + if (definition() != null) { + definition().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemInner.java index 281540025b539..c975193b8ae38 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemInner.java @@ -5,49 +5,30 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Secure score item data model. */ -@JsonFlatten @Immutable -public class SecureScoreItemInner extends ProxyResource { +public final class SecureScoreItemInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(SecureScoreItemInner.class); /* - * The initiative’s name + * Secure score item */ - @JsonProperty(value = "properties.displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private SecureScoreItemProperties innerProperties; - /* - * The relative weight for each subscription. Used when calculating an - * aggregated secure score for multiple subscriptions. - */ - @JsonProperty(value = "properties.weight", access = JsonProperty.Access.WRITE_ONLY) - private Long weight; - - /* - * Maximum score available - */ - @JsonProperty(value = "properties.score.max", access = JsonProperty.Access.WRITE_ONLY) - private Integer max; - - /* - * Current score - */ - @JsonProperty(value = "properties.score.current", access = JsonProperty.Access.WRITE_ONLY) - private Double current; - - /* - * Ratio of the current score divided by the maximum. Rounded to 4 digits - * after the decimal point + /** + * Get the innerProperties property: Secure score item. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.score.percentage", access = JsonProperty.Access.WRITE_ONLY) - private Double percentage; + private SecureScoreItemProperties innerProperties() { + return this.innerProperties; + } /** * Get the displayName property: The initiative’s name. @@ -55,7 +36,7 @@ public class SecureScoreItemInner extends ProxyResource { * @return the displayName value. */ public String displayName() { - return this.displayName; + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** @@ -65,7 +46,7 @@ public String displayName() { * @return the weight value. */ public Long weight() { - return this.weight; + return this.innerProperties() == null ? null : this.innerProperties().weight(); } /** @@ -74,7 +55,7 @@ public Long weight() { * @return the max value. */ public Integer max() { - return this.max; + return this.innerProperties() == null ? null : this.innerProperties().max(); } /** @@ -83,7 +64,7 @@ public Integer max() { * @return the current value. */ public Double current() { - return this.current; + return this.innerProperties() == null ? null : this.innerProperties().current(); } /** @@ -93,7 +74,7 @@ public Double current() { * @return the percentage value. */ public Double percentage() { - return this.percentage; + return this.innerProperties() == null ? null : this.innerProperties().percentage(); } /** @@ -102,5 +83,8 @@ public Double percentage() { * @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/SecureScoreItemProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemProperties.java new file mode 100644 index 0000000000000..a723952a7a118 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemProperties.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes properties of a calculated secure score. */ +@Immutable +public final class SecureScoreItemProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecureScoreItemProperties.class); + + /* + * The initiative’s name + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * score object + */ + @JsonProperty(value = "score", access = JsonProperty.Access.WRITE_ONLY) + private ScoreDetails innerScore; + + /* + * The relative weight for each subscription. Used when calculating an + * aggregated secure score for multiple subscriptions. + */ + @JsonProperty(value = "weight", access = JsonProperty.Access.WRITE_ONLY) + private Long weight; + + /** + * Get the displayName property: The initiative’s name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the innerScore property: score object. + * + * @return the innerScore value. + */ + private ScoreDetails innerScore() { + return this.innerScore; + } + + /** + * Get the weight property: The relative weight for each subscription. Used when calculating an aggregated secure + * score for multiple subscriptions. + * + * @return the weight value. + */ + public Long weight() { + return this.weight; + } + + /** + * Get the max property: Maximum score available. + * + * @return the max value. + */ + public Integer max() { + return this.innerScore() == null ? null : this.innerScore().max(); + } + + /** + * Get the current property: Current score. + * + * @return the current value. + */ + public Double current() { + return this.innerScore() == null ? null : this.innerScore().current(); + } + + /** + * Get the percentage property: Ratio of the current score divided by the maximum. Rounded to 4 digits after the + * decimal point. + * + * @return the percentage value. + */ + public Double percentage() { + return this.innerScore() == null ? null : this.innerScore().percentage(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerScore() != null) { + innerScore().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataInner.java deleted file mode 100644 index 0df3e3eb6906b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataInner.java +++ /dev/null @@ -1,347 +0,0 @@ -// Copyright (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.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.AssessmentType; -import com.azure.resourcemanager.security.models.Categories; -import com.azure.resourcemanager.security.models.ImplementationEffort; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPartnerData; -import com.azure.resourcemanager.security.models.Severity; -import com.azure.resourcemanager.security.models.Threats; -import com.azure.resourcemanager.security.models.UserImpact; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Security assessment metadata. */ -@JsonFlatten -@Fluent -public class SecurityAssessmentMetadataInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessmentMetadataInner.class); - - /* - * User friendly display name of the assessment - */ - @JsonProperty(value = "properties.displayName") - private String displayName; - - /* - * Azure resource ID of the policy definition that turns this assessment - * calculation on - */ - @JsonProperty(value = "properties.policyDefinitionId", access = JsonProperty.Access.WRITE_ONLY) - private String policyDefinitionId; - - /* - * Human readable description of the assessment - */ - @JsonProperty(value = "properties.description") - private String description; - - /* - * Human readable description of what you should do to mitigate this - * security issue - */ - @JsonProperty(value = "properties.remediationDescription") - private String remediationDescription; - - /* - * The categories property. - */ - @JsonProperty(value = "properties.categories") - private List categories; - - /* - * The severity level of the assessment - */ - @JsonProperty(value = "properties.severity") - private Severity severity; - - /* - * The user impact of the assessment - */ - @JsonProperty(value = "properties.userImpact") - private UserImpact userImpact; - - /* - * The implementation effort required to remediate this assessment - */ - @JsonProperty(value = "properties.implementationEffort") - private ImplementationEffort implementationEffort; - - /* - * The threats property. - */ - @JsonProperty(value = "properties.threats") - private List threats; - - /* - * True if this assessment is in preview release status - */ - @JsonProperty(value = "properties.preview") - private Boolean preview; - - /* - * BuiltIn if the assessment based on built-in Azure Policy definition, - * Custom if the assessment based on custom Azure Policy definition - */ - @JsonProperty(value = "properties.assessmentType") - private AssessmentType assessmentType; - - /* - * Describes the partner that created the assessment - */ - @JsonProperty(value = "properties.partnerData") - private SecurityAssessmentMetadataPartnerData partnerData; - - /** - * Get the displayName property: User friendly display name of the assessment. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: User friendly display name of the assessment. - * - * @param displayName the displayName value to set. - * @return the SecurityAssessmentMetadataInner object itself. - */ - public SecurityAssessmentMetadataInner withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the policyDefinitionId property: Azure resource ID of the policy definition that turns this assessment - * calculation on. - * - * @return the policyDefinitionId value. - */ - public String policyDefinitionId() { - return this.policyDefinitionId; - } - - /** - * Get the description property: Human readable description of the assessment. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Human readable description of the assessment. - * - * @param description the description value to set. - * @return the SecurityAssessmentMetadataInner object itself. - */ - public SecurityAssessmentMetadataInner withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the remediationDescription property: Human readable description of what you should do to mitigate this - * security issue. - * - * @return the remediationDescription value. - */ - public String remediationDescription() { - return this.remediationDescription; - } - - /** - * Set the remediationDescription property: Human readable description of what you should do to mitigate this - * security issue. - * - * @param remediationDescription the remediationDescription value to set. - * @return the SecurityAssessmentMetadataInner object itself. - */ - public SecurityAssessmentMetadataInner withRemediationDescription(String remediationDescription) { - this.remediationDescription = remediationDescription; - return this; - } - - /** - * Get the categories property: The categories property. - * - * @return the categories value. - */ - public List categories() { - return this.categories; - } - - /** - * Set the categories property: The categories property. - * - * @param categories the categories value to set. - * @return the SecurityAssessmentMetadataInner object itself. - */ - public SecurityAssessmentMetadataInner withCategories(List categories) { - this.categories = categories; - return this; - } - - /** - * Get the severity property: The severity level of the assessment. - * - * @return the severity value. - */ - public Severity severity() { - return this.severity; - } - - /** - * Set the severity property: The severity level of the assessment. - * - * @param severity the severity value to set. - * @return the SecurityAssessmentMetadataInner object itself. - */ - public SecurityAssessmentMetadataInner withSeverity(Severity severity) { - this.severity = severity; - return this; - } - - /** - * Get the userImpact property: The user impact of the assessment. - * - * @return the userImpact value. - */ - public UserImpact userImpact() { - return this.userImpact; - } - - /** - * Set the userImpact property: The user impact of the assessment. - * - * @param userImpact the userImpact value to set. - * @return the SecurityAssessmentMetadataInner object itself. - */ - public SecurityAssessmentMetadataInner withUserImpact(UserImpact userImpact) { - this.userImpact = userImpact; - return this; - } - - /** - * Get the implementationEffort property: The implementation effort required to remediate this assessment. - * - * @return the implementationEffort value. - */ - public ImplementationEffort implementationEffort() { - return this.implementationEffort; - } - - /** - * Set the implementationEffort property: The implementation effort required to remediate this assessment. - * - * @param implementationEffort the implementationEffort value to set. - * @return the SecurityAssessmentMetadataInner object itself. - */ - public SecurityAssessmentMetadataInner withImplementationEffort(ImplementationEffort implementationEffort) { - this.implementationEffort = implementationEffort; - return this; - } - - /** - * Get the threats property: The threats property. - * - * @return the threats value. - */ - public List threats() { - return this.threats; - } - - /** - * Set the threats property: The threats property. - * - * @param threats the threats value to set. - * @return the SecurityAssessmentMetadataInner object itself. - */ - public SecurityAssessmentMetadataInner withThreats(List threats) { - this.threats = threats; - return this; - } - - /** - * Get the preview property: True if this assessment is in preview release status. - * - * @return the preview value. - */ - public Boolean preview() { - return this.preview; - } - - /** - * Set the preview property: True if this assessment is in preview release status. - * - * @param preview the preview value to set. - * @return the SecurityAssessmentMetadataInner object itself. - */ - public SecurityAssessmentMetadataInner withPreview(Boolean preview) { - this.preview = preview; - return this; - } - - /** - * Get the assessmentType property: BuiltIn if the assessment based on built-in Azure Policy definition, Custom if - * the assessment based on custom Azure Policy definition. - * - * @return the assessmentType value. - */ - public AssessmentType assessmentType() { - return this.assessmentType; - } - - /** - * Set the assessmentType property: BuiltIn if the assessment based on built-in Azure Policy definition, Custom if - * the assessment based on custom Azure Policy definition. - * - * @param assessmentType the assessmentType value to set. - * @return the SecurityAssessmentMetadataInner object itself. - */ - public SecurityAssessmentMetadataInner withAssessmentType(AssessmentType assessmentType) { - this.assessmentType = assessmentType; - return this; - } - - /** - * Get the partnerData property: Describes the partner that created the assessment. - * - * @return the partnerData value. - */ - public SecurityAssessmentMetadataPartnerData partnerData() { - return this.partnerData; - } - - /** - * Set the partnerData property: Describes the partner that created the assessment. - * - * @param partnerData the partnerData value to set. - * @return the SecurityAssessmentMetadataInner object itself. - */ - public SecurityAssessmentMetadataInner withPartnerData(SecurityAssessmentMetadataPartnerData partnerData) { - this.partnerData = partnerData; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (partnerData() != null) { - partnerData().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataProperties.java similarity index 95% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataProperties.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataProperties.java index 8e2cdcf2e7fe1..e02e1e61d3bf7 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataProperties.java @@ -2,17 +2,24 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security.models; +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.AssessmentType; +import com.azure.resourcemanager.security.models.Categories; +import com.azure.resourcemanager.security.models.ImplementationEffort; +import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPartnerData; +import com.azure.resourcemanager.security.models.Severity; +import com.azure.resourcemanager.security.models.Threats; +import com.azure.resourcemanager.security.models.UserImpact; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Describes properties of an assessment metadata. */ @Fluent -public final class SecurityAssessmentMetadataProperties { +public class SecurityAssessmentMetadataProperties { @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessmentMetadataProperties.class); /* diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataPropertiesResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataPropertiesResponse.java new file mode 100644 index 0000000000000..ce05f6e0201ea --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataPropertiesResponse.java @@ -0,0 +1,225 @@ +// Copyright (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.AssessmentType; +import com.azure.resourcemanager.security.models.Categories; +import com.azure.resourcemanager.security.models.ImplementationEffort; +import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPartnerData; +import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates; +import com.azure.resourcemanager.security.models.Severity; +import com.azure.resourcemanager.security.models.Tactics; +import com.azure.resourcemanager.security.models.Techniques; +import com.azure.resourcemanager.security.models.Threats; +import com.azure.resourcemanager.security.models.UserImpact; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes properties of an assessment metadata response. */ +@Fluent +public final class SecurityAssessmentMetadataPropertiesResponse extends SecurityAssessmentMetadataProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(SecurityAssessmentMetadataPropertiesResponse.class); + + /* + * The publishDates property. + */ + @JsonProperty(value = "publishDates") + private SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates; + + /* + * The plannedDeprecationDate property. + */ + @JsonProperty(value = "plannedDeprecationDate") + private String plannedDeprecationDate; + + /* + * The tactics property. + */ + @JsonProperty(value = "tactics") + private List tactics; + + /* + * The techniques property. + */ + @JsonProperty(value = "techniques") + private List techniques; + + /** + * Get the publishDates property: The publishDates property. + * + * @return the publishDates value. + */ + public SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates() { + return this.publishDates; + } + + /** + * Set the publishDates property: The publishDates property. + * + * @param publishDates the publishDates value to set. + * @return the SecurityAssessmentMetadataPropertiesResponse object itself. + */ + public SecurityAssessmentMetadataPropertiesResponse withPublishDates( + SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates) { + this.publishDates = publishDates; + return this; + } + + /** + * Get the plannedDeprecationDate property: The plannedDeprecationDate property. + * + * @return the plannedDeprecationDate value. + */ + public String plannedDeprecationDate() { + return this.plannedDeprecationDate; + } + + /** + * Set the plannedDeprecationDate property: The plannedDeprecationDate property. + * + * @param plannedDeprecationDate the plannedDeprecationDate value to set. + * @return the SecurityAssessmentMetadataPropertiesResponse object itself. + */ + public SecurityAssessmentMetadataPropertiesResponse withPlannedDeprecationDate(String plannedDeprecationDate) { + this.plannedDeprecationDate = plannedDeprecationDate; + return this; + } + + /** + * Get the tactics property: The tactics property. + * + * @return the tactics value. + */ + public List tactics() { + return this.tactics; + } + + /** + * Set the tactics property: The tactics property. + * + * @param tactics the tactics value to set. + * @return the SecurityAssessmentMetadataPropertiesResponse object itself. + */ + public SecurityAssessmentMetadataPropertiesResponse withTactics(List tactics) { + this.tactics = tactics; + return this; + } + + /** + * Get the techniques property: The techniques property. + * + * @return the techniques value. + */ + public List techniques() { + return this.techniques; + } + + /** + * Set the techniques property: The techniques property. + * + * @param techniques the techniques value to set. + * @return the SecurityAssessmentMetadataPropertiesResponse object itself. + */ + public SecurityAssessmentMetadataPropertiesResponse withTechniques(List techniques) { + this.techniques = techniques; + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withRemediationDescription(String remediationDescription) { + super.withRemediationDescription(remediationDescription); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withCategories(List categories) { + super.withCategories(categories); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withSeverity(Severity severity) { + super.withSeverity(severity); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withUserImpact(UserImpact userImpact) { + super.withUserImpact(userImpact); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withImplementationEffort( + ImplementationEffort implementationEffort) { + super.withImplementationEffort(implementationEffort); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withThreats(List threats) { + super.withThreats(threats); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withPreview(Boolean preview) { + super.withPreview(preview); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withAssessmentType(AssessmentType assessmentType) { + super.withAssessmentType(assessmentType); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentMetadataPropertiesResponse withPartnerData( + SecurityAssessmentMetadataPartnerData partnerData) { + super.withPartnerData(partnerData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (publishDates() != null) { + publishDates().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataResponseInner.java new file mode 100644 index 0000000000000..db389dd250b68 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataResponseInner.java @@ -0,0 +1,414 @@ +// Copyright (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.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.AssessmentType; +import com.azure.resourcemanager.security.models.Categories; +import com.azure.resourcemanager.security.models.ImplementationEffort; +import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPartnerData; +import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates; +import com.azure.resourcemanager.security.models.Severity; +import com.azure.resourcemanager.security.models.Tactics; +import com.azure.resourcemanager.security.models.Techniques; +import com.azure.resourcemanager.security.models.Threats; +import com.azure.resourcemanager.security.models.UserImpact; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Security assessment metadata response. */ +@Fluent +public final class SecurityAssessmentMetadataResponseInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessmentMetadataResponseInner.class); + + /* + * Describes properties of an assessment metadata response. + */ + @JsonProperty(value = "properties") + private SecurityAssessmentMetadataPropertiesResponse innerProperties; + + /** + * Get the innerProperties property: Describes properties of an assessment metadata response. + * + * @return the innerProperties value. + */ + private SecurityAssessmentMetadataPropertiesResponse innerProperties() { + return this.innerProperties; + } + + /** + * Get the publishDates property: The publishDates property. + * + * @return the publishDates value. + */ + public SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates() { + return this.innerProperties() == null ? null : this.innerProperties().publishDates(); + } + + /** + * Set the publishDates property: The publishDates property. + * + * @param publishDates the publishDates value to set. + * @return the SecurityAssessmentMetadataResponseInner object itself. + */ + public SecurityAssessmentMetadataResponseInner withPublishDates( + SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); + } + this.innerProperties().withPublishDates(publishDates); + return this; + } + + /** + * Get the plannedDeprecationDate property: The plannedDeprecationDate property. + * + * @return the plannedDeprecationDate value. + */ + public String plannedDeprecationDate() { + return this.innerProperties() == null ? null : this.innerProperties().plannedDeprecationDate(); + } + + /** + * Set the plannedDeprecationDate property: The plannedDeprecationDate property. + * + * @param plannedDeprecationDate the plannedDeprecationDate value to set. + * @return the SecurityAssessmentMetadataResponseInner object itself. + */ + public SecurityAssessmentMetadataResponseInner withPlannedDeprecationDate(String plannedDeprecationDate) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); + } + this.innerProperties().withPlannedDeprecationDate(plannedDeprecationDate); + return this; + } + + /** + * Get the tactics property: The tactics property. + * + * @return the tactics value. + */ + public List tactics() { + return this.innerProperties() == null ? null : this.innerProperties().tactics(); + } + + /** + * Set the tactics property: The tactics property. + * + * @param tactics the tactics value to set. + * @return the SecurityAssessmentMetadataResponseInner object itself. + */ + public SecurityAssessmentMetadataResponseInner withTactics(List tactics) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); + } + this.innerProperties().withTactics(tactics); + return this; + } + + /** + * Get the techniques property: The techniques property. + * + * @return the techniques value. + */ + public List techniques() { + return this.innerProperties() == null ? null : this.innerProperties().techniques(); + } + + /** + * Set the techniques property: The techniques property. + * + * @param techniques the techniques value to set. + * @return the SecurityAssessmentMetadataResponseInner object itself. + */ + public SecurityAssessmentMetadataResponseInner withTechniques(List techniques) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); + } + this.innerProperties().withTechniques(techniques); + return this; + } + + /** + * Get the displayName property: User friendly display name of the assessment. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: User friendly display name of the assessment. + * + * @param displayName the displayName value to set. + * @return the SecurityAssessmentMetadataResponseInner object itself. + */ + public SecurityAssessmentMetadataResponseInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the policyDefinitionId property: Azure resource ID of the policy definition that turns this assessment + * calculation on. + * + * @return the policyDefinitionId value. + */ + public String policyDefinitionId() { + return this.innerProperties() == null ? null : this.innerProperties().policyDefinitionId(); + } + + /** + * Get the description property: Human readable description of the assessment. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: Human readable description of the assessment. + * + * @param description the description value to set. + * @return the SecurityAssessmentMetadataResponseInner object itself. + */ + public SecurityAssessmentMetadataResponseInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the remediationDescription property: Human readable description of what you should do to mitigate this + * security issue. + * + * @return the remediationDescription value. + */ + public String remediationDescription() { + return this.innerProperties() == null ? null : this.innerProperties().remediationDescription(); + } + + /** + * Set the remediationDescription property: Human readable description of what you should do to mitigate this + * security issue. + * + * @param remediationDescription the remediationDescription value to set. + * @return the SecurityAssessmentMetadataResponseInner object itself. + */ + public SecurityAssessmentMetadataResponseInner withRemediationDescription(String remediationDescription) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); + } + this.innerProperties().withRemediationDescription(remediationDescription); + return this; + } + + /** + * Get the categories property: The categories property. + * + * @return the categories value. + */ + public List categories() { + return this.innerProperties() == null ? null : this.innerProperties().categories(); + } + + /** + * Set the categories property: The categories property. + * + * @param categories the categories value to set. + * @return the SecurityAssessmentMetadataResponseInner object itself. + */ + public SecurityAssessmentMetadataResponseInner withCategories(List categories) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); + } + this.innerProperties().withCategories(categories); + return this; + } + + /** + * Get the severity property: The severity level of the assessment. + * + * @return the severity value. + */ + public Severity severity() { + return this.innerProperties() == null ? null : this.innerProperties().severity(); + } + + /** + * Set the severity property: The severity level of the assessment. + * + * @param severity the severity value to set. + * @return the SecurityAssessmentMetadataResponseInner object itself. + */ + public SecurityAssessmentMetadataResponseInner withSeverity(Severity severity) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); + } + this.innerProperties().withSeverity(severity); + return this; + } + + /** + * Get the userImpact property: The user impact of the assessment. + * + * @return the userImpact value. + */ + public UserImpact userImpact() { + return this.innerProperties() == null ? null : this.innerProperties().userImpact(); + } + + /** + * Set the userImpact property: The user impact of the assessment. + * + * @param userImpact the userImpact value to set. + * @return the SecurityAssessmentMetadataResponseInner object itself. + */ + public SecurityAssessmentMetadataResponseInner withUserImpact(UserImpact userImpact) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); + } + this.innerProperties().withUserImpact(userImpact); + return this; + } + + /** + * Get the implementationEffort property: The implementation effort required to remediate this assessment. + * + * @return the implementationEffort value. + */ + public ImplementationEffort implementationEffort() { + return this.innerProperties() == null ? null : this.innerProperties().implementationEffort(); + } + + /** + * Set the implementationEffort property: The implementation effort required to remediate this assessment. + * + * @param implementationEffort the implementationEffort value to set. + * @return the SecurityAssessmentMetadataResponseInner object itself. + */ + public SecurityAssessmentMetadataResponseInner withImplementationEffort(ImplementationEffort implementationEffort) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); + } + this.innerProperties().withImplementationEffort(implementationEffort); + return this; + } + + /** + * Get the threats property: The threats property. + * + * @return the threats value. + */ + public List threats() { + return this.innerProperties() == null ? null : this.innerProperties().threats(); + } + + /** + * Set the threats property: The threats property. + * + * @param threats the threats value to set. + * @return the SecurityAssessmentMetadataResponseInner object itself. + */ + public SecurityAssessmentMetadataResponseInner withThreats(List threats) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); + } + this.innerProperties().withThreats(threats); + return this; + } + + /** + * Get the preview property: True if this assessment is in preview release status. + * + * @return the preview value. + */ + public Boolean preview() { + return this.innerProperties() == null ? null : this.innerProperties().preview(); + } + + /** + * Set the preview property: True if this assessment is in preview release status. + * + * @param preview the preview value to set. + * @return the SecurityAssessmentMetadataResponseInner object itself. + */ + public SecurityAssessmentMetadataResponseInner withPreview(Boolean preview) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); + } + this.innerProperties().withPreview(preview); + return this; + } + + /** + * Get the assessmentType property: BuiltIn if the assessment based on built-in Azure Policy definition, Custom if + * the assessment based on custom Azure Policy definition. + * + * @return the assessmentType value. + */ + public AssessmentType assessmentType() { + return this.innerProperties() == null ? null : this.innerProperties().assessmentType(); + } + + /** + * Set the assessmentType property: BuiltIn if the assessment based on built-in Azure Policy definition, Custom if + * the assessment based on custom Azure Policy definition. + * + * @param assessmentType the assessmentType value to set. + * @return the SecurityAssessmentMetadataResponseInner object itself. + */ + public SecurityAssessmentMetadataResponseInner withAssessmentType(AssessmentType assessmentType) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); + } + this.innerProperties().withAssessmentType(assessmentType); + return this; + } + + /** + * Get the partnerData property: Describes the partner that created the assessment. + * + * @return the partnerData value. + */ + public SecurityAssessmentMetadataPartnerData partnerData() { + return this.innerProperties() == null ? null : this.innerProperties().partnerData(); + } + + /** + * Set the partnerData property: Describes the partner that created the assessment. + * + * @param partnerData the partnerData value to set. + * @return the SecurityAssessmentMetadataResponseInner object itself. + */ + public SecurityAssessmentMetadataResponseInner withPartnerData(SecurityAssessmentMetadataPartnerData partnerData) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); + } + this.innerProperties().withPartnerData(partnerData); + 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/SecurityAssessmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentProperties.java new file mode 100644 index 0000000000000..b183b8482f3bb --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentProperties.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.AssessmentStatus; +import com.azure.resourcemanager.security.models.ResourceDetails; +import com.azure.resourcemanager.security.models.SecurityAssessmentPartnerData; +import com.azure.resourcemanager.security.models.SecurityAssessmentPropertiesBase; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes properties of an assessment. */ +@Fluent +public final class SecurityAssessmentProperties extends SecurityAssessmentPropertiesBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessmentProperties.class); + + /* + * The result of the assessment + */ + @JsonProperty(value = "status", required = true) + private AssessmentStatus status; + + /** + * Get the status property: The result of the assessment. + * + * @return the status value. + */ + public AssessmentStatus status() { + return this.status; + } + + /** + * Set the status property: The result of the assessment. + * + * @param status the status value to set. + * @return the SecurityAssessmentProperties object itself. + */ + public SecurityAssessmentProperties withStatus(AssessmentStatus status) { + this.status = status; + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentProperties withResourceDetails(ResourceDetails resourceDetails) { + super.withResourceDetails(resourceDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentProperties withAdditionalData(Map additionalData) { + super.withAdditionalData(additionalData); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentProperties withMetadata(SecurityAssessmentMetadataProperties metadata) { + super.withMetadata(metadata); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentProperties withPartnersData(SecurityAssessmentPartnerData partnersData) { + super.withPartnersData(partnersData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (status() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property status in model SecurityAssessmentProperties")); + } else { + status().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentPropertiesResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentPropertiesResponse.java new file mode 100644 index 0000000000000..211a847812da7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentPropertiesResponse.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.AssessmentStatusResponse; +import com.azure.resourcemanager.security.models.ResourceDetails; +import com.azure.resourcemanager.security.models.SecurityAssessmentPartnerData; +import com.azure.resourcemanager.security.models.SecurityAssessmentPropertiesBase; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes properties of an assessment. */ +@Fluent +public final class SecurityAssessmentPropertiesResponse extends SecurityAssessmentPropertiesBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessmentPropertiesResponse.class); + + /* + * The result of the assessment + */ + @JsonProperty(value = "status", required = true) + private AssessmentStatusResponse status; + + /** + * Get the status property: The result of the assessment. + * + * @return the status value. + */ + public AssessmentStatusResponse status() { + return this.status; + } + + /** + * Set the status property: The result of the assessment. + * + * @param status the status value to set. + * @return the SecurityAssessmentPropertiesResponse object itself. + */ + public SecurityAssessmentPropertiesResponse withStatus(AssessmentStatusResponse status) { + this.status = status; + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentPropertiesResponse withResourceDetails(ResourceDetails resourceDetails) { + super.withResourceDetails(resourceDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentPropertiesResponse withAdditionalData(Map additionalData) { + super.withAdditionalData(additionalData); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentPropertiesResponse withMetadata(SecurityAssessmentMetadataProperties metadata) { + super.withMetadata(metadata); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityAssessmentPropertiesResponse withPartnersData(SecurityAssessmentPartnerData partnersData) { + super.withPartnersData(partnersData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (status() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property status in model SecurityAssessmentPropertiesResponse")); + } else { + status().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentResponseInner.java new file mode 100644 index 0000000000000..87661c4eed684 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentResponseInner.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.AssessmentLinks; +import com.azure.resourcemanager.security.models.AssessmentStatusResponse; +import com.azure.resourcemanager.security.models.ResourceDetails; +import com.azure.resourcemanager.security.models.SecurityAssessmentPartnerData; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Security assessment on a resource - response format. */ +@Fluent +public final class SecurityAssessmentResponseInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessmentResponseInner.class); + + /* + * Describes properties of an assessment. + */ + @JsonProperty(value = "properties") + private SecurityAssessmentPropertiesResponse innerProperties; + + /** + * Get the innerProperties property: Describes properties of an assessment. + * + * @return the innerProperties value. + */ + private SecurityAssessmentPropertiesResponse innerProperties() { + return this.innerProperties; + } + + /** + * Get the status property: The result of the assessment. + * + * @return the status value. + */ + public AssessmentStatusResponse status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The result of the assessment. + * + * @param status the status value to set. + * @return the SecurityAssessmentResponseInner object itself. + */ + public SecurityAssessmentResponseInner withStatus(AssessmentStatusResponse status) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentPropertiesResponse(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the resourceDetails property: Details of the resource that was assessed. + * + * @return the resourceDetails value. + */ + public ResourceDetails resourceDetails() { + return this.innerProperties() == null ? null : this.innerProperties().resourceDetails(); + } + + /** + * Set the resourceDetails property: Details of the resource that was assessed. + * + * @param resourceDetails the resourceDetails value to set. + * @return the SecurityAssessmentResponseInner object itself. + */ + public SecurityAssessmentResponseInner withResourceDetails(ResourceDetails resourceDetails) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentPropertiesResponse(); + } + this.innerProperties().withResourceDetails(resourceDetails); + return this; + } + + /** + * Get the displayName property: User friendly display name of the assessment. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Get the additionalData property: Additional data regarding the assessment. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Set the additionalData property: Additional data regarding the assessment. + * + * @param additionalData the additionalData value to set. + * @return the SecurityAssessmentResponseInner object itself. + */ + public SecurityAssessmentResponseInner withAdditionalData(Map additionalData) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentPropertiesResponse(); + } + this.innerProperties().withAdditionalData(additionalData); + return this; + } + + /** + * Get the links property: Links relevant to the assessment. + * + * @return the links value. + */ + public AssessmentLinks links() { + return this.innerProperties() == null ? null : this.innerProperties().links(); + } + + /** + * Get the metadata property: Describes properties of an assessment metadata. + * + * @return the metadata value. + */ + public SecurityAssessmentMetadataProperties metadata() { + return this.innerProperties() == null ? null : this.innerProperties().metadata(); + } + + /** + * Set the metadata property: Describes properties of an assessment metadata. + * + * @param metadata the metadata value to set. + * @return the SecurityAssessmentResponseInner object itself. + */ + public SecurityAssessmentResponseInner withMetadata(SecurityAssessmentMetadataProperties metadata) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentPropertiesResponse(); + } + this.innerProperties().withMetadata(metadata); + return this; + } + + /** + * Get the partnersData property: Data regarding 3rd party partner integration. + * + * @return the partnersData value. + */ + public SecurityAssessmentPartnerData partnersData() { + return this.innerProperties() == null ? null : this.innerProperties().partnersData(); + } + + /** + * Set the partnersData property: Data regarding 3rd party partner integration. + * + * @param partnersData the partnersData value to set. + * @return the SecurityAssessmentResponseInner object itself. + */ + public SecurityAssessmentResponseInner withPartnersData(SecurityAssessmentPartnerData partnersData) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentPropertiesResponse(); + } + this.innerProperties().withPartnersData(partnersData); + 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/SecurityConnectorInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorInner.java new file mode 100644 index 0000000000000..ed5486f692661 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorInner.java @@ -0,0 +1,172 @@ +// Copyright (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.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.CloudName; +import com.azure.resourcemanager.security.models.CloudOffering; +import com.azure.resourcemanager.security.models.SecurityConnectorPropertiesOrganizationalData; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The security connector resource. */ +@Fluent +public final class SecurityConnectorInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityConnectorInner.class); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Security connector data + */ + @JsonProperty(value = "properties") + private SecurityConnectorProperties innerProperties; + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Security connector data. + * + * @return the innerProperties value. + */ + private SecurityConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public SecurityConnectorInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityConnectorInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of AWS connector). + * + * @return the hierarchyIdentifier value. + */ + public String hierarchyIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().hierarchyIdentifier(); + } + + /** + * Set the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of AWS connector). + * + * @param hierarchyIdentifier the hierarchyIdentifier value to set. + * @return the SecurityConnectorInner object itself. + */ + public SecurityConnectorInner withHierarchyIdentifier(String hierarchyIdentifier) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityConnectorProperties(); + } + this.innerProperties().withHierarchyIdentifier(hierarchyIdentifier); + return this; + } + + /** + * Get the cloudName property: The multi cloud resource's cloud name. + * + * @return the cloudName value. + */ + public CloudName cloudName() { + return this.innerProperties() == null ? null : this.innerProperties().cloudName(); + } + + /** + * Set the cloudName property: The multi cloud resource's cloud name. + * + * @param cloudName the cloudName value to set. + * @return the SecurityConnectorInner object itself. + */ + public SecurityConnectorInner withCloudName(CloudName cloudName) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityConnectorProperties(); + } + this.innerProperties().withCloudName(cloudName); + return this; + } + + /** + * Get the offerings property: A collection of offerings for the security connector. + * + * @return the offerings value. + */ + public List offerings() { + return this.innerProperties() == null ? null : this.innerProperties().offerings(); + } + + /** + * Set the offerings property: A collection of offerings for the security connector. + * + * @param offerings the offerings value to set. + * @return the SecurityConnectorInner object itself. + */ + public SecurityConnectorInner withOfferings(List offerings) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityConnectorProperties(); + } + this.innerProperties().withOfferings(offerings); + return this; + } + + /** + * Get the organizationalData property: The multi cloud account's organizational data. + * + * @return the organizationalData value. + */ + public SecurityConnectorPropertiesOrganizationalData organizationalData() { + return this.innerProperties() == null ? null : this.innerProperties().organizationalData(); + } + + /** + * Set the organizationalData property: The multi cloud account's organizational data. + * + * @param organizationalData the organizationalData value to set. + * @return the SecurityConnectorInner object itself. + */ + public SecurityConnectorInner withOrganizationalData( + SecurityConnectorPropertiesOrganizationalData organizationalData) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityConnectorProperties(); + } + this.innerProperties().withOrganizationalData(organizationalData); + 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/SecurityConnectorProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorProperties.java new file mode 100644 index 0000000000000..148af92d4e76d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.CloudName; +import com.azure.resourcemanager.security.models.CloudOffering; +import com.azure.resourcemanager.security.models.SecurityConnectorPropertiesOrganizationalData; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A set of properties that defines the security connector configuration. */ +@Fluent +public final class SecurityConnectorProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityConnectorProperties.class); + + /* + * The multi cloud resource identifier (account id in case of AWS + * connector). + */ + @JsonProperty(value = "hierarchyIdentifier") + private String hierarchyIdentifier; + + /* + * The multi cloud resource's cloud name. + */ + @JsonProperty(value = "cloudName") + private CloudName cloudName; + + /* + * A collection of offerings for the security connector. + */ + @JsonProperty(value = "offerings") + private List offerings; + + /* + * The multi cloud account's organizational data + */ + @JsonProperty(value = "organizationalData") + private SecurityConnectorPropertiesOrganizationalData organizationalData; + + /** + * Get the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of AWS connector). + * + * @return the hierarchyIdentifier value. + */ + public String hierarchyIdentifier() { + return this.hierarchyIdentifier; + } + + /** + * Set the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of AWS connector). + * + * @param hierarchyIdentifier the hierarchyIdentifier value to set. + * @return the SecurityConnectorProperties object itself. + */ + public SecurityConnectorProperties withHierarchyIdentifier(String hierarchyIdentifier) { + this.hierarchyIdentifier = hierarchyIdentifier; + return this; + } + + /** + * Get the cloudName property: The multi cloud resource's cloud name. + * + * @return the cloudName value. + */ + public CloudName cloudName() { + return this.cloudName; + } + + /** + * Set the cloudName property: The multi cloud resource's cloud name. + * + * @param cloudName the cloudName value to set. + * @return the SecurityConnectorProperties object itself. + */ + public SecurityConnectorProperties withCloudName(CloudName cloudName) { + this.cloudName = cloudName; + return this; + } + + /** + * Get the offerings property: A collection of offerings for the security connector. + * + * @return the offerings value. + */ + public List offerings() { + return this.offerings; + } + + /** + * Set the offerings property: A collection of offerings for the security connector. + * + * @param offerings the offerings value to set. + * @return the SecurityConnectorProperties object itself. + */ + public SecurityConnectorProperties withOfferings(List offerings) { + this.offerings = offerings; + return this; + } + + /** + * Get the organizationalData property: The multi cloud account's organizational data. + * + * @return the organizationalData value. + */ + public SecurityConnectorPropertiesOrganizationalData organizationalData() { + return this.organizationalData; + } + + /** + * Set the organizationalData property: The multi cloud account's organizational data. + * + * @param organizationalData the organizationalData value to set. + * @return the SecurityConnectorProperties object itself. + */ + public SecurityConnectorProperties withOrganizationalData( + SecurityConnectorPropertiesOrganizationalData organizationalData) { + this.organizationalData = organizationalData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (offerings() != null) { + offerings().forEach(e -> e.validate()); + } + if (organizationalData() != null) { + organizationalData().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactInner.java index 656f9d83c816b..7cd90e0f0c64c 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.AlertNotifications; @@ -14,34 +13,24 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** Contact details for security issues. */ -@JsonFlatten @Fluent -public class SecurityContactInner extends ProxyResource { +public final class SecurityContactInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityContactInner.class); /* - * The email of this security contact + * Security contact data */ - @JsonProperty(value = "properties.email") - private String email; + @JsonProperty(value = "properties") + private SecurityContactProperties innerProperties; - /* - * The phone number of this security contact - */ - @JsonProperty(value = "properties.phone") - private String phone; - - /* - * Whether to send security alerts notifications to the security contact - */ - @JsonProperty(value = "properties.alertNotifications") - private AlertNotifications alertNotifications; - - /* - * Whether to send security alerts notifications to subscription admins + /** + * Get the innerProperties property: Security contact data. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.alertsToAdmins") - private AlertsToAdmins alertsToAdmins; + private SecurityContactProperties innerProperties() { + return this.innerProperties; + } /** * Get the email property: The email of this security contact. @@ -49,7 +38,7 @@ public class SecurityContactInner extends ProxyResource { * @return the email value. */ public String email() { - return this.email; + return this.innerProperties() == null ? null : this.innerProperties().email(); } /** @@ -59,7 +48,10 @@ public String email() { * @return the SecurityContactInner object itself. */ public SecurityContactInner withEmail(String email) { - this.email = email; + if (this.innerProperties() == null) { + this.innerProperties = new SecurityContactProperties(); + } + this.innerProperties().withEmail(email); return this; } @@ -69,7 +61,7 @@ public SecurityContactInner withEmail(String email) { * @return the phone value. */ public String phone() { - return this.phone; + return this.innerProperties() == null ? null : this.innerProperties().phone(); } /** @@ -79,7 +71,10 @@ public String phone() { * @return the SecurityContactInner object itself. */ public SecurityContactInner withPhone(String phone) { - this.phone = phone; + if (this.innerProperties() == null) { + this.innerProperties = new SecurityContactProperties(); + } + this.innerProperties().withPhone(phone); return this; } @@ -89,7 +84,7 @@ public SecurityContactInner withPhone(String phone) { * @return the alertNotifications value. */ public AlertNotifications alertNotifications() { - return this.alertNotifications; + return this.innerProperties() == null ? null : this.innerProperties().alertNotifications(); } /** @@ -99,7 +94,10 @@ public AlertNotifications alertNotifications() { * @return the SecurityContactInner object itself. */ public SecurityContactInner withAlertNotifications(AlertNotifications alertNotifications) { - this.alertNotifications = alertNotifications; + if (this.innerProperties() == null) { + this.innerProperties = new SecurityContactProperties(); + } + this.innerProperties().withAlertNotifications(alertNotifications); return this; } @@ -109,7 +107,7 @@ public SecurityContactInner withAlertNotifications(AlertNotifications alertNotif * @return the alertsToAdmins value. */ public AlertsToAdmins alertsToAdmins() { - return this.alertsToAdmins; + return this.innerProperties() == null ? null : this.innerProperties().alertsToAdmins(); } /** @@ -119,7 +117,10 @@ public AlertsToAdmins alertsToAdmins() { * @return the SecurityContactInner object itself. */ public SecurityContactInner withAlertsToAdmins(AlertsToAdmins alertsToAdmins) { - this.alertsToAdmins = alertsToAdmins; + if (this.innerProperties() == null) { + this.innerProperties = new SecurityContactProperties(); + } + this.innerProperties().withAlertsToAdmins(alertsToAdmins); return this; } @@ -129,5 +130,8 @@ public SecurityContactInner withAlertsToAdmins(AlertsToAdmins alertsToAdmins) { * @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/SecurityContactProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactProperties.java new file mode 100644 index 0000000000000..d2faf2006e51b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactProperties.java @@ -0,0 +1,147 @@ +// Copyright (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.AlertNotifications; +import com.azure.resourcemanager.security.models.AlertsToAdmins; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** describes security contact properties. */ +@Fluent +public final class SecurityContactProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityContactProperties.class); + + /* + * The email of this security contact + */ + @JsonProperty(value = "email", required = true) + private String email; + + /* + * The phone number of this security contact + */ + @JsonProperty(value = "phone") + private String phone; + + /* + * Whether to send security alerts notifications to the security contact + */ + @JsonProperty(value = "alertNotifications", required = true) + private AlertNotifications alertNotifications; + + /* + * Whether to send security alerts notifications to subscription admins + */ + @JsonProperty(value = "alertsToAdmins", required = true) + private AlertsToAdmins alertsToAdmins; + + /** + * Get the email property: The email of this security contact. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: The email of this security contact. + * + * @param email the email value to set. + * @return the SecurityContactProperties object itself. + */ + public SecurityContactProperties withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the phone property: The phone number of this security contact. + * + * @return the phone value. + */ + public String phone() { + return this.phone; + } + + /** + * Set the phone property: The phone number of this security contact. + * + * @param phone the phone value to set. + * @return the SecurityContactProperties object itself. + */ + public SecurityContactProperties withPhone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get the alertNotifications property: Whether to send security alerts notifications to the security contact. + * + * @return the alertNotifications value. + */ + public AlertNotifications alertNotifications() { + return this.alertNotifications; + } + + /** + * Set the alertNotifications property: Whether to send security alerts notifications to the security contact. + * + * @param alertNotifications the alertNotifications value to set. + * @return the SecurityContactProperties object itself. + */ + public SecurityContactProperties withAlertNotifications(AlertNotifications alertNotifications) { + this.alertNotifications = alertNotifications; + return this; + } + + /** + * Get the alertsToAdmins property: Whether to send security alerts notifications to subscription admins. + * + * @return the alertsToAdmins value. + */ + public AlertsToAdmins alertsToAdmins() { + return this.alertsToAdmins; + } + + /** + * Set the alertsToAdmins property: Whether to send security alerts notifications to subscription admins. + * + * @param alertsToAdmins the alertsToAdmins value to set. + * @return the SecurityContactProperties object itself. + */ + public SecurityContactProperties withAlertsToAdmins(AlertsToAdmins alertsToAdmins) { + this.alertsToAdmins = alertsToAdmins; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (email() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property email in model SecurityContactProperties")); + } + if (alertNotifications() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property alertNotifications in model SecurityContactProperties")); + } + if (alertsToAdmins() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property alertsToAdmins in model SecurityContactProperties")); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionInner.java index 36e04e1044232..132e742645184 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.ProvisioningState; @@ -14,40 +13,39 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** The SecuritySolution model. */ -@JsonFlatten @Fluent -public class SecuritySolutionInner extends ProxyResource { +public final class SecuritySolutionInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(SecuritySolutionInner.class); /* - * The security family of the security solution + * The properties property. */ - @JsonProperty(value = "properties.securityFamily") - private SecurityFamily securityFamily; + @JsonProperty(value = "properties") + private SecuritySolutionProperties innerProperties; /* - * The security family provisioning State - */ - @JsonProperty(value = "properties.provisioningState") - private ProvisioningState provisioningState; - - /* - * The security solutions' template + * Location where the resource is stored */ - @JsonProperty(value = "properties.template") - private String template; + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; - /* - * The security solutions' status + /** + * Get the innerProperties property: The properties property. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.protectionStatus") - private String protectionStatus; + private SecuritySolutionProperties innerProperties() { + return this.innerProperties; + } - /* - * Location where the resource is stored + /** + * Get the location property: Location where the resource is stored. + * + * @return the location value. */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; + public String location() { + return this.location; + } /** * Get the securityFamily property: The security family of the security solution. @@ -55,7 +53,7 @@ public class SecuritySolutionInner extends ProxyResource { * @return the securityFamily value. */ public SecurityFamily securityFamily() { - return this.securityFamily; + return this.innerProperties() == null ? null : this.innerProperties().securityFamily(); } /** @@ -65,7 +63,10 @@ public SecurityFamily securityFamily() { * @return the SecuritySolutionInner object itself. */ public SecuritySolutionInner withSecurityFamily(SecurityFamily securityFamily) { - this.securityFamily = securityFamily; + if (this.innerProperties() == null) { + this.innerProperties = new SecuritySolutionProperties(); + } + this.innerProperties().withSecurityFamily(securityFamily); return this; } @@ -75,7 +76,7 @@ public SecuritySolutionInner withSecurityFamily(SecurityFamily securityFamily) { * @return the provisioningState value. */ public ProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -85,7 +86,10 @@ public ProvisioningState provisioningState() { * @return the SecuritySolutionInner object itself. */ public SecuritySolutionInner withProvisioningState(ProvisioningState provisioningState) { - this.provisioningState = provisioningState; + if (this.innerProperties() == null) { + this.innerProperties = new SecuritySolutionProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); return this; } @@ -95,7 +99,7 @@ public SecuritySolutionInner withProvisioningState(ProvisioningState provisionin * @return the template value. */ public String template() { - return this.template; + return this.innerProperties() == null ? null : this.innerProperties().template(); } /** @@ -105,7 +109,10 @@ public String template() { * @return the SecuritySolutionInner object itself. */ public SecuritySolutionInner withTemplate(String template) { - this.template = template; + if (this.innerProperties() == null) { + this.innerProperties = new SecuritySolutionProperties(); + } + this.innerProperties().withTemplate(template); return this; } @@ -115,7 +122,7 @@ public SecuritySolutionInner withTemplate(String template) { * @return the protectionStatus value. */ public String protectionStatus() { - return this.protectionStatus; + return this.innerProperties() == null ? null : this.innerProperties().protectionStatus(); } /** @@ -125,24 +132,21 @@ public String protectionStatus() { * @return the SecuritySolutionInner object itself. */ public SecuritySolutionInner withProtectionStatus(String protectionStatus) { - this.protectionStatus = protectionStatus; + if (this.innerProperties() == null) { + this.innerProperties = new SecuritySolutionProperties(); + } + this.innerProperties().withProtectionStatus(protectionStatus); return this; } - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - /** * 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/SecuritySolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionProperties.java new file mode 100644 index 0000000000000..29ff830eeea4b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionProperties.java @@ -0,0 +1,154 @@ +// Copyright (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.ProvisioningState; +import com.azure.resourcemanager.security.models.SecurityFamily; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SecuritySolutionProperties model. */ +@Fluent +public final class SecuritySolutionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecuritySolutionProperties.class); + + /* + * The security family of the security solution + */ + @JsonProperty(value = "securityFamily", required = true) + private SecurityFamily securityFamily; + + /* + * The security family provisioning State + */ + @JsonProperty(value = "provisioningState", required = true) + private ProvisioningState provisioningState; + + /* + * The security solutions' template + */ + @JsonProperty(value = "template", required = true) + private String template; + + /* + * The security solutions' status + */ + @JsonProperty(value = "protectionStatus", required = true) + private String protectionStatus; + + /** + * Get the securityFamily property: The security family of the security solution. + * + * @return the securityFamily value. + */ + public SecurityFamily securityFamily() { + return this.securityFamily; + } + + /** + * Set the securityFamily property: The security family of the security solution. + * + * @param securityFamily the securityFamily value to set. + * @return the SecuritySolutionProperties object itself. + */ + public SecuritySolutionProperties withSecurityFamily(SecurityFamily securityFamily) { + this.securityFamily = securityFamily; + return this; + } + + /** + * Get the provisioningState property: The security family provisioning State. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The security family provisioning State. + * + * @param provisioningState the provisioningState value to set. + * @return the SecuritySolutionProperties object itself. + */ + public SecuritySolutionProperties withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the template property: The security solutions' template. + * + * @return the template value. + */ + public String template() { + return this.template; + } + + /** + * Set the template property: The security solutions' template. + * + * @param template the template value to set. + * @return the SecuritySolutionProperties object itself. + */ + public SecuritySolutionProperties withTemplate(String template) { + this.template = template; + return this; + } + + /** + * Get the protectionStatus property: The security solutions' status. + * + * @return the protectionStatus value. + */ + public String protectionStatus() { + return this.protectionStatus; + } + + /** + * Set the protectionStatus property: The security solutions' status. + * + * @param protectionStatus the protectionStatus value to set. + * @return the SecuritySolutionProperties object itself. + */ + public SecuritySolutionProperties withProtectionStatus(String protectionStatus) { + this.protectionStatus = protectionStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (securityFamily() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property securityFamily in model SecuritySolutionProperties")); + } + if (provisioningState() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property provisioningState in model SecuritySolutionProperties")); + } + if (template() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property template in model SecuritySolutionProperties")); + } + if (protectionStatus() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protectionStatus in model SecuritySolutionProperties")); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionsReferenceDataProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionsReferenceDataProperties.java new file mode 100644 index 0000000000000..123288138af3c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionsReferenceDataProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.SecurityFamily; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SecuritySolutionsReferenceDataProperties model. */ +@Fluent +public final class SecuritySolutionsReferenceDataProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecuritySolutionsReferenceDataProperties.class); + + /* + * The security family of the security solution + */ + @JsonProperty(value = "securityFamily", required = true) + private SecurityFamily securityFamily; + + /* + * The security solutions' vendor name + */ + @JsonProperty(value = "alertVendorName", required = true) + private String alertVendorName; + + /* + * The security solutions' package info url + */ + @JsonProperty(value = "packageInfoUrl", required = true) + private String packageInfoUrl; + + /* + * The security solutions' product name + */ + @JsonProperty(value = "productName", required = true) + private String productName; + + /* + * The security solutions' publisher + */ + @JsonProperty(value = "publisher", required = true) + private String publisher; + + /* + * The security solutions' publisher display name + */ + @JsonProperty(value = "publisherDisplayName", required = true) + private String publisherDisplayName; + + /* + * The security solutions' template + */ + @JsonProperty(value = "template", required = true) + private String template; + + /** + * Get the securityFamily property: The security family of the security solution. + * + * @return the securityFamily value. + */ + public SecurityFamily securityFamily() { + return this.securityFamily; + } + + /** + * Set the securityFamily property: The security family of the security solution. + * + * @param securityFamily the securityFamily value to set. + * @return the SecuritySolutionsReferenceDataProperties object itself. + */ + public SecuritySolutionsReferenceDataProperties withSecurityFamily(SecurityFamily securityFamily) { + this.securityFamily = securityFamily; + return this; + } + + /** + * Get the alertVendorName property: The security solutions' vendor name. + * + * @return the alertVendorName value. + */ + public String alertVendorName() { + return this.alertVendorName; + } + + /** + * Set the alertVendorName property: The security solutions' vendor name. + * + * @param alertVendorName the alertVendorName value to set. + * @return the SecuritySolutionsReferenceDataProperties object itself. + */ + public SecuritySolutionsReferenceDataProperties withAlertVendorName(String alertVendorName) { + this.alertVendorName = alertVendorName; + return this; + } + + /** + * Get the packageInfoUrl property: The security solutions' package info url. + * + * @return the packageInfoUrl value. + */ + public String packageInfoUrl() { + return this.packageInfoUrl; + } + + /** + * Set the packageInfoUrl property: The security solutions' package info url. + * + * @param packageInfoUrl the packageInfoUrl value to set. + * @return the SecuritySolutionsReferenceDataProperties object itself. + */ + public SecuritySolutionsReferenceDataProperties withPackageInfoUrl(String packageInfoUrl) { + this.packageInfoUrl = packageInfoUrl; + return this; + } + + /** + * Get the productName property: The security solutions' product name. + * + * @return the productName value. + */ + public String productName() { + return this.productName; + } + + /** + * Set the productName property: The security solutions' product name. + * + * @param productName the productName value to set. + * @return the SecuritySolutionsReferenceDataProperties object itself. + */ + public SecuritySolutionsReferenceDataProperties withProductName(String productName) { + this.productName = productName; + return this; + } + + /** + * Get the publisher property: The security solutions' publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The security solutions' publisher. + * + * @param publisher the publisher value to set. + * @return the SecuritySolutionsReferenceDataProperties object itself. + */ + public SecuritySolutionsReferenceDataProperties withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the publisherDisplayName property: The security solutions' publisher display name. + * + * @return the publisherDisplayName value. + */ + public String publisherDisplayName() { + return this.publisherDisplayName; + } + + /** + * Set the publisherDisplayName property: The security solutions' publisher display name. + * + * @param publisherDisplayName the publisherDisplayName value to set. + * @return the SecuritySolutionsReferenceDataProperties object itself. + */ + public SecuritySolutionsReferenceDataProperties withPublisherDisplayName(String publisherDisplayName) { + this.publisherDisplayName = publisherDisplayName; + return this; + } + + /** + * Get the template property: The security solutions' template. + * + * @return the template value. + */ + public String template() { + return this.template; + } + + /** + * Set the template property: The security solutions' template. + * + * @param template the template value to set. + * @return the SecuritySolutionsReferenceDataProperties object itself. + */ + public SecuritySolutionsReferenceDataProperties withTemplate(String template) { + this.template = template; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (securityFamily() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property securityFamily in model SecuritySolutionsReferenceDataProperties")); + } + if (alertVendorName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property alertVendorName in model SecuritySolutionsReferenceDataProperties")); + } + if (packageInfoUrl() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property packageInfoUrl in model SecuritySolutionsReferenceDataProperties")); + } + if (productName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property productName in model SecuritySolutionsReferenceDataProperties")); + } + if (publisher() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publisher in model SecuritySolutionsReferenceDataProperties")); + } + if (publisherDisplayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publisherDisplayName in model" + + " SecuritySolutionsReferenceDataProperties")); + } + if (template() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property template in model SecuritySolutionsReferenceDataProperties")); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentInner.java index 42a0848af5b57..87606a8e78759 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.AdditionalData; @@ -16,78 +15,32 @@ import java.time.OffsetDateTime; /** Security sub-assessment on a resource. */ -@JsonFlatten @Fluent -public class SecuritySubAssessmentInner extends ProxyResource { +public final class SecuritySubAssessmentInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(SecuritySubAssessmentInner.class); /* - * Vulnerability ID + * Describes properties of an sub-assessment. */ - @JsonProperty(value = "properties.id", access = JsonProperty.Access.WRITE_ONLY) - private String idPropertiesId; + @JsonProperty(value = "properties") + private SecuritySubAssessmentProperties innerProperties; - /* - * User friendly display name of the sub-assessment - */ - @JsonProperty(value = "properties.displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /* - * Status of the sub-assessment - */ - @JsonProperty(value = "properties.status") - private SubAssessmentStatus status; - - /* - * Information on how to remediate this sub-assessment - */ - @JsonProperty(value = "properties.remediation", access = JsonProperty.Access.WRITE_ONLY) - private String remediation; - - /* - * Description of the impact of this sub-assessment - */ - @JsonProperty(value = "properties.impact", access = JsonProperty.Access.WRITE_ONLY) - private String impact; - - /* - * Category of the sub-assessment - */ - @JsonProperty(value = "properties.category", access = JsonProperty.Access.WRITE_ONLY) - private String category; - - /* - * Human readable description of the assessment status - */ - @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * The date and time the sub-assessment was generated - */ - @JsonProperty(value = "properties.timeGenerated", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime timeGenerated; - - /* - * Details of the resource that was assessed - */ - @JsonProperty(value = "properties.resourceDetails") - private ResourceDetails resourceDetails; - - /* - * Details of the sub-assessment + /** + * Get the innerProperties property: Describes properties of an sub-assessment. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.additionalData") - private AdditionalData additionalData; + private SecuritySubAssessmentProperties innerProperties() { + return this.innerProperties; + } /** - * Get the idPropertiesId property: Vulnerability ID. + * Get the id property: Vulnerability ID. * - * @return the idPropertiesId value. + * @return the id value. */ public String idPropertiesId() { - return this.idPropertiesId; + return this.innerProperties() == null ? null : this.innerProperties().id(); } /** @@ -96,7 +49,7 @@ public String idPropertiesId() { * @return the displayName value. */ public String displayName() { - return this.displayName; + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** @@ -105,7 +58,7 @@ public String displayName() { * @return the status value. */ public SubAssessmentStatus status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -115,7 +68,10 @@ public SubAssessmentStatus status() { * @return the SecuritySubAssessmentInner object itself. */ public SecuritySubAssessmentInner withStatus(SubAssessmentStatus status) { - this.status = status; + if (this.innerProperties() == null) { + this.innerProperties = new SecuritySubAssessmentProperties(); + } + this.innerProperties().withStatus(status); return this; } @@ -125,7 +81,7 @@ public SecuritySubAssessmentInner withStatus(SubAssessmentStatus status) { * @return the remediation value. */ public String remediation() { - return this.remediation; + return this.innerProperties() == null ? null : this.innerProperties().remediation(); } /** @@ -134,7 +90,7 @@ public String remediation() { * @return the impact value. */ public String impact() { - return this.impact; + return this.innerProperties() == null ? null : this.innerProperties().impact(); } /** @@ -143,7 +99,7 @@ public String impact() { * @return the category value. */ public String category() { - return this.category; + return this.innerProperties() == null ? null : this.innerProperties().category(); } /** @@ -152,7 +108,7 @@ public String category() { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -161,7 +117,7 @@ public String description() { * @return the timeGenerated value. */ public OffsetDateTime timeGenerated() { - return this.timeGenerated; + return this.innerProperties() == null ? null : this.innerProperties().timeGenerated(); } /** @@ -170,7 +126,7 @@ public OffsetDateTime timeGenerated() { * @return the resourceDetails value. */ public ResourceDetails resourceDetails() { - return this.resourceDetails; + return this.innerProperties() == null ? null : this.innerProperties().resourceDetails(); } /** @@ -180,7 +136,10 @@ public ResourceDetails resourceDetails() { * @return the SecuritySubAssessmentInner object itself. */ public SecuritySubAssessmentInner withResourceDetails(ResourceDetails resourceDetails) { - this.resourceDetails = resourceDetails; + if (this.innerProperties() == null) { + this.innerProperties = new SecuritySubAssessmentProperties(); + } + this.innerProperties().withResourceDetails(resourceDetails); return this; } @@ -190,7 +149,7 @@ public SecuritySubAssessmentInner withResourceDetails(ResourceDetails resourceDe * @return the additionalData value. */ public AdditionalData additionalData() { - return this.additionalData; + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); } /** @@ -200,7 +159,10 @@ public AdditionalData additionalData() { * @return the SecuritySubAssessmentInner object itself. */ public SecuritySubAssessmentInner withAdditionalData(AdditionalData additionalData) { - this.additionalData = additionalData; + if (this.innerProperties() == null) { + this.innerProperties = new SecuritySubAssessmentProperties(); + } + this.innerProperties().withAdditionalData(additionalData); return this; } @@ -210,14 +172,8 @@ public SecuritySubAssessmentInner withAdditionalData(AdditionalData additionalDa * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (status() != null) { - status().validate(); - } - if (resourceDetails() != null) { - resourceDetails().validate(); - } - if (additionalData() != null) { - additionalData().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentProperties.java new file mode 100644 index 0000000000000..2c76ab1f81e21 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentProperties.java @@ -0,0 +1,220 @@ +// Copyright (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.AdditionalData; +import com.azure.resourcemanager.security.models.ResourceDetails; +import com.azure.resourcemanager.security.models.SubAssessmentStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Describes properties of an sub-assessment. */ +@Fluent +public final class SecuritySubAssessmentProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecuritySubAssessmentProperties.class); + + /* + * Vulnerability ID + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * User friendly display name of the sub-assessment + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * Status of the sub-assessment + */ + @JsonProperty(value = "status") + private SubAssessmentStatus status; + + /* + * Information on how to remediate this sub-assessment + */ + @JsonProperty(value = "remediation", access = JsonProperty.Access.WRITE_ONLY) + private String remediation; + + /* + * Description of the impact of this sub-assessment + */ + @JsonProperty(value = "impact", access = JsonProperty.Access.WRITE_ONLY) + private String impact; + + /* + * Category of the sub-assessment + */ + @JsonProperty(value = "category", access = JsonProperty.Access.WRITE_ONLY) + private String category; + + /* + * Human readable description of the assessment status + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The date and time the sub-assessment was generated + */ + @JsonProperty(value = "timeGenerated", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timeGenerated; + + /* + * Details of the resource that was assessed + */ + @JsonProperty(value = "resourceDetails") + private ResourceDetails resourceDetails; + + /* + * Details of the sub-assessment + */ + @JsonProperty(value = "additionalData") + private AdditionalData additionalData; + + /** + * Get the id property: Vulnerability ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the displayName property: User friendly display name of the sub-assessment. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the status property: Status of the sub-assessment. + * + * @return the status value. + */ + public SubAssessmentStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the sub-assessment. + * + * @param status the status value to set. + * @return the SecuritySubAssessmentProperties object itself. + */ + public SecuritySubAssessmentProperties withStatus(SubAssessmentStatus status) { + this.status = status; + return this; + } + + /** + * Get the remediation property: Information on how to remediate this sub-assessment. + * + * @return the remediation value. + */ + public String remediation() { + return this.remediation; + } + + /** + * Get the impact property: Description of the impact of this sub-assessment. + * + * @return the impact value. + */ + public String impact() { + return this.impact; + } + + /** + * Get the category property: Category of the sub-assessment. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Get the description property: Human readable description of the assessment status. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the timeGenerated property: The date and time the sub-assessment was generated. + * + * @return the timeGenerated value. + */ + public OffsetDateTime timeGenerated() { + return this.timeGenerated; + } + + /** + * Get the resourceDetails property: Details of the resource that was assessed. + * + * @return the resourceDetails value. + */ + public ResourceDetails resourceDetails() { + return this.resourceDetails; + } + + /** + * Set the resourceDetails property: Details of the resource that was assessed. + * + * @param resourceDetails the resourceDetails value to set. + * @return the SecuritySubAssessmentProperties object itself. + */ + public SecuritySubAssessmentProperties withResourceDetails(ResourceDetails resourceDetails) { + this.resourceDetails = resourceDetails; + return this; + } + + /** + * Get the additionalData property: Details of the sub-assessment. + * + * @return the additionalData value. + */ + public AdditionalData additionalData() { + return this.additionalData; + } + + /** + * Set the additionalData property: Details of the sub-assessment. + * + * @param additionalData the additionalData value to set. + * @return the SecuritySubAssessmentProperties object itself. + */ + public SecuritySubAssessmentProperties withAdditionalData(AdditionalData additionalData) { + this.additionalData = additionalData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() != null) { + status().validate(); + } + if (resourceDetails() != null) { + resourceDetails().validate(); + } + if (additionalData() != null) { + additionalData().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskInner.java index f57df511cb027..15a94999eedfc 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.SecurityTaskParameters; @@ -14,41 +13,24 @@ import java.time.OffsetDateTime; /** Security task that we recommend to do in order to strengthen security. */ -@JsonFlatten @Fluent -public class SecurityTaskInner extends ProxyResource { +public final class SecurityTaskInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityTaskInner.class); /* - * State of the task (Active, Resolved etc.) + * Describes properties of a task. */ - @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) - private String state; + @JsonProperty(value = "properties") + private SecurityTaskProperties innerProperties; - /* - * The time this task was discovered in UTC - */ - @JsonProperty(value = "properties.creationTimeUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime creationTimeUtc; - - /* - * Changing set of properties, depending on the task type that is derived - * from the name field - */ - @JsonProperty(value = "properties.securityTaskParameters") - private SecurityTaskParameters securityTaskParameters; - - /* - * The time this task's details were last changed in UTC - */ - @JsonProperty(value = "properties.lastStateChangeTimeUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastStateChangeTimeUtc; - - /* - * Additional data on the state of the task + /** + * Get the innerProperties property: Describes properties of a task. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.subState", access = JsonProperty.Access.WRITE_ONLY) - private String subState; + private SecurityTaskProperties innerProperties() { + return this.innerProperties; + } /** * Get the state property: State of the task (Active, Resolved etc.). @@ -56,7 +38,7 @@ public class SecurityTaskInner extends ProxyResource { * @return the state value. */ public String state() { - return this.state; + return this.innerProperties() == null ? null : this.innerProperties().state(); } /** @@ -65,7 +47,7 @@ public String state() { * @return the creationTimeUtc value. */ public OffsetDateTime creationTimeUtc() { - return this.creationTimeUtc; + return this.innerProperties() == null ? null : this.innerProperties().creationTimeUtc(); } /** @@ -75,7 +57,7 @@ public OffsetDateTime creationTimeUtc() { * @return the securityTaskParameters value. */ public SecurityTaskParameters securityTaskParameters() { - return this.securityTaskParameters; + return this.innerProperties() == null ? null : this.innerProperties().securityTaskParameters(); } /** @@ -86,7 +68,10 @@ public SecurityTaskParameters securityTaskParameters() { * @return the SecurityTaskInner object itself. */ public SecurityTaskInner withSecurityTaskParameters(SecurityTaskParameters securityTaskParameters) { - this.securityTaskParameters = securityTaskParameters; + if (this.innerProperties() == null) { + this.innerProperties = new SecurityTaskProperties(); + } + this.innerProperties().withSecurityTaskParameters(securityTaskParameters); return this; } @@ -96,7 +81,7 @@ public SecurityTaskInner withSecurityTaskParameters(SecurityTaskParameters secur * @return the lastStateChangeTimeUtc value. */ public OffsetDateTime lastStateChangeTimeUtc() { - return this.lastStateChangeTimeUtc; + return this.innerProperties() == null ? null : this.innerProperties().lastStateChangeTimeUtc(); } /** @@ -105,7 +90,7 @@ public OffsetDateTime lastStateChangeTimeUtc() { * @return the subState value. */ public String subState() { - return this.subState; + return this.innerProperties() == null ? null : this.innerProperties().subState(); } /** @@ -114,8 +99,8 @@ public String subState() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (securityTaskParameters() != null) { - securityTaskParameters().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskProperties.java new file mode 100644 index 0000000000000..b810d75565428 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.SecurityTaskParameters; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Describes properties of a task. */ +@Fluent +public final class SecurityTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityTaskProperties.class); + + /* + * State of the task (Active, Resolved etc.) + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /* + * The time this task was discovered in UTC + */ + @JsonProperty(value = "creationTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTimeUtc; + + /* + * Changing set of properties, depending on the task type that is derived + * from the name field + */ + @JsonProperty(value = "securityTaskParameters") + private SecurityTaskParameters securityTaskParameters; + + /* + * The time this task's details were last changed in UTC + */ + @JsonProperty(value = "lastStateChangeTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastStateChangeTimeUtc; + + /* + * Additional data on the state of the task + */ + @JsonProperty(value = "subState", access = JsonProperty.Access.WRITE_ONLY) + private String subState; + + /** + * Get the state property: State of the task (Active, Resolved etc.). + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Get the creationTimeUtc property: The time this task was discovered in UTC. + * + * @return the creationTimeUtc value. + */ + public OffsetDateTime creationTimeUtc() { + return this.creationTimeUtc; + } + + /** + * Get the securityTaskParameters property: Changing set of properties, depending on the task type that is derived + * from the name field. + * + * @return the securityTaskParameters value. + */ + public SecurityTaskParameters securityTaskParameters() { + return this.securityTaskParameters; + } + + /** + * Set the securityTaskParameters property: Changing set of properties, depending on the task type that is derived + * from the name field. + * + * @param securityTaskParameters the securityTaskParameters value to set. + * @return the SecurityTaskProperties object itself. + */ + public SecurityTaskProperties withSecurityTaskParameters(SecurityTaskParameters securityTaskParameters) { + this.securityTaskParameters = securityTaskParameters; + return this; + } + + /** + * Get the lastStateChangeTimeUtc property: The time this task's details were last changed in UTC. + * + * @return the lastStateChangeTimeUtc value. + */ + public OffsetDateTime lastStateChangeTimeUtc() { + return this.lastStateChangeTimeUtc; + } + + /** + * Get the subState property: Additional data on the state of the task. + * + * @return the subState value. + */ + public String subState() { + return this.subState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (securityTaskParameters() != null) { + securityTaskParameters().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentInner.java index dfd4dfbd378a9..8e5dd0cf089ed 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentInner.java @@ -4,8 +4,7 @@ package com.azure.resourcemanager.security.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentPropertiesProvisioningState; @@ -13,17 +12,24 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** Describes the server vulnerability assessment details on a resource. */ -@JsonFlatten -@Immutable -public class ServerVulnerabilityAssessmentInner extends ProxyResource { +@Fluent +public final class ServerVulnerabilityAssessmentInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerVulnerabilityAssessmentInner.class); /* - * The provisioningState of the vulnerability assessment capability on the - * VM + * describes ServerVulnerabilityAssessment properties. */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ServerVulnerabilityAssessmentPropertiesProvisioningState provisioningState; + @JsonProperty(value = "properties") + private ServerVulnerabilityAssessmentProperties innerProperties; + + /** + * Get the innerProperties property: describes ServerVulnerabilityAssessment properties. + * + * @return the innerProperties value. + */ + private ServerVulnerabilityAssessmentProperties innerProperties() { + return this.innerProperties; + } /** * Get the provisioningState property: The provisioningState of the vulnerability assessment capability on the VM. @@ -31,7 +37,7 @@ public class ServerVulnerabilityAssessmentInner extends ProxyResource { * @return the provisioningState value. */ public ServerVulnerabilityAssessmentPropertiesProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -40,5 +46,8 @@ public ServerVulnerabilityAssessmentPropertiesProvisioningState provisioningStat * @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/ServerVulnerabilityAssessmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentProperties.java new file mode 100644 index 0000000000000..31ddf6ff7422f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentProperties.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentPropertiesProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** describes ServerVulnerabilityAssessment properties. */ +@Immutable +public final class ServerVulnerabilityAssessmentProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerVulnerabilityAssessmentProperties.class); + + /* + * The provisioningState of the vulnerability assessment capability on the + * VM + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ServerVulnerabilityAssessmentPropertiesProvisioningState provisioningState; + + /** + * Get the provisioningState property: The provisioningState of the vulnerability assessment capability on the VM. + * + * @return the provisioningState value. + */ + public ServerVulnerabilityAssessmentPropertiesProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * 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/SoftwareInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SoftwareInner.java index e611818a66c0b..a1204b6f9a190 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SoftwareInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SoftwareInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.EndOfSupportStatus; @@ -13,64 +12,24 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** Represents a software data. */ -@JsonFlatten @Fluent -public class SoftwareInner extends ProxyResource { +public final class SoftwareInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(SoftwareInner.class); /* - * Unique identifier for the virtual machine in the service. + * Properties of the Software Inventory resource */ - @JsonProperty(value = "properties.deviceId") - private String deviceId; + @JsonProperty(value = "properties", required = true) + private SoftwareProperties innerProperties = new SoftwareProperties(); - /* - * Platform of the operating system running on the device. - */ - @JsonProperty(value = "properties.osPlatform") - private String osPlatform; - - /* - * Name of the software vendor. - */ - @JsonProperty(value = "properties.vendor") - private String vendor; - - /* - * Name of the software product. - */ - @JsonProperty(value = "properties.softwareName") - private String softwareName; - - /* - * Version number of the software product. - */ - @JsonProperty(value = "properties.version") - private String version; - - /* - * End of support status. - */ - @JsonProperty(value = "properties.endOfSupportStatus") - private EndOfSupportStatus endOfSupportStatus; - - /* - * The end of support date in case the product is upcoming end of support. - */ - @JsonProperty(value = "properties.endOfSupportDate") - private String endOfSupportDate; - - /* - * Number of weaknesses. - */ - @JsonProperty(value = "properties.numberOfKnownVulnerabilities") - private Integer numberOfKnownVulnerabilities; - - /* - * First time that the software was seen in the device. + /** + * Get the innerProperties property: Properties of the Software Inventory resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.firstSeenAt") - private String firstSeenAt; + private SoftwareProperties innerProperties() { + return this.innerProperties; + } /** * Get the deviceId property: Unique identifier for the virtual machine in the service. @@ -78,7 +37,7 @@ public class SoftwareInner extends ProxyResource { * @return the deviceId value. */ public String deviceId() { - return this.deviceId; + return this.innerProperties() == null ? null : this.innerProperties().deviceId(); } /** @@ -88,7 +47,10 @@ public String deviceId() { * @return the SoftwareInner object itself. */ public SoftwareInner withDeviceId(String deviceId) { - this.deviceId = deviceId; + if (this.innerProperties() == null) { + this.innerProperties = new SoftwareProperties(); + } + this.innerProperties().withDeviceId(deviceId); return this; } @@ -98,7 +60,7 @@ public SoftwareInner withDeviceId(String deviceId) { * @return the osPlatform value. */ public String osPlatform() { - return this.osPlatform; + return this.innerProperties() == null ? null : this.innerProperties().osPlatform(); } /** @@ -108,7 +70,10 @@ public String osPlatform() { * @return the SoftwareInner object itself. */ public SoftwareInner withOsPlatform(String osPlatform) { - this.osPlatform = osPlatform; + if (this.innerProperties() == null) { + this.innerProperties = new SoftwareProperties(); + } + this.innerProperties().withOsPlatform(osPlatform); return this; } @@ -118,7 +83,7 @@ public SoftwareInner withOsPlatform(String osPlatform) { * @return the vendor value. */ public String vendor() { - return this.vendor; + return this.innerProperties() == null ? null : this.innerProperties().vendor(); } /** @@ -128,7 +93,10 @@ public String vendor() { * @return the SoftwareInner object itself. */ public SoftwareInner withVendor(String vendor) { - this.vendor = vendor; + if (this.innerProperties() == null) { + this.innerProperties = new SoftwareProperties(); + } + this.innerProperties().withVendor(vendor); return this; } @@ -138,7 +106,7 @@ public SoftwareInner withVendor(String vendor) { * @return the softwareName value. */ public String softwareName() { - return this.softwareName; + return this.innerProperties() == null ? null : this.innerProperties().softwareName(); } /** @@ -148,7 +116,10 @@ public String softwareName() { * @return the SoftwareInner object itself. */ public SoftwareInner withSoftwareName(String softwareName) { - this.softwareName = softwareName; + if (this.innerProperties() == null) { + this.innerProperties = new SoftwareProperties(); + } + this.innerProperties().withSoftwareName(softwareName); return this; } @@ -158,7 +129,7 @@ public SoftwareInner withSoftwareName(String softwareName) { * @return the version value. */ public String version() { - return this.version; + return this.innerProperties() == null ? null : this.innerProperties().version(); } /** @@ -168,7 +139,10 @@ public String version() { * @return the SoftwareInner object itself. */ public SoftwareInner withVersion(String version) { - this.version = version; + if (this.innerProperties() == null) { + this.innerProperties = new SoftwareProperties(); + } + this.innerProperties().withVersion(version); return this; } @@ -178,7 +152,7 @@ public SoftwareInner withVersion(String version) { * @return the endOfSupportStatus value. */ public EndOfSupportStatus endOfSupportStatus() { - return this.endOfSupportStatus; + return this.innerProperties() == null ? null : this.innerProperties().endOfSupportStatus(); } /** @@ -188,7 +162,10 @@ public EndOfSupportStatus endOfSupportStatus() { * @return the SoftwareInner object itself. */ public SoftwareInner withEndOfSupportStatus(EndOfSupportStatus endOfSupportStatus) { - this.endOfSupportStatus = endOfSupportStatus; + if (this.innerProperties() == null) { + this.innerProperties = new SoftwareProperties(); + } + this.innerProperties().withEndOfSupportStatus(endOfSupportStatus); return this; } @@ -198,7 +175,7 @@ public SoftwareInner withEndOfSupportStatus(EndOfSupportStatus endOfSupportStatu * @return the endOfSupportDate value. */ public String endOfSupportDate() { - return this.endOfSupportDate; + return this.innerProperties() == null ? null : this.innerProperties().endOfSupportDate(); } /** @@ -208,7 +185,10 @@ public String endOfSupportDate() { * @return the SoftwareInner object itself. */ public SoftwareInner withEndOfSupportDate(String endOfSupportDate) { - this.endOfSupportDate = endOfSupportDate; + if (this.innerProperties() == null) { + this.innerProperties = new SoftwareProperties(); + } + this.innerProperties().withEndOfSupportDate(endOfSupportDate); return this; } @@ -218,7 +198,7 @@ public SoftwareInner withEndOfSupportDate(String endOfSupportDate) { * @return the numberOfKnownVulnerabilities value. */ public Integer numberOfKnownVulnerabilities() { - return this.numberOfKnownVulnerabilities; + return this.innerProperties() == null ? null : this.innerProperties().numberOfKnownVulnerabilities(); } /** @@ -228,7 +208,10 @@ public Integer numberOfKnownVulnerabilities() { * @return the SoftwareInner object itself. */ public SoftwareInner withNumberOfKnownVulnerabilities(Integer numberOfKnownVulnerabilities) { - this.numberOfKnownVulnerabilities = numberOfKnownVulnerabilities; + if (this.innerProperties() == null) { + this.innerProperties = new SoftwareProperties(); + } + this.innerProperties().withNumberOfKnownVulnerabilities(numberOfKnownVulnerabilities); return this; } @@ -238,7 +221,7 @@ public SoftwareInner withNumberOfKnownVulnerabilities(Integer numberOfKnownVulne * @return the firstSeenAt value. */ public String firstSeenAt() { - return this.firstSeenAt; + return this.innerProperties() == null ? null : this.innerProperties().firstSeenAt(); } /** @@ -248,7 +231,10 @@ public String firstSeenAt() { * @return the SoftwareInner object itself. */ public SoftwareInner withFirstSeenAt(String firstSeenAt) { - this.firstSeenAt = firstSeenAt; + if (this.innerProperties() == null) { + this.innerProperties = new SoftwareProperties(); + } + this.innerProperties().withFirstSeenAt(firstSeenAt); return this; } @@ -258,5 +244,12 @@ public SoftwareInner withFirstSeenAt(String firstSeenAt) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model SoftwareInner")); + } else { + innerProperties().validate(); + } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SoftwareProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SoftwareProperties.java new file mode 100644 index 0000000000000..274acb00d1272 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SoftwareProperties.java @@ -0,0 +1,259 @@ +// Copyright (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.EndOfSupportStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Software Inventory resource properties. */ +@Fluent +public final class SoftwareProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SoftwareProperties.class); + + /* + * Unique identifier for the virtual machine in the service. + */ + @JsonProperty(value = "deviceId") + private String deviceId; + + /* + * Platform of the operating system running on the device. + */ + @JsonProperty(value = "osPlatform") + private String osPlatform; + + /* + * Name of the software vendor. + */ + @JsonProperty(value = "vendor") + private String vendor; + + /* + * Name of the software product. + */ + @JsonProperty(value = "softwareName") + private String softwareName; + + /* + * Version number of the software product. + */ + @JsonProperty(value = "version") + private String version; + + /* + * End of support status. + */ + @JsonProperty(value = "endOfSupportStatus") + private EndOfSupportStatus endOfSupportStatus; + + /* + * The end of support date in case the product is upcoming end of support. + */ + @JsonProperty(value = "endOfSupportDate") + private String endOfSupportDate; + + /* + * Number of weaknesses. + */ + @JsonProperty(value = "numberOfKnownVulnerabilities") + private Integer numberOfKnownVulnerabilities; + + /* + * First time that the software was seen in the device. + */ + @JsonProperty(value = "firstSeenAt") + private String firstSeenAt; + + /** + * Get the deviceId property: Unique identifier for the virtual machine in the service. + * + * @return the deviceId value. + */ + public String deviceId() { + return this.deviceId; + } + + /** + * Set the deviceId property: Unique identifier for the virtual machine in the service. + * + * @param deviceId the deviceId value to set. + * @return the SoftwareProperties object itself. + */ + public SoftwareProperties withDeviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + /** + * Get the osPlatform property: Platform of the operating system running on the device. + * + * @return the osPlatform value. + */ + public String osPlatform() { + return this.osPlatform; + } + + /** + * Set the osPlatform property: Platform of the operating system running on the device. + * + * @param osPlatform the osPlatform value to set. + * @return the SoftwareProperties object itself. + */ + public SoftwareProperties withOsPlatform(String osPlatform) { + this.osPlatform = osPlatform; + return this; + } + + /** + * Get the vendor property: Name of the software vendor. + * + * @return the vendor value. + */ + public String vendor() { + return this.vendor; + } + + /** + * Set the vendor property: Name of the software vendor. + * + * @param vendor the vendor value to set. + * @return the SoftwareProperties object itself. + */ + public SoftwareProperties withVendor(String vendor) { + this.vendor = vendor; + return this; + } + + /** + * Get the softwareName property: Name of the software product. + * + * @return the softwareName value. + */ + public String softwareName() { + return this.softwareName; + } + + /** + * Set the softwareName property: Name of the software product. + * + * @param softwareName the softwareName value to set. + * @return the SoftwareProperties object itself. + */ + public SoftwareProperties withSoftwareName(String softwareName) { + this.softwareName = softwareName; + return this; + } + + /** + * Get the version property: Version number of the software product. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version number of the software product. + * + * @param version the version value to set. + * @return the SoftwareProperties object itself. + */ + public SoftwareProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the endOfSupportStatus property: End of support status. + * + * @return the endOfSupportStatus value. + */ + public EndOfSupportStatus endOfSupportStatus() { + return this.endOfSupportStatus; + } + + /** + * Set the endOfSupportStatus property: End of support status. + * + * @param endOfSupportStatus the endOfSupportStatus value to set. + * @return the SoftwareProperties object itself. + */ + public SoftwareProperties withEndOfSupportStatus(EndOfSupportStatus endOfSupportStatus) { + this.endOfSupportStatus = endOfSupportStatus; + return this; + } + + /** + * Get the endOfSupportDate property: The end of support date in case the product is upcoming end of support. + * + * @return the endOfSupportDate value. + */ + public String endOfSupportDate() { + return this.endOfSupportDate; + } + + /** + * Set the endOfSupportDate property: The end of support date in case the product is upcoming end of support. + * + * @param endOfSupportDate the endOfSupportDate value to set. + * @return the SoftwareProperties object itself. + */ + public SoftwareProperties withEndOfSupportDate(String endOfSupportDate) { + this.endOfSupportDate = endOfSupportDate; + return this; + } + + /** + * Get the numberOfKnownVulnerabilities property: Number of weaknesses. + * + * @return the numberOfKnownVulnerabilities value. + */ + public Integer numberOfKnownVulnerabilities() { + return this.numberOfKnownVulnerabilities; + } + + /** + * Set the numberOfKnownVulnerabilities property: Number of weaknesses. + * + * @param numberOfKnownVulnerabilities the numberOfKnownVulnerabilities value to set. + * @return the SoftwareProperties object itself. + */ + public SoftwareProperties withNumberOfKnownVulnerabilities(Integer numberOfKnownVulnerabilities) { + this.numberOfKnownVulnerabilities = numberOfKnownVulnerabilities; + return this; + } + + /** + * Get the firstSeenAt property: First time that the software was seen in the device. + * + * @return the firstSeenAt value. + */ + public String firstSeenAt() { + return this.firstSeenAt; + } + + /** + * Set the firstSeenAt property: First time that the software was seen in the device. + * + * @param firstSeenAt the firstSeenAt value to set. + * @return the SoftwareProperties object itself. + */ + public SoftwareProperties withFirstSeenAt(String firstSeenAt) { + this.firstSeenAt = firstSeenAt; + 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/TopologyResourceInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceInner.java index 3bfee519e2c31..1055950774b7c 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.TopologySingleResource; @@ -15,22 +14,15 @@ import java.util.List; /** The TopologyResource model. */ -@JsonFlatten @Immutable -public class TopologyResourceInner extends ProxyResource { +public final class TopologyResourceInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(TopologyResourceInner.class); /* - * The UTC time on which the topology was calculated + * The properties property. */ - @JsonProperty(value = "properties.calculatedDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime calculatedDateTime; - - /* - * Azure resources which are part of this topology resource - */ - @JsonProperty(value = "properties.topologyResources", access = JsonProperty.Access.WRITE_ONLY) - private List topologyResources; + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private TopologyResourceProperties innerProperties; /* * Location where the resource is stored @@ -38,13 +30,31 @@ public class TopologyResourceInner extends ProxyResource { @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) private String location; + /** + * Get the innerProperties property: The properties property. + * + * @return the innerProperties value. + */ + private TopologyResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the location property: Location where the resource is stored. + * + * @return the location value. + */ + public String location() { + return this.location; + } + /** * Get the calculatedDateTime property: The UTC time on which the topology was calculated. * * @return the calculatedDateTime value. */ public OffsetDateTime calculatedDateTime() { - return this.calculatedDateTime; + return this.innerProperties() == null ? null : this.innerProperties().calculatedDateTime(); } /** @@ -53,16 +63,7 @@ public OffsetDateTime calculatedDateTime() { * @return the topologyResources value. */ public List topologyResources() { - return this.topologyResources; - } - - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; + return this.innerProperties() == null ? null : this.innerProperties().topologyResources(); } /** @@ -71,8 +72,8 @@ public String location() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (topologyResources() != null) { - topologyResources().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceProperties.java new file mode 100644 index 0000000000000..d4763393bc927 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceProperties.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.models.TopologySingleResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The TopologyResourceProperties model. */ +@Immutable +public final class TopologyResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TopologyResourceProperties.class); + + /* + * The UTC time on which the topology was calculated + */ + @JsonProperty(value = "calculatedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime calculatedDateTime; + + /* + * Azure resources which are part of this topology resource + */ + @JsonProperty(value = "topologyResources", access = JsonProperty.Access.WRITE_ONLY) + private List topologyResources; + + /** + * Get the calculatedDateTime property: The UTC time on which the topology was calculated. + * + * @return the calculatedDateTime value. + */ + public OffsetDateTime calculatedDateTime() { + return this.calculatedDateTime; + } + + /** + * Get the topologyResources property: Azure resources which are part of this topology resource. + * + * @return the topologyResources value. + */ + public List topologyResources() { + return this.topologyResources; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (topologyResources() != null) { + topologyResources().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/UpdateIoTSecuritySolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/UpdateIoTSecuritySolutionProperties.java new file mode 100644 index 0000000000000..3def868c13c08 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/UpdateIoTSecuritySolutionProperties.java @@ -0,0 +1,87 @@ +// Copyright (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.RecommendationConfigurationProperties; +import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Update Security Solution setting data. */ +@Fluent +public final class UpdateIoTSecuritySolutionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateIoTSecuritySolutionProperties.class); + + /* + * Properties of the IoT Security solution's user defined resources. + */ + @JsonProperty(value = "userDefinedResources") + private UserDefinedResourcesProperties userDefinedResources; + + /* + * List of the configuration status for each recommendation type. + */ + @JsonProperty(value = "recommendationsConfiguration") + private List recommendationsConfiguration; + + /** + * Get the userDefinedResources property: Properties of the IoT Security solution's user defined resources. + * + * @return the userDefinedResources value. + */ + public UserDefinedResourcesProperties userDefinedResources() { + return this.userDefinedResources; + } + + /** + * Set the userDefinedResources property: Properties of the IoT Security solution's user defined resources. + * + * @param userDefinedResources the userDefinedResources value to set. + * @return the UpdateIoTSecuritySolutionProperties object itself. + */ + public UpdateIoTSecuritySolutionProperties withUserDefinedResources( + UserDefinedResourcesProperties userDefinedResources) { + this.userDefinedResources = userDefinedResources; + return this; + } + + /** + * Get the recommendationsConfiguration property: List of the configuration status for each recommendation type. + * + * @return the recommendationsConfiguration value. + */ + public List recommendationsConfiguration() { + return this.recommendationsConfiguration; + } + + /** + * Set the recommendationsConfiguration property: List of the configuration status for each recommendation type. + * + * @param recommendationsConfiguration the recommendationsConfiguration value to set. + * @return the UpdateIoTSecuritySolutionProperties object itself. + */ + public UpdateIoTSecuritySolutionProperties withRecommendationsConfiguration( + List recommendationsConfiguration) { + this.recommendationsConfiguration = recommendationsConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userDefinedResources() != null) { + userDefinedResources().validate(); + } + if (recommendationsConfiguration() != null) { + recommendationsConfiguration().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingInner.java index cb05d4a43e9a2..dd675a7d0ee21 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingInner.java @@ -5,30 +5,30 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Configures where to store the OMS agent data for workspaces under a scope. */ -@JsonFlatten @Fluent -public class WorkspaceSettingInner extends ProxyResource { +public final class WorkspaceSettingInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspaceSettingInner.class); /* - * The full Azure ID of the workspace to save the data in + * Workspace setting data */ - @JsonProperty(value = "properties.workspaceId") - private String workspaceId; + @JsonProperty(value = "properties") + private WorkspaceSettingProperties innerProperties; - /* - * All the VMs in this scope will send their security data to the mentioned - * workspace unless overridden by a setting with more specific scope + /** + * Get the innerProperties property: Workspace setting data. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.scope") - private String scope; + private WorkspaceSettingProperties innerProperties() { + return this.innerProperties; + } /** * Get the workspaceId property: The full Azure ID of the workspace to save the data in. @@ -36,7 +36,7 @@ public class WorkspaceSettingInner extends ProxyResource { * @return the workspaceId value. */ public String workspaceId() { - return this.workspaceId; + return this.innerProperties() == null ? null : this.innerProperties().workspaceId(); } /** @@ -46,7 +46,10 @@ public String workspaceId() { * @return the WorkspaceSettingInner object itself. */ public WorkspaceSettingInner withWorkspaceId(String workspaceId) { - this.workspaceId = workspaceId; + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceSettingProperties(); + } + this.innerProperties().withWorkspaceId(workspaceId); return this; } @@ -57,7 +60,7 @@ public WorkspaceSettingInner withWorkspaceId(String workspaceId) { * @return the scope value. */ public String scope() { - return this.scope; + return this.innerProperties() == null ? null : this.innerProperties().scope(); } /** @@ -68,7 +71,10 @@ public String scope() { * @return the WorkspaceSettingInner object itself. */ public WorkspaceSettingInner withScope(String scope) { - this.scope = scope; + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceSettingProperties(); + } + this.innerProperties().withScope(scope); return this; } @@ -78,5 +84,8 @@ public WorkspaceSettingInner withScope(String scope) { * @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/WorkspaceSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingProperties.java new file mode 100644 index 0000000000000..9e87a0b8b7d42 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Workspace setting data. */ +@Fluent +public final class WorkspaceSettingProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspaceSettingProperties.class); + + /* + * The full Azure ID of the workspace to save the data in + */ + @JsonProperty(value = "workspaceId", required = true) + private String workspaceId; + + /* + * All the VMs in this scope will send their security data to the mentioned + * workspace unless overridden by a setting with more specific scope + */ + @JsonProperty(value = "scope", required = true) + private String scope; + + /** + * Get the workspaceId property: The full Azure ID of the workspace to save the data in. + * + * @return the workspaceId value. + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspaceId property: The full Azure ID of the workspace to save the data in. + * + * @param workspaceId the workspaceId value to set. + * @return the WorkspaceSettingProperties object itself. + */ + public WorkspaceSettingProperties withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the scope property: All the VMs in this scope will send their security data to the mentioned workspace unless + * overridden by a setting with more specific scope. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: All the VMs in this scope will send their security data to the mentioned workspace unless + * overridden by a setting with more specific scope. + * + * @param scope the scope value to set. + * @return the WorkspaceSettingProperties object itself. + */ + public WorkspaceSettingProperties withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (workspaceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property workspaceId in model WorkspaceSettingProperties")); + } + if (scope() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property scope in model WorkspaceSettingProperties")); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlGroupImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlGroupImpl.java index c9bc9b6d36beb..dac890dface45 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlGroupImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlGroupImpl.java @@ -39,6 +39,10 @@ public String type() { return this.innerModel().type(); } + public String location() { + return this.innerModel().location(); + } + public EnforcementMode enforcementMode() { return this.innerModel().enforcementMode(); } @@ -86,10 +90,6 @@ public List pathRecommendations() { } } - public String location() { - return this.innerModel().location(); - } - public Region region() { return Region.fromName(this.regionName()); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlsImpl.java index 3908d6084e7b3..2e30297744a34 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlsImpl.java @@ -146,7 +146,7 @@ public void deleteById(String id) { "The resource ID '%s' is not valid. Missing path segment 'applicationWhitelistings'.", id))); } - this.deleteWithResponse(ascLocation, groupName, Context.NONE).getValue(); + this.deleteWithResponse(ascLocation, groupName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningsClientImpl.java index ea098b6e794a6..f0cfa5228248e 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningsClientImpl.java @@ -779,7 +779,7 @@ private Mono>> enforceWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginEnforceAsync( String resourceGroupName, String resourceNamespace, @@ -797,7 +797,8 @@ private PollerFlux, Void> beginEnforceAsync( body); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -816,7 +817,7 @@ private PollerFlux, Void> beginEnforceAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginEnforceAsync( String resourceGroupName, String resourceNamespace, @@ -855,7 +856,7 @@ private PollerFlux, Void> beginEnforceAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginEnforce( String resourceGroupName, String resourceNamespace, @@ -889,7 +890,7 @@ public SyncPoller, Void> beginEnforce( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginEnforce( String resourceGroupName, String resourceNamespace, diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java index 3739ecb90aa4a..0c7d98ded3cc4 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java @@ -2346,13 +2346,14 @@ private Mono>> simulateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginSimulateAsync( String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody) { Mono>> mono = simulateWithResponseAsync(ascLocation, alertSimulatorRequestBody); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -2367,7 +2368,7 @@ private PollerFlux, Void> beginSimulateAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginSimulateAsync( String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody, Context context) { context = this.client.mergeContext(context); @@ -2389,7 +2390,7 @@ private PollerFlux, Void> beginSimulateAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginSimulate( String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody) { return beginSimulateAsync(ascLocation, alertSimulatorRequestBody).getSyncPoller(); @@ -2407,7 +2408,7 @@ public SyncPoller, Void> beginSimulate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginSimulate( String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody, Context context) { return beginSimulateAsync(ascLocation, alertSimulatorRequestBody, context).getSyncPoller(); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsResourceImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsResourceImpl.java index 81e391fcebcdd..f53610805f1b2 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsResourceImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsResourceImpl.java @@ -35,6 +35,10 @@ public String type() { return this.innerModel().type(); } + public String location() { + return this.innerModel().location(); + } + public OffsetDateTime calculatedDateTime() { return this.innerModel().calculatedDateTime(); } @@ -48,10 +52,6 @@ public List connectableResources() { } } - public String location() { - return this.innerModel().location(); - } - public AllowedConnectionsResourceInner innerModel() { return this.innerObject; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsClientImpl.java index 8d3ba78f14a65..5b4149115bfdc 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsClientImpl.java @@ -30,8 +30,9 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.fluent.AssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentInner; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner; import com.azure.resourcemanager.security.models.ExpandEnum; +import com.azure.resourcemanager.security.models.SecurityAssessment; import com.azure.resourcemanager.security.models.SecurityAssessmentList; import reactor.core.publisher.Mono; @@ -78,7 +79,7 @@ Mono> list( @Get("/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( + Mono> get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceId", encoded = true) String resourceId, @@ -91,12 +92,12 @@ Mono> get( @Put("/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( + Mono> createOrUpdate( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceId", encoded = true) String resourceId, @PathParam("assessmentName") String assessmentName, - @BodyParam("application/json") SecurityAssessmentInner assessment, + @BodyParam("application/json") SecurityAssessment assessment, @HeaderParam("Accept") String accept, Context context); @@ -134,7 +135,7 @@ Mono> listNext( * @return security assessments on all your scanned resources inside a scope. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { + private Mono> listSinglePageAsync(String scope) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -144,11 +145,11 @@ private Mono> listSinglePageAsync(String if (scope == null) { return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -172,7 +173,7 @@ private Mono> listSinglePageAsync(String * @return security assessments on all your scanned resources inside a scope. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, Context context) { + private Mono> listSinglePageAsync(String scope, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -182,7 +183,7 @@ private Mono> listSinglePageAsync(String if (scope == null) { return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -209,7 +210,7 @@ private Mono> listSinglePageAsync(String * @return security assessments on all your scanned resources inside a scope. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { + private PagedFlux listAsync(String scope) { return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -225,7 +226,7 @@ private PagedFlux listAsync(String scope) { * @return security assessments on all your scanned resources inside a scope. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { + private PagedFlux listAsync(String scope, Context context) { return new PagedFlux<>( () -> listSinglePageAsync(scope, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -241,7 +242,7 @@ private PagedFlux listAsync(String scope, Context conte * @return security assessments on all your scanned resources inside a scope. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { + public PagedIterable list(String scope) { return new PagedIterable<>(listAsync(scope)); } @@ -257,7 +258,7 @@ public PagedIterable list(String scope) { * @return security assessments on all your scanned resources inside a scope. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { + public PagedIterable list(String scope, Context context) { return new PagedIterable<>(listAsync(scope, context)); } @@ -273,7 +274,7 @@ public PagedIterable list(String scope, Context context * @return a security assessment on your scanned resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( + private Mono> getWithResponseAsync( String resourceId, String assessmentName, ExpandEnum expand) { if (this.client.getEndpoint() == null) { return Mono @@ -287,7 +288,7 @@ private Mono> getWithResponseAsync( if (assessmentName == null) { return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -311,7 +312,7 @@ private Mono> getWithResponseAsync( * @return a security assessment on your scanned resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( + private Mono> getWithResponseAsync( String resourceId, String assessmentName, ExpandEnum expand, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -325,7 +326,7 @@ private Mono> getWithResponseAsync( if (assessmentName == null) { return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), apiVersion, resourceId, assessmentName, expand, accept, context); @@ -343,10 +344,11 @@ private Mono> getWithResponseAsync( * @return a security assessment on your scanned resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId, String assessmentName, ExpandEnum expand) { + private Mono getAsync( + String resourceId, String assessmentName, ExpandEnum expand) { return getWithResponseAsync(resourceId, assessmentName, expand) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -366,11 +368,11 @@ private Mono getAsync(String resourceId, String assessm * @return a security assessment on your scanned resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId, String assessmentName) { + private Mono getAsync(String resourceId, String assessmentName) { final ExpandEnum expand = null; return getWithResponseAsync(resourceId, assessmentName, expand) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -390,7 +392,7 @@ private Mono getAsync(String resourceId, String assessm * @return a security assessment on your scanned resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentInner get(String resourceId, String assessmentName) { + public SecurityAssessmentResponseInner get(String resourceId, String assessmentName) { final ExpandEnum expand = null; return getAsync(resourceId, assessmentName, expand).block(); } @@ -408,7 +410,7 @@ public SecurityAssessmentInner get(String resourceId, String assessmentName) { * @return a security assessment on your scanned resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( + public Response getWithResponse( String resourceId, String assessmentName, ExpandEnum expand, Context context) { return getWithResponseAsync(resourceId, assessmentName, expand, context).block(); } @@ -423,11 +425,11 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment on a resource. + * @return security assessment on a resource - response format. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceId, String assessmentName, SecurityAssessmentInner assessment) { + private Mono> createOrUpdateWithResponseAsync( + String resourceId, String assessmentName, SecurityAssessment assessment) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -445,7 +447,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { assessment.validate(); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -473,11 +475,11 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment on a resource. + * @return security assessment on a resource - response format. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceId, String assessmentName, SecurityAssessmentInner assessment, Context context) { + private Mono> createOrUpdateWithResponseAsync( + String resourceId, String assessmentName, SecurityAssessment assessment, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -495,7 +497,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { assessment.validate(); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -513,14 +515,14 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment on a resource. + * @return security assessment on a resource - response format. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceId, String assessmentName, SecurityAssessmentInner assessment) { + private Mono createOrUpdateAsync( + String resourceId, String assessmentName, SecurityAssessment assessment) { return createOrUpdateWithResponseAsync(resourceId, assessmentName, assessment) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -539,11 +541,11 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment on a resource. + * @return security assessment on a resource - response format. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentInner createOrUpdate( - String resourceId, String assessmentName, SecurityAssessmentInner assessment) { + public SecurityAssessmentResponseInner createOrUpdate( + String resourceId, String assessmentName, SecurityAssessment assessment) { return createOrUpdateAsync(resourceId, assessmentName, assessment).block(); } @@ -558,11 +560,11 @@ public SecurityAssessmentInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment on a resource. + * @return security assessment on a resource - response format. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceId, String assessmentName, SecurityAssessmentInner assessment, Context context) { + public Response createOrUpdateWithResponse( + String resourceId, String assessmentName, SecurityAssessment assessment, Context context) { return createOrUpdateWithResponseAsync(resourceId, assessmentName, assessment, context).block(); } @@ -591,7 +593,7 @@ private Mono> deleteWithResponseAsync(String resourceId, String a if (assessmentName == null) { return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -626,7 +628,7 @@ private Mono> deleteWithResponseAsync(String resourceId, String a if (assessmentName == null) { return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), apiVersion, resourceId, assessmentName, accept, context); @@ -690,7 +692,7 @@ public Response deleteWithResponse(String resourceId, String assessmentNam * @return page of a security assessments list. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -703,7 +705,7 @@ private Mono> listNextSinglePageAsync(Str final String accept = "application/json"; return FluxUtil .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -726,7 +728,8 @@ private Mono> listNextSinglePageAsync(Str * @return page of a security assessments list. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsImpl.java index 28f8bba8be035..00b9de7d47b7e 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsImpl.java @@ -10,10 +10,10 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.fluent.AssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentInner; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner; import com.azure.resourcemanager.security.models.Assessments; import com.azure.resourcemanager.security.models.ExpandEnum; -import com.azure.resourcemanager.security.models.SecurityAssessment; +import com.azure.resourcemanager.security.models.SecurityAssessmentResponse; import com.fasterxml.jackson.annotation.JsonIgnore; public final class AssessmentsImpl implements Assessments { @@ -29,35 +29,35 @@ public AssessmentsImpl( this.serviceManager = serviceManager; } - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new SecurityAssessmentImpl(inner1, this.manager())); + public PagedIterable list(String scope) { + PagedIterable inner = this.serviceClient().list(scope); + return Utils.mapPage(inner, inner1 -> new SecurityAssessmentResponseImpl(inner1, this.manager())); } - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return Utils.mapPage(inner, inner1 -> new SecurityAssessmentImpl(inner1, this.manager())); + public PagedIterable list(String scope, Context context) { + PagedIterable inner = this.serviceClient().list(scope, context); + return Utils.mapPage(inner, inner1 -> new SecurityAssessmentResponseImpl(inner1, this.manager())); } - public SecurityAssessment get(String resourceId, String assessmentName) { - SecurityAssessmentInner inner = this.serviceClient().get(resourceId, assessmentName); + public SecurityAssessmentResponse get(String resourceId, String assessmentName) { + SecurityAssessmentResponseInner inner = this.serviceClient().get(resourceId, assessmentName); if (inner != null) { - return new SecurityAssessmentImpl(inner, this.manager()); + return new SecurityAssessmentResponseImpl(inner, this.manager()); } else { return null; } } - public Response getWithResponse( + public Response getWithResponse( String resourceId, String assessmentName, ExpandEnum expand, Context context) { - Response inner = + Response inner = this.serviceClient().getWithResponse(resourceId, assessmentName, expand, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityAssessmentImpl(inner.getValue(), this.manager())); + new SecurityAssessmentResponseImpl(inner.getValue(), this.manager())); } else { return null; } @@ -71,7 +71,7 @@ public Response deleteWithResponse(String resourceId, String assessmentNam return this.serviceClient().deleteWithResponse(resourceId, assessmentName, context); } - public SecurityAssessment getById(String id) { + public SecurityAssessmentResponse getById(String id) { String resourceId = Utils .getValueFromIdByParameterName( @@ -96,7 +96,7 @@ public SecurityAssessment getById(String id) { return this.getWithResponse(resourceId, assessmentName, localExpand, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, ExpandEnum expand, Context context) { + public Response getByIdWithResponse(String id, ExpandEnum expand, Context context) { String resourceId = Utils .getValueFromIdByParameterName( @@ -141,7 +141,7 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); } - this.deleteWithResponse(resourceId, assessmentName, Context.NONE).getValue(); + this.deleteWithResponse(resourceId, assessmentName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { @@ -176,7 +176,7 @@ private com.azure.resourcemanager.security.SecurityManager manager() { return this.serviceManager; } - public SecurityAssessmentImpl define(String name) { - return new SecurityAssessmentImpl(name, this.manager()); + public SecurityAssessmentResponseImpl define(String name) { + return new SecurityAssessmentResponseImpl(name, this.manager()); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasClientImpl.java index ac3a2f2b5cae3..941842a8074af 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasClientImpl.java @@ -30,8 +30,8 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.fluent.AssessmentsMetadatasClient; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataInner; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataList; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner; +import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataResponseList; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in AssessmentsMetadatasClient. */ @@ -67,7 +67,7 @@ private interface AssessmentsMetadatasService { @Get("/providers/Microsoft.Security/assessmentMetadata") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -77,7 +77,7 @@ Mono> list( @Get("/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( + Mono> get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("assessmentMetadataName") String assessmentMetadataName, @@ -88,7 +88,7 @@ Mono> get( @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscription( + Mono> listBySubscription( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -99,7 +99,7 @@ Mono> listBySubscription( @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getInSubscription( + Mono> getInSubscription( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("assessmentMetadataName") String assessmentMetadataName, @@ -111,12 +111,12 @@ Mono> getInSubscription( @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createInSubscription( + Mono> createInSubscription( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("assessmentMetadataName") String assessmentMetadataName, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") SecurityAssessmentMetadataInner assessmentMetadata, + @BodyParam("application/json") SecurityAssessmentMetadataResponseInner assessmentMetadata, @HeaderParam("Accept") String accept, Context context); @@ -137,7 +137,7 @@ Mono> deleteInSubscription( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -147,7 +147,7 @@ Mono> listNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( + Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -162,18 +162,18 @@ Mono> listBySubscriptionNext( * @return metadata information on all assessment types. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -195,14 +195,14 @@ private Mono> listSinglePageAsync * @return metadata information on all assessment types. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -226,7 +226,7 @@ private Mono> listSinglePageAsync * @return metadata information on all assessment types. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { + private PagedFlux listAsync() { return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -240,7 +240,7 @@ private PagedFlux listAsync() { * @return metadata information on all assessment types. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { + private PagedFlux listAsync(Context context) { return new PagedFlux<>( () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -253,7 +253,7 @@ private PagedFlux listAsync(Context context) { * @return metadata information on all assessment types. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { + public PagedIterable list() { return new PagedIterable<>(listAsync()); } @@ -267,7 +267,7 @@ public PagedIterable list() { * @return metadata information on all assessment types. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { + public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } @@ -281,7 +281,8 @@ public PagedIterable list(Context context) { * @return metadata information on an assessment type. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String assessmentMetadataName) { + private Mono> getWithResponseAsync( + String assessmentMetadataName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -293,7 +294,7 @@ private Mono> getWithResponseAsync(Str .error( new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -312,7 +313,7 @@ private Mono> getWithResponseAsync(Str * @return metadata information on an assessment type. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( + private Mono> getWithResponseAsync( String assessmentMetadataName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -325,7 +326,7 @@ private Mono> getWithResponseAsync( .error( new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), apiVersion, assessmentMetadataName, accept, context); @@ -341,10 +342,10 @@ private Mono> getWithResponseAsync( * @return metadata information on an assessment type. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String assessmentMetadataName) { + private Mono getAsync(String assessmentMetadataName) { return getWithResponseAsync(assessmentMetadataName) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -363,7 +364,7 @@ private Mono getAsync(String assessmentMetadata * @return metadata information on an assessment type. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentMetadataInner get(String assessmentMetadataName) { + public SecurityAssessmentMetadataResponseInner get(String assessmentMetadataName) { return getAsync(assessmentMetadataName).block(); } @@ -378,7 +379,8 @@ public SecurityAssessmentMetadataInner get(String assessmentMetadataName) { * @return metadata information on an assessment type. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String assessmentMetadataName, Context context) { + public Response getWithResponse( + String assessmentMetadataName, Context context) { return getWithResponseAsync(assessmentMetadataName, context).block(); } @@ -390,7 +392,7 @@ public Response getWithResponse(String assessme * @return metadata information on all assessment types in a specific subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionSinglePageAsync() { + private Mono> listBySubscriptionSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono .error( @@ -403,7 +405,7 @@ private Mono> listBySubscriptionS new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -411,7 +413,7 @@ private Mono> listBySubscriptionS service .listBySubscription( this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -433,7 +435,8 @@ private Mono> listBySubscriptionS * @return metadata information on all assessment types in a specific subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionSinglePageAsync(Context context) { + private Mono> listBySubscriptionSinglePageAsync( + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -446,7 +449,7 @@ private Mono> listBySubscriptionS new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -470,7 +473,7 @@ private Mono> listBySubscriptionS * @return metadata information on all assessment types in a specific subscription. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionAsync() { + private PagedFlux listBySubscriptionAsync() { return new PagedFlux<>( () -> listBySubscriptionSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } @@ -485,7 +488,7 @@ private PagedFlux listBySubscriptionAsync() { * @return metadata information on all assessment types in a specific subscription. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionAsync(Context context) { + private PagedFlux listBySubscriptionAsync(Context context) { return new PagedFlux<>( () -> listBySubscriptionSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); @@ -499,7 +502,7 @@ private PagedFlux listBySubscriptionAsync(Conte * @return metadata information on all assessment types in a specific subscription. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySubscription() { + public PagedIterable listBySubscription() { return new PagedIterable<>(listBySubscriptionAsync()); } @@ -513,7 +516,7 @@ public PagedIterable listBySubscription() { * @return metadata information on all assessment types in a specific subscription. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySubscription(Context context) { + public PagedIterable listBySubscription(Context context) { return new PagedIterable<>(listBySubscriptionAsync(context)); } @@ -527,7 +530,7 @@ public PagedIterable listBySubscription(Context * @return metadata information on an assessment type in a specific subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInSubscriptionWithResponseAsync( + private Mono> getInSubscriptionWithResponseAsync( String assessmentMetadataName) { if (this.client.getEndpoint() == null) { return Mono @@ -546,7 +549,7 @@ private Mono> getInSubscriptionWithRes new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -573,7 +576,7 @@ private Mono> getInSubscriptionWithRes * @return metadata information on an assessment type in a specific subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInSubscriptionWithResponseAsync( + private Mono> getInSubscriptionWithResponseAsync( String assessmentMetadataName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -592,7 +595,7 @@ private Mono> getInSubscriptionWithRes new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -615,10 +618,10 @@ private Mono> getInSubscriptionWithRes * @return metadata information on an assessment type in a specific subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getInSubscriptionAsync(String assessmentMetadataName) { + private Mono getInSubscriptionAsync(String assessmentMetadataName) { return getInSubscriptionWithResponseAsync(assessmentMetadataName) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -637,7 +640,7 @@ private Mono getInSubscriptionAsync(String asse * @return metadata information on an assessment type in a specific subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentMetadataInner getInSubscription(String assessmentMetadataName) { + public SecurityAssessmentMetadataResponseInner getInSubscription(String assessmentMetadataName) { return getInSubscriptionAsync(assessmentMetadataName).block(); } @@ -652,7 +655,7 @@ public SecurityAssessmentMetadataInner getInSubscription(String assessmentMetada * @return metadata information on an assessment type in a specific subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getInSubscriptionWithResponse( + public Response getInSubscriptionWithResponse( String assessmentMetadataName, Context context) { return getInSubscriptionWithResponseAsync(assessmentMetadataName, context).block(); } @@ -665,11 +668,11 @@ public Response getInSubscriptionWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata. + * @return security assessment metadata response. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createInSubscriptionWithResponseAsync( - String assessmentMetadataName, SecurityAssessmentMetadataInner assessmentMetadata) { + private Mono> createInSubscriptionWithResponseAsync( + String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -693,7 +696,7 @@ private Mono> createInSubscriptionWith } else { assessmentMetadata.validate(); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -719,11 +722,11 @@ private Mono> createInSubscriptionWith * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata. + * @return security assessment metadata response. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createInSubscriptionWithResponseAsync( - String assessmentMetadataName, SecurityAssessmentMetadataInner assessmentMetadata, Context context) { + private Mono> createInSubscriptionWithResponseAsync( + String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -747,7 +750,7 @@ private Mono> createInSubscriptionWith } else { assessmentMetadata.validate(); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -769,14 +772,14 @@ private Mono> createInSubscriptionWith * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata. + * @return security assessment metadata response. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createInSubscriptionAsync( - String assessmentMetadataName, SecurityAssessmentMetadataInner assessmentMetadata) { + private Mono createInSubscriptionAsync( + String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata) { return createInSubscriptionWithResponseAsync(assessmentMetadataName, assessmentMetadata) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -793,11 +796,11 @@ private Mono createInSubscriptionAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata. + * @return security assessment metadata response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentMetadataInner createInSubscription( - String assessmentMetadataName, SecurityAssessmentMetadataInner assessmentMetadata) { + public SecurityAssessmentMetadataResponseInner createInSubscription( + String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata) { return createInSubscriptionAsync(assessmentMetadataName, assessmentMetadata).block(); } @@ -810,11 +813,11 @@ public SecurityAssessmentMetadataInner createInSubscription( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata. + * @return security assessment metadata response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createInSubscriptionWithResponse( - String assessmentMetadataName, SecurityAssessmentMetadataInner assessmentMetadata, Context context) { + public Response createInSubscriptionWithResponse( + String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata, Context context) { return createInSubscriptionWithResponseAsync(assessmentMetadataName, assessmentMetadata, context).block(); } @@ -847,7 +850,7 @@ private Mono> deleteInSubscriptionWithResponseAsync(String assess new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -893,7 +896,7 @@ private Mono> deleteInSubscriptionWithResponseAsync(String assess new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-01-01"; + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -962,7 +965,7 @@ public Response deleteInSubscriptionWithResponse(String assessmentMetadata * @return list of security assessment metadata. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -975,7 +978,7 @@ private Mono> listNextSinglePageA final String accept = "application/json"; return FluxUtil .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -998,7 +1001,7 @@ private Mono> listNextSinglePageA * @return list of security assessment metadata. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( + private Mono> listNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1034,7 +1037,7 @@ private Mono> listNextSinglePageA * @return list of security assessment metadata. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( + private Mono> listBySubscriptionNextSinglePageAsync( String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1049,7 +1052,7 @@ private Mono> listBySubscriptionN return FluxUtil .withContext( context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -1072,7 +1075,7 @@ private Mono> listBySubscriptionN * @return list of security assessment metadata. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( + private Mono> listBySubscriptionNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasImpl.java index 710b457adbd12..dd5f2bdcbd673 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasImpl.java @@ -10,9 +10,9 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.fluent.AssessmentsMetadatasClient; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataInner; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner; import com.azure.resourcemanager.security.models.AssessmentsMetadatas; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadata; +import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataResponse; import com.fasterxml.jackson.annotation.JsonIgnore; public final class AssessmentsMetadatasImpl implements AssessmentsMetadatas { @@ -28,68 +28,69 @@ public AssessmentsMetadatasImpl( this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new SecurityAssessmentMetadataImpl(inner1, this.manager())); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new SecurityAssessmentMetadataImpl(inner1, this.manager())); + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); } - public SecurityAssessmentMetadata get(String assessmentMetadataName) { - SecurityAssessmentMetadataInner inner = this.serviceClient().get(assessmentMetadataName); + public SecurityAssessmentMetadataResponse get(String assessmentMetadataName) { + SecurityAssessmentMetadataResponseInner inner = this.serviceClient().get(assessmentMetadataName); if (inner != null) { - return new SecurityAssessmentMetadataImpl(inner, this.manager()); + return new SecurityAssessmentMetadataResponseImpl(inner, this.manager()); } else { return null; } } - public Response getWithResponse(String assessmentMetadataName, Context context) { - Response inner = + public Response getWithResponse( + String assessmentMetadataName, Context context) { + Response inner = this.serviceClient().getWithResponse(assessmentMetadataName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityAssessmentMetadataImpl(inner.getValue(), this.manager())); + new SecurityAssessmentMetadataResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - public PagedIterable listBySubscription() { - PagedIterable inner = this.serviceClient().listBySubscription(); - return Utils.mapPage(inner, inner1 -> new SecurityAssessmentMetadataImpl(inner1, this.manager())); + public PagedIterable listBySubscription() { + PagedIterable inner = this.serviceClient().listBySubscription(); + return Utils.mapPage(inner, inner1 -> new SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); } - public PagedIterable listBySubscription(Context context) { - PagedIterable inner = this.serviceClient().listBySubscription(context); - return Utils.mapPage(inner, inner1 -> new SecurityAssessmentMetadataImpl(inner1, this.manager())); + public PagedIterable listBySubscription(Context context) { + PagedIterable inner = this.serviceClient().listBySubscription(context); + return Utils.mapPage(inner, inner1 -> new SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); } - public SecurityAssessmentMetadata getInSubscription(String assessmentMetadataName) { - SecurityAssessmentMetadataInner inner = this.serviceClient().getInSubscription(assessmentMetadataName); + public SecurityAssessmentMetadataResponse getInSubscription(String assessmentMetadataName) { + SecurityAssessmentMetadataResponseInner inner = this.serviceClient().getInSubscription(assessmentMetadataName); if (inner != null) { - return new SecurityAssessmentMetadataImpl(inner, this.manager()); + return new SecurityAssessmentMetadataResponseImpl(inner, this.manager()); } else { return null; } } - public Response getInSubscriptionWithResponse( + public Response getInSubscriptionWithResponse( String assessmentMetadataName, Context context) { - Response inner = + Response inner = this.serviceClient().getInSubscriptionWithResponse(assessmentMetadataName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityAssessmentMetadataImpl(inner.getValue(), this.manager())); + new SecurityAssessmentMetadataResponseImpl(inner.getValue(), this.manager())); } else { return null; } @@ -103,7 +104,7 @@ public Response deleteInSubscriptionWithResponse(String assessmentMetadata return this.serviceClient().deleteInSubscriptionWithResponse(assessmentMetadataName, context); } - public SecurityAssessmentMetadata getInSubscriptionById(String id) { + public SecurityAssessmentMetadataResponse getInSubscriptionById(String id) { String assessmentMetadataName = Utils.getValueFromIdByName(id, "assessmentMetadata"); if (assessmentMetadataName == null) { throw logger @@ -116,7 +117,7 @@ public SecurityAssessmentMetadata getInSubscriptionById(String id) { return this.getInSubscriptionWithResponse(assessmentMetadataName, Context.NONE).getValue(); } - public Response getInSubscriptionByIdWithResponse(String id, Context context) { + public Response getInSubscriptionByIdWithResponse(String id, Context context) { String assessmentMetadataName = Utils.getValueFromIdByName(id, "assessmentMetadata"); if (assessmentMetadataName == null) { throw logger @@ -139,7 +140,7 @@ public void deleteInSubscriptionById(String id) { .format( "The resource ID '%s' is not valid. Missing path segment 'assessmentMetadata'.", id))); } - this.deleteInSubscriptionWithResponse(assessmentMetadataName, Context.NONE).getValue(); + this.deleteInSubscriptionWithResponse(assessmentMetadataName, Context.NONE); } public Response deleteInSubscriptionByIdWithResponse(String id, Context context) { @@ -163,7 +164,7 @@ private com.azure.resourcemanager.security.SecurityManager manager() { return this.serviceManager; } - public SecurityAssessmentMetadataImpl define(String name) { - return new SecurityAssessmentMetadataImpl(name, this.manager()); + public SecurityAssessmentMetadataResponseImpl define(String name) { + return new SecurityAssessmentMetadataResponseImpl(name, this.manager()); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsImpl.java index 9f145dc699d90..9af035427d8da 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsImpl.java @@ -162,7 +162,7 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'automations'.", id))); } - this.deleteWithResponse(resourceGroupName, automationName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, automationName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsImpl.java index 7b383760df4b8..1d2d35a0b73fe 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsImpl.java @@ -98,7 +98,7 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); } - this.deleteWithResponse(connectorName, Context.NONE).getValue(); + this.deleteWithResponse(connectorName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationImpl.java new file mode 100644 index 0000000000000..4b7d59d784b08 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationImpl.java @@ -0,0 +1,172 @@ +// Copyright (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.CustomAssessmentAutomationInner; +import com.azure.resourcemanager.security.models.CustomAssessmentAutomation; +import com.azure.resourcemanager.security.models.CustomAssessmentAutomationRequest; +import com.azure.resourcemanager.security.models.SeverityEnum; +import com.azure.resourcemanager.security.models.SupportedCloudEnum; + +public final class CustomAssessmentAutomationImpl + implements CustomAssessmentAutomation, CustomAssessmentAutomation.Definition { + private CustomAssessmentAutomationInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + CustomAssessmentAutomationImpl( + CustomAssessmentAutomationInner 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 String compressedQuery() { + return this.innerModel().compressedQuery(); + } + + public SupportedCloudEnum supportedCloud() { + return this.innerModel().supportedCloud(); + } + + public SeverityEnum severity() { + return this.innerModel().severity(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String description() { + return this.innerModel().description(); + } + + public String remediationDescription() { + return this.innerModel().remediationDescription(); + } + + public String assessmentKey() { + return this.innerModel().assessmentKey(); + } + + public CustomAssessmentAutomationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String customAssessmentAutomationName; + + private CustomAssessmentAutomationRequest createCustomAssessmentAutomationBody; + + public CustomAssessmentAutomationImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public CustomAssessmentAutomation create() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomAssessmentAutomations() + .createWithResponse( + resourceGroupName, + customAssessmentAutomationName, + createCustomAssessmentAutomationBody, + Context.NONE) + .getValue(); + return this; + } + + public CustomAssessmentAutomation create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomAssessmentAutomations() + .createWithResponse( + resourceGroupName, customAssessmentAutomationName, createCustomAssessmentAutomationBody, context) + .getValue(); + return this; + } + + CustomAssessmentAutomationImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = new CustomAssessmentAutomationInner(); + this.serviceManager = serviceManager; + this.customAssessmentAutomationName = name; + this.createCustomAssessmentAutomationBody = new CustomAssessmentAutomationRequest(); + } + + public CustomAssessmentAutomation refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomAssessmentAutomations() + .getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, Context.NONE) + .getValue(); + return this; + } + + public CustomAssessmentAutomation refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomAssessmentAutomations() + .getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, context) + .getValue(); + return this; + } + + public CustomAssessmentAutomationImpl withCompressedQuery(String compressedQuery) { + this.createCustomAssessmentAutomationBody.withCompressedQuery(compressedQuery); + return this; + } + + public CustomAssessmentAutomationImpl withSupportedCloud(SupportedCloudEnum supportedCloud) { + this.createCustomAssessmentAutomationBody.withSupportedCloud(supportedCloud); + return this; + } + + public CustomAssessmentAutomationImpl withSeverity(SeverityEnum severity) { + this.createCustomAssessmentAutomationBody.withSeverity(severity); + return this; + } + + public CustomAssessmentAutomationImpl withDisplayName(String displayName) { + this.createCustomAssessmentAutomationBody.withDisplayName(displayName); + return this; + } + + public CustomAssessmentAutomationImpl withDescription(String description) { + this.createCustomAssessmentAutomationBody.withDescription(description); + return this; + } + + public CustomAssessmentAutomationImpl withRemediationDescription(String remediationDescription) { + this.createCustomAssessmentAutomationBody.withRemediationDescription(remediationDescription); + return this; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsClientImpl.java new file mode 100644 index 0000000000000..977b8baea6f4a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsClientImpl.java @@ -0,0 +1,1139 @@ +// Copyright (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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.fluent.CustomAssessmentAutomationsClient; +import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationInner; +import com.azure.resourcemanager.security.models.CustomAssessmentAutomationRequest; +import com.azure.resourcemanager.security.models.CustomAssessmentAutomationsListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CustomAssessmentAutomationsClient. */ +public final class CustomAssessmentAutomationsClientImpl implements CustomAssessmentAutomationsClient { + private final ClientLogger logger = new ClientLogger(CustomAssessmentAutomationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CustomAssessmentAutomationsService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of CustomAssessmentAutomationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CustomAssessmentAutomationsClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy + .create( + CustomAssessmentAutomationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterCustomAssessmentAutomations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterCustom") + private interface CustomAssessmentAutomationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security" + + "/customAssessmentAutomations/{customAssessmentAutomationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("customAssessmentAutomationName") String customAssessmentAutomationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security" + + "/customAssessmentAutomations/{customAssessmentAutomationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("customAssessmentAutomationName") String customAssessmentAutomationName, + @BodyParam("application/json") CustomAssessmentAutomationRequest customAssessmentAutomationBody, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security" + + "/customAssessmentAutomations/{customAssessmentAutomationName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("customAssessmentAutomationName") String customAssessmentAutomationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security" + + "/customAssessmentAutomations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/customAssessmentAutomations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> 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> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom assessment automation by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String customAssessmentAutomationName) { + 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 (customAssessmentAutomationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customAssessmentAutomationName is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + customAssessmentAutomationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom assessment automation by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String customAssessmentAutomationName, 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 (customAssessmentAutomationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customAssessmentAutomationName is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + customAssessmentAutomationName, + accept, + context); + } + + /** + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom assessment automation by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String customAssessmentAutomationName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, customAssessmentAutomationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom assessment automation by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomAssessmentAutomationInner getByResourceGroup( + String resourceGroupName, String customAssessmentAutomationName) { + return getByResourceGroupAsync(resourceGroupName, customAssessmentAutomationName).block(); + } + + /** + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom assessment automation by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String customAssessmentAutomationName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, customAssessmentAutomationName, context).block(); + } + + /** + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * existing custom assessment automation will replace the existing record. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param customAssessmentAutomationBody Custom Assessment Automation body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom Assessment Automation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String customAssessmentAutomationName, + CustomAssessmentAutomationRequest customAssessmentAutomationBody) { + 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 (customAssessmentAutomationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customAssessmentAutomationName is required and cannot be null.")); + } + if (customAssessmentAutomationBody == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customAssessmentAutomationBody is required and cannot be null.")); + } else { + customAssessmentAutomationBody.validate(); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + customAssessmentAutomationName, + customAssessmentAutomationBody, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * existing custom assessment automation will replace the existing record. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param customAssessmentAutomationBody Custom Assessment Automation body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom Assessment Automation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String customAssessmentAutomationName, + CustomAssessmentAutomationRequest customAssessmentAutomationBody, + 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 (customAssessmentAutomationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customAssessmentAutomationName is required and cannot be null.")); + } + if (customAssessmentAutomationBody == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customAssessmentAutomationBody is required and cannot be null.")); + } else { + customAssessmentAutomationBody.validate(); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + customAssessmentAutomationName, + customAssessmentAutomationBody, + accept, + context); + } + + /** + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * existing custom assessment automation will replace the existing record. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param customAssessmentAutomationBody Custom Assessment Automation body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom Assessment Automation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String customAssessmentAutomationName, + CustomAssessmentAutomationRequest customAssessmentAutomationBody) { + return createWithResponseAsync( + resourceGroupName, customAssessmentAutomationName, customAssessmentAutomationBody) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * existing custom assessment automation will replace the existing record. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param customAssessmentAutomationBody Custom Assessment Automation body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom Assessment Automation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomAssessmentAutomationInner create( + String resourceGroupName, + String customAssessmentAutomationName, + CustomAssessmentAutomationRequest customAssessmentAutomationBody) { + return createAsync(resourceGroupName, customAssessmentAutomationName, customAssessmentAutomationBody).block(); + } + + /** + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * existing custom assessment automation will replace the existing record. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param customAssessmentAutomationBody Custom Assessment Automation body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom Assessment Automation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String customAssessmentAutomationName, + CustomAssessmentAutomationRequest customAssessmentAutomationBody, + Context context) { + return createWithResponseAsync( + resourceGroupName, customAssessmentAutomationName, customAssessmentAutomationBody, context) + .block(); + } + + /** + * Deletes a custom assessment automation by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String customAssessmentAutomationName) { + 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 (customAssessmentAutomationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customAssessmentAutomationName is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + customAssessmentAutomationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a custom assessment automation by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String customAssessmentAutomationName, 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 (customAssessmentAutomationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customAssessmentAutomationName is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + customAssessmentAutomationName, + accept, + context); + } + + /** + * Deletes a custom assessment automation by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String customAssessmentAutomationName) { + return deleteWithResponseAsync(resourceGroupName, customAssessmentAutomationName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a custom assessment automation by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 customAssessmentAutomationName) { + deleteAsync(resourceGroupName, customAssessmentAutomationName).block(); + } + + /** + * Deletes a custom assessment automation by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String customAssessmentAutomationName, Context context) { + return deleteWithResponseAsync(resourceGroupName, customAssessmentAutomationName, context).block(); + } + + /** + * List custom assessment automations by provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List custom assessment automations by provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List custom assessment automations by provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List custom assessment automations by provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List custom assessment automations by provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List custom assessment automations by provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List custom assessment automations by provided 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 a list of Custom Assessment Automations. + */ + @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-07-01-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())); + } + + /** + * List custom assessment automations by provided 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 a list of Custom Assessment Automations. + */ + @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-07-01-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)); + } + + /** + * List custom assessment automations by provided 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 a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List custom assessment automations by provided 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 a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List custom assessment automations by provided 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 a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List custom assessment automations by provided 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 a list of Custom Assessment Automations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink 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 list of Custom Assessment Automations. + */ + @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 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 list of Custom Assessment Automations. + */ + @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 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 list of Custom Assessment Automations. + */ + @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 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 list of Custom Assessment Automations. + */ + @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/CustomAssessmentAutomationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsImpl.java new file mode 100644 index 0000000000000..d0a1c69192d91 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.CustomAssessmentAutomationsClient; +import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationInner; +import com.azure.resourcemanager.security.models.CustomAssessmentAutomation; +import com.azure.resourcemanager.security.models.CustomAssessmentAutomations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CustomAssessmentAutomationsImpl implements CustomAssessmentAutomations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomAssessmentAutomationsImpl.class); + + private final CustomAssessmentAutomationsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public CustomAssessmentAutomationsImpl( + CustomAssessmentAutomationsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CustomAssessmentAutomation getByResourceGroup( + String resourceGroupName, String customAssessmentAutomationName) { + CustomAssessmentAutomationInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, customAssessmentAutomationName); + if (inner != null) { + return new CustomAssessmentAutomationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String customAssessmentAutomationName, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CustomAssessmentAutomationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String customAssessmentAutomationName) { + this.serviceClient().delete(resourceGroupName, customAssessmentAutomationName); + } + + public Response deleteWithResponse( + String resourceGroupName, String customAssessmentAutomationName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, customAssessmentAutomationName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new CustomAssessmentAutomationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new CustomAssessmentAutomationImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new CustomAssessmentAutomationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new CustomAssessmentAutomationImpl(inner1, this.manager())); + } + + public CustomAssessmentAutomation 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 customAssessmentAutomationName = Utils.getValueFromIdByName(id, "customAssessmentAutomations"); + if (customAssessmentAutomationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'customAssessmentAutomations'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, 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 customAssessmentAutomationName = Utils.getValueFromIdByName(id, "customAssessmentAutomations"); + if (customAssessmentAutomationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'customAssessmentAutomations'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, context); + } + + public void deleteById(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 customAssessmentAutomationName = Utils.getValueFromIdByName(id, "customAssessmentAutomations"); + if (customAssessmentAutomationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'customAssessmentAutomations'.", + id))); + } + this.deleteWithResponse(resourceGroupName, customAssessmentAutomationName, Context.NONE); + } + + public Response deleteByIdWithResponse(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 customAssessmentAutomationName = Utils.getValueFromIdByName(id, "customAssessmentAutomations"); + if (customAssessmentAutomationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'customAssessmentAutomations'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, customAssessmentAutomationName, context); + } + + private CustomAssessmentAutomationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } + + public CustomAssessmentAutomationImpl define(String name) { + return new CustomAssessmentAutomationImpl(name, this.manager()); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentImpl.java new file mode 100644 index 0000000000000..fb658a4180552 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentImpl.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentInner; +import com.azure.resourcemanager.security.models.CustomEntityStoreAssignment; +import com.azure.resourcemanager.security.models.CustomEntityStoreAssignmentRequest; + +public final class CustomEntityStoreAssignmentImpl + implements CustomEntityStoreAssignment, CustomEntityStoreAssignment.Definition { + private CustomEntityStoreAssignmentInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + CustomEntityStoreAssignmentImpl( + CustomEntityStoreAssignmentInner 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 String principal() { + return this.innerModel().principal(); + } + + public String entityStoreDatabaseLink() { + return this.innerModel().entityStoreDatabaseLink(); + } + + public CustomEntityStoreAssignmentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String customEntityStoreAssignmentName; + + private CustomEntityStoreAssignmentRequest createCustomEntityStoreAssignmentRequestBody; + + public CustomEntityStoreAssignmentImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public CustomEntityStoreAssignment create() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomEntityStoreAssignments() + .createWithResponse( + resourceGroupName, + customEntityStoreAssignmentName, + createCustomEntityStoreAssignmentRequestBody, + Context.NONE) + .getValue(); + return this; + } + + public CustomEntityStoreAssignment create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomEntityStoreAssignments() + .createWithResponse( + resourceGroupName, + customEntityStoreAssignmentName, + createCustomEntityStoreAssignmentRequestBody, + context) + .getValue(); + return this; + } + + CustomEntityStoreAssignmentImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = new CustomEntityStoreAssignmentInner(); + this.serviceManager = serviceManager; + this.customEntityStoreAssignmentName = name; + this.createCustomEntityStoreAssignmentRequestBody = new CustomEntityStoreAssignmentRequest(); + } + + public CustomEntityStoreAssignment refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomEntityStoreAssignments() + .getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, Context.NONE) + .getValue(); + return this; + } + + public CustomEntityStoreAssignment refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomEntityStoreAssignments() + .getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, context) + .getValue(); + return this; + } + + public CustomEntityStoreAssignmentImpl withPrincipal(String principal) { + this.createCustomEntityStoreAssignmentRequestBody.withPrincipal(principal); + return this; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsClientImpl.java new file mode 100644 index 0000000000000..11ffb59594051 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsClientImpl.java @@ -0,0 +1,1135 @@ +// Copyright (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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.fluent.CustomEntityStoreAssignmentsClient; +import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentInner; +import com.azure.resourcemanager.security.models.CustomEntityStoreAssignmentRequest; +import com.azure.resourcemanager.security.models.CustomEntityStoreAssignmentsListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CustomEntityStoreAssignmentsClient. */ +public final class CustomEntityStoreAssignmentsClientImpl implements CustomEntityStoreAssignmentsClient { + private final ClientLogger logger = new ClientLogger(CustomEntityStoreAssignmentsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CustomEntityStoreAssignmentsService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of CustomEntityStoreAssignmentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CustomEntityStoreAssignmentsClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy + .create( + CustomEntityStoreAssignmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterCustomEntityStoreAssignments to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterCustom") + private interface CustomEntityStoreAssignmentsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security" + + "/customEntityStoreAssignments/{customEntityStoreAssignmentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("customEntityStoreAssignmentName") String customEntityStoreAssignmentName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security" + + "/customEntityStoreAssignments/{customEntityStoreAssignmentName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("customEntityStoreAssignmentName") String customEntityStoreAssignmentName, + @BodyParam("application/json") CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security" + + "/customEntityStoreAssignments/{customEntityStoreAssignmentName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("customEntityStoreAssignmentName") String customEntityStoreAssignmentName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security" + + "/customEntityStoreAssignments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/customEntityStoreAssignments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> 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> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a single custom entity store assignment by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom entity store assignment by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String customEntityStoreAssignmentName) { + 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 (customEntityStoreAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customEntityStoreAssignmentName is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + customEntityStoreAssignmentName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a single custom entity store assignment by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom entity store assignment by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String customEntityStoreAssignmentName, 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 (customEntityStoreAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customEntityStoreAssignmentName is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + customEntityStoreAssignmentName, + accept, + context); + } + + /** + * Gets a single custom entity store assignment by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom entity store assignment by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String customEntityStoreAssignmentName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, customEntityStoreAssignmentName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a single custom entity store assignment by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom entity store assignment by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomEntityStoreAssignmentInner getByResourceGroup( + String resourceGroupName, String customEntityStoreAssignmentName) { + return getByResourceGroupAsync(resourceGroupName, customEntityStoreAssignmentName).block(); + } + + /** + * Gets a single custom entity store assignment by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom entity store assignment by name for the provided subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String customEntityStoreAssignmentName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, customEntityStoreAssignmentName, context).block(); + } + + /** + * Creates a custom entity store assignment for the provided subscription, if not already exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom entity store assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String customEntityStoreAssignmentName, + CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody) { + 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 (customEntityStoreAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customEntityStoreAssignmentName is required and cannot be null.")); + } + if (customEntityStoreAssignmentRequestBody == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customEntityStoreAssignmentRequestBody is required and cannot be null.")); + } else { + customEntityStoreAssignmentRequestBody.validate(); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + customEntityStoreAssignmentName, + customEntityStoreAssignmentRequestBody, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a custom entity store assignment for the provided subscription, if not already exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom entity store assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String customEntityStoreAssignmentName, + CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody, + 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 (customEntityStoreAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customEntityStoreAssignmentName is required and cannot be null.")); + } + if (customEntityStoreAssignmentRequestBody == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customEntityStoreAssignmentRequestBody is required and cannot be null.")); + } else { + customEntityStoreAssignmentRequestBody.validate(); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + customEntityStoreAssignmentName, + customEntityStoreAssignmentRequestBody, + accept, + context); + } + + /** + * Creates a custom entity store assignment for the provided subscription, if not already exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom entity store assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String customEntityStoreAssignmentName, + CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody) { + return createWithResponseAsync( + resourceGroupName, customEntityStoreAssignmentName, customEntityStoreAssignmentRequestBody) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a custom entity store assignment for the provided subscription, if not already exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom entity store assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomEntityStoreAssignmentInner create( + String resourceGroupName, + String customEntityStoreAssignmentName, + CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody) { + return createAsync(resourceGroupName, customEntityStoreAssignmentName, customEntityStoreAssignmentRequestBody) + .block(); + } + + /** + * Creates a custom entity store assignment for the provided subscription, if not already exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom entity store assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String customEntityStoreAssignmentName, + CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody, + Context context) { + return createWithResponseAsync( + resourceGroupName, customEntityStoreAssignmentName, customEntityStoreAssignmentRequestBody, context) + .block(); + } + + /** + * Delete a custom entity store assignment by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String customEntityStoreAssignmentName) { + 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 (customEntityStoreAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customEntityStoreAssignmentName is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + customEntityStoreAssignmentName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a custom entity store assignment by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String customEntityStoreAssignmentName, 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 (customEntityStoreAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customEntityStoreAssignmentName is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + customEntityStoreAssignmentName, + accept, + context); + } + + /** + * Delete a custom entity store assignment by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String customEntityStoreAssignmentName) { + return deleteWithResponseAsync(resourceGroupName, customEntityStoreAssignmentName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete a custom entity store assignment by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String customEntityStoreAssignmentName) { + deleteAsync(resourceGroupName, customEntityStoreAssignmentName).block(); + } + + /** + * Delete a custom entity store assignment by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String customEntityStoreAssignmentName, Context context) { + return deleteWithResponseAsync(resourceGroupName, customEntityStoreAssignmentName, context).block(); + } + + /** + * List custom entity store assignments by a provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of custom entity store assignments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List custom entity store assignments by a provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of custom entity store assignments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List custom entity store assignments by a provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of custom entity store assignments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List custom entity store assignments by a provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of custom entity store assignments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List custom entity store assignments by a provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of custom entity store assignments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List custom entity store assignments by a provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of custom entity store assignments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List custom entity store assignments by provided 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 a list of custom entity store assignments. + */ + @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-07-01-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())); + } + + /** + * List custom entity store assignments by provided 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 a list of custom entity store assignments. + */ + @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-07-01-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)); + } + + /** + * List custom entity store assignments by provided 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 a list of custom entity store assignments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List custom entity store assignments by provided 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 a list of custom entity store assignments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List custom entity store assignments by provided 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 a list of custom entity store assignments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List custom entity store assignments by provided 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 a list of custom entity store assignments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink 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 list of custom entity store assignments. + */ + @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 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 list of custom entity store assignments. + */ + @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 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 list of custom entity store assignments. + */ + @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 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 list of custom entity store assignments. + */ + @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/CustomEntityStoreAssignmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsImpl.java new file mode 100644 index 0000000000000..7e5bea4e24230 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.CustomEntityStoreAssignmentsClient; +import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentInner; +import com.azure.resourcemanager.security.models.CustomEntityStoreAssignment; +import com.azure.resourcemanager.security.models.CustomEntityStoreAssignments; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CustomEntityStoreAssignmentsImpl implements CustomEntityStoreAssignments { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomEntityStoreAssignmentsImpl.class); + + private final CustomEntityStoreAssignmentsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public CustomEntityStoreAssignmentsImpl( + CustomEntityStoreAssignmentsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CustomEntityStoreAssignment getByResourceGroup( + String resourceGroupName, String customEntityStoreAssignmentName) { + CustomEntityStoreAssignmentInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, customEntityStoreAssignmentName); + if (inner != null) { + return new CustomEntityStoreAssignmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String customEntityStoreAssignmentName, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CustomEntityStoreAssignmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String customEntityStoreAssignmentName) { + this.serviceClient().delete(resourceGroupName, customEntityStoreAssignmentName); + } + + public Response deleteWithResponse( + String resourceGroupName, String customEntityStoreAssignmentName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, customEntityStoreAssignmentName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new CustomEntityStoreAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new CustomEntityStoreAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new CustomEntityStoreAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new CustomEntityStoreAssignmentImpl(inner1, this.manager())); + } + + public CustomEntityStoreAssignment 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 customEntityStoreAssignmentName = Utils.getValueFromIdByName(id, "customEntityStoreAssignments"); + if (customEntityStoreAssignmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'customEntityStoreAssignments'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, 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 customEntityStoreAssignmentName = Utils.getValueFromIdByName(id, "customEntityStoreAssignments"); + if (customEntityStoreAssignmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'customEntityStoreAssignments'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, context); + } + + public void deleteById(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 customEntityStoreAssignmentName = Utils.getValueFromIdByName(id, "customEntityStoreAssignments"); + if (customEntityStoreAssignmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'customEntityStoreAssignments'.", + id))); + } + this.deleteWithResponse(resourceGroupName, customEntityStoreAssignmentName, Context.NONE); + } + + public Response deleteByIdWithResponse(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 customEntityStoreAssignmentName = Utils.getValueFromIdByName(id, "customEntityStoreAssignments"); + if (customEntityStoreAssignmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'customEntityStoreAssignments'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, customEntityStoreAssignmentName, context); + } + + private CustomEntityStoreAssignmentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } + + public CustomEntityStoreAssignmentImpl define(String name) { + return new CustomEntityStoreAssignmentImpl(name, this.manager()); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceImpl.java deleted file mode 100644 index bd7d057a552e3..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceImpl.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (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.DeviceInner; -import com.azure.resourcemanager.security.models.AuthorizationState; -import com.azure.resourcemanager.security.models.Device; -import com.azure.resourcemanager.security.models.DeviceCriticality; -import com.azure.resourcemanager.security.models.DeviceStatus; -import com.azure.resourcemanager.security.models.Firmware; -import com.azure.resourcemanager.security.models.ManagementState; -import com.azure.resourcemanager.security.models.NetworkInterface; -import com.azure.resourcemanager.security.models.ProgrammingState; -import com.azure.resourcemanager.security.models.Protocol; -import com.azure.resourcemanager.security.models.PurdueLevel; -import com.azure.resourcemanager.security.models.ScanningFunctionality; -import com.azure.resourcemanager.security.models.Sensor; -import com.azure.resourcemanager.security.models.Site; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class DeviceImpl implements Device { - private DeviceInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - DeviceImpl(DeviceInner 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 String deviceType() { - return this.innerModel().deviceType(); - } - - public String sourceName() { - return this.innerModel().sourceName(); - } - - public List networkInterfaces() { - List inner = this.innerModel().networkInterfaces(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String vendor() { - return this.innerModel().vendor(); - } - - public String osName() { - return this.innerModel().osName(); - } - - public List protocols() { - List inner = this.innerModel().protocols(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public OffsetDateTime lastActiveTime() { - return this.innerModel().lastActiveTime(); - } - - public OffsetDateTime lastUpdateTime() { - return this.innerModel().lastUpdateTime(); - } - - public ManagementState managementState() { - return this.innerModel().managementState(); - } - - public AuthorizationState authorizationState() { - return this.innerModel().authorizationState(); - } - - public DeviceCriticality deviceCriticality() { - return this.innerModel().deviceCriticality(); - } - - public PurdueLevel purdueLevel() { - return this.innerModel().purdueLevel(); - } - - public String notes() { - return this.innerModel().notes(); - } - - public List firmwares() { - List inner = this.innerModel().firmwares(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public OffsetDateTime discoveryTime() { - return this.innerModel().discoveryTime(); - } - - public ProgrammingState programmingState() { - return this.innerModel().programmingState(); - } - - public OffsetDateTime lastProgrammingTime() { - return this.innerModel().lastProgrammingTime(); - } - - public ScanningFunctionality scanningFunctionality() { - return this.innerModel().scanningFunctionality(); - } - - public OffsetDateTime lastScanTime() { - return this.innerModel().lastScanTime(); - } - - public Integer riskScore() { - return this.innerModel().riskScore(); - } - - public List sensors() { - List inner = this.innerModel().sensors(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Site site() { - return this.innerModel().site(); - } - - public DeviceStatus deviceStatus() { - return this.innerModel().deviceStatus(); - } - - public DeviceInner 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/DeviceSecurityGroupsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupsImpl.java index 7ef140eaab872..c572b9cd6cd33 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupsImpl.java @@ -160,7 +160,7 @@ public void deleteById(String id) { "The resource ID '%s' is not valid. Missing path segment 'deviceSecurityGroups'.", id))); } - this.deleteWithResponse(resourceId, deviceSecurityGroupName, Context.NONE).getValue(); + this.deleteWithResponse(resourceId, deviceSecurityGroupName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesClientImpl.java deleted file mode 100644 index d34756166cace..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesClientImpl.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (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.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.DevicesClient; -import com.azure.resourcemanager.security.fluent.models.DeviceInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DevicesClient. */ -public final class DevicesClientImpl implements DevicesClient { - private final ClientLogger logger = new ClientLogger(DevicesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DevicesService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of DevicesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DevicesClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(DevicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterDevices to be used by the proxy service to perform REST - * calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterDevice") - private interface DevicesService { - @Headers({"Content-Type: application/json"}) - @Get("/{resourceId}/providers/Microsoft.Security/devices/{deviceId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("deviceId") String deviceId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get device. - * - * @param resourceId The identifier of the resource. - * @param deviceId Identifier of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, String deviceId) { - 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 (deviceId == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceId is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), apiVersion, resourceId, deviceId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get device. - * - * @param resourceId The identifier of the resource. - * @param deviceId Identifier of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, String deviceId, 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 (deviceId == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceId is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, resourceId, deviceId, accept, context); - } - - /** - * Get device. - * - * @param resourceId The identifier of the resource. - * @param deviceId Identifier of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId, String deviceId) { - return getWithResponseAsync(resourceId, deviceId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get device. - * - * @param resourceId The identifier of the resource. - * @param deviceId Identifier of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceInner get(String resourceId, String deviceId) { - return getAsync(resourceId, deviceId).block(); - } - - /** - * Get device. - * - * @param resourceId The identifier of the resource. - * @param deviceId Identifier of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceId, String deviceId, Context context) { - return getWithResponseAsync(resourceId, deviceId, context).block(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForHubsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForHubsClientImpl.java deleted file mode 100644 index ddee689ac4ae6..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForHubsClientImpl.java +++ /dev/null @@ -1,354 +0,0 @@ -// Copyright (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.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.DevicesForHubsClient; -import com.azure.resourcemanager.security.fluent.models.DeviceInner; -import com.azure.resourcemanager.security.models.DeviceList; -import com.azure.resourcemanager.security.models.ManagementState; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DevicesForHubsClient. */ -public final class DevicesForHubsClientImpl implements DevicesForHubsClient { - private final ClientLogger logger = new ClientLogger(DevicesForHubsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DevicesForHubsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of DevicesForHubsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DevicesForHubsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(DevicesForHubsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterDevicesForHubs to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterDevice") - private interface DevicesForHubsService { - @Headers({"Content-Type: application/json"}) - @Get("/{resourceId}/providers/Microsoft.Security/devices") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @QueryParam("$limit") Integer limit, - @QueryParam("$skipToken") String skipToken, - @QueryParam("deviceManagementType") ManagementState deviceManagementType, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 the devices for the specified IoT Hub resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceId, Integer limit, String skipToken, ManagementState deviceManagementType) { - 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.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - resourceId, - limit, - skipToken, - deviceManagementType, - 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 list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 the devices for the specified IoT Hub resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceId, Integer limit, String skipToken, ManagementState deviceManagementType, 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.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - resourceId, - limit, - skipToken, - deviceManagementType, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 the devices for the specified IoT Hub resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceId, Integer limit, String skipToken, ManagementState deviceManagementType) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceId, limit, skipToken, deviceManagementType), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices for the specified IoT Hub resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceId) { - final Integer limit = null; - final String skipToken = null; - final ManagementState deviceManagementType = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceId, limit, skipToken, deviceManagementType), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 the devices for the specified IoT Hub resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceId, Integer limit, String skipToken, ManagementState deviceManagementType, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceId, limit, skipToken, deviceManagementType, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices for the specified IoT Hub resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceId) { - final Integer limit = null; - final String skipToken = null; - final ManagementState deviceManagementType = null; - return new PagedIterable<>(listAsync(resourceId, limit, skipToken, deviceManagementType)); - } - - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 the devices for the specified IoT Hub resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceId, Integer limit, String skipToken, ManagementState deviceManagementType, Context context) { - return new PagedIterable<>(listAsync(resourceId, limit, skipToken, deviceManagementType, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink 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 Devices. - */ - @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 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 Devices. - */ - @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/DevicesForHubsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForHubsImpl.java deleted file mode 100644 index c767b26ae7912..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForHubsImpl.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.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.DevicesForHubsClient; -import com.azure.resourcemanager.security.fluent.models.DeviceInner; -import com.azure.resourcemanager.security.models.Device; -import com.azure.resourcemanager.security.models.DevicesForHubs; -import com.azure.resourcemanager.security.models.ManagementState; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class DevicesForHubsImpl implements DevicesForHubs { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DevicesForHubsImpl.class); - - private final DevicesForHubsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public DevicesForHubsImpl( - DevicesForHubsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceId) { - PagedIterable inner = this.serviceClient().list(resourceId); - return Utils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); - } - - public PagedIterable list( - String resourceId, Integer limit, String skipToken, ManagementState deviceManagementType, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceId, limit, skipToken, deviceManagementType, context); - return Utils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); - } - - private DevicesForHubsClient 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/DevicesForSubscriptionsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForSubscriptionsClientImpl.java deleted file mode 100644 index 11c37fd3a56d7..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForSubscriptionsClientImpl.java +++ /dev/null @@ -1,351 +0,0 @@ -// Copyright (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.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.DevicesForSubscriptionsClient; -import com.azure.resourcemanager.security.fluent.models.DeviceInner; -import com.azure.resourcemanager.security.models.DeviceList; -import com.azure.resourcemanager.security.models.ManagementState; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DevicesForSubscriptionsClient. */ -public final class DevicesForSubscriptionsClientImpl implements DevicesForSubscriptionsClient { - private final ClientLogger logger = new ClientLogger(DevicesForSubscriptionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DevicesForSubscriptionsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of DevicesForSubscriptionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DevicesForSubscriptionsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create(DevicesForSubscriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterDevicesForSubscriptions to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterDevice") - private interface DevicesForSubscriptionsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/devices") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$limit") Integer limit, - @QueryParam("$skipToken") String skipToken, - @QueryParam("deviceManagementType") ManagementState deviceManagementType, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get list of the devices by their subscription. - * - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 the devices by their subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - Integer limit, String skipToken, ManagementState deviceManagementType) { - 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 = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - limit, - skipToken, - deviceManagementType, - 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 list of the devices by their subscription. - * - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 the devices by their subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - Integer limit, String skipToken, ManagementState deviceManagementType, 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 = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - limit, - skipToken, - deviceManagementType, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get list of the devices by their subscription. - * - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 the devices by their subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Integer limit, String skipToken, ManagementState deviceManagementType) { - return new PagedFlux<>( - () -> listSinglePageAsync(limit, skipToken, deviceManagementType), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get list of the devices by their 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 the devices by their subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final Integer limit = null; - final String skipToken = null; - final ManagementState deviceManagementType = null; - return new PagedFlux<>( - () -> listSinglePageAsync(limit, skipToken, deviceManagementType), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get list of the devices by their subscription. - * - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 the devices by their subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - Integer limit, String skipToken, ManagementState deviceManagementType, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(limit, skipToken, deviceManagementType, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get list of the devices by their 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 the devices by their subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final Integer limit = null; - final String skipToken = null; - final ManagementState deviceManagementType = null; - return new PagedIterable<>(listAsync(limit, skipToken, deviceManagementType)); - } - - /** - * Get list of the devices by their subscription. - * - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 the devices by their subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - Integer limit, String skipToken, ManagementState deviceManagementType, Context context) { - return new PagedIterable<>(listAsync(limit, skipToken, deviceManagementType, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink 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 Devices. - */ - @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 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 Devices. - */ - @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/DevicesForSubscriptionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForSubscriptionsImpl.java deleted file mode 100644 index 8bf12d31599f1..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesForSubscriptionsImpl.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.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.DevicesForSubscriptionsClient; -import com.azure.resourcemanager.security.fluent.models.DeviceInner; -import com.azure.resourcemanager.security.models.Device; -import com.azure.resourcemanager.security.models.DevicesForSubscriptions; -import com.azure.resourcemanager.security.models.ManagementState; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class DevicesForSubscriptionsImpl implements DevicesForSubscriptions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DevicesForSubscriptionsImpl.class); - - private final DevicesForSubscriptionsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public DevicesForSubscriptionsImpl( - DevicesForSubscriptionsClient 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 DeviceImpl(inner1, this.manager())); - } - - public PagedIterable list( - Integer limit, String skipToken, ManagementState deviceManagementType, Context context) { - PagedIterable inner = this.serviceClient().list(limit, skipToken, deviceManagementType, context); - return Utils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); - } - - private DevicesForSubscriptionsClient 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/DevicesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesImpl.java deleted file mode 100644 index f3391fbd664d3..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevicesImpl.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.DevicesClient; -import com.azure.resourcemanager.security.fluent.models.DeviceInner; -import com.azure.resourcemanager.security.models.Device; -import com.azure.resourcemanager.security.models.Devices; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class DevicesImpl implements Devices { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DevicesImpl.class); - - private final DevicesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public DevicesImpl(DevicesClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Device get(String resourceId, String deviceId) { - DeviceInner inner = this.serviceClient().get(resourceId, deviceId); - if (inner != null) { - return new DeviceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String resourceId, String deviceId, Context context) { - Response inner = this.serviceClient().getWithResponse(resourceId, deviceId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new DeviceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private DevicesClient 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/DiscoveredSecuritySolutionImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionImpl.java index 9f8c13cde5564..65e6eb8b1f5b9 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionImpl.java @@ -32,6 +32,10 @@ public String type() { return this.innerModel().type(); } + public String location() { + return this.innerModel().location(); + } + public SecurityFamily securityFamily() { return this.innerModel().securityFamily(); } @@ -48,10 +52,6 @@ public String sku() { return this.innerModel().sku(); } - public String location() { - return this.innerModel().location(); - } - public DiscoveredSecuritySolutionInner innerModel() { return this.innerObject; } 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 index 57bb043e7b8e6..2176bccae5abf 100644 --- 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 @@ -154,7 +154,7 @@ public void deleteById(String id) { .format( "The resource ID '%s' is not valid. Missing path segment 'ingestionSettings'.", id))); } - this.deleteWithResponse(ingestionSettingName, Context.NONE).getValue(); + this.deleteWithResponse(ingestionSettingName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedAlertImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedAlertImpl.java index fbc01e3a78e91..b6ba40c4985e0 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedAlertImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedAlertImpl.java @@ -37,6 +37,15 @@ public String type() { return this.innerModel().type(); } + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public String alertType() { return this.innerModel().alertType(); } @@ -94,15 +103,6 @@ public List topDevicesLi } } - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - public IoTSecurityAggregatedAlertInner innerModel() { return this.innerObject; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedRecommendationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedRecommendationImpl.java index 1fde92fa01b25..8b33589368a06 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedRecommendationImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedRecommendationImpl.java @@ -34,6 +34,15 @@ public String type() { return this.innerModel().type(); } + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public String recommendationName() { return this.innerModel().recommendationName(); } @@ -74,15 +83,6 @@ public String logAnalyticsQuery() { return this.innerModel().logAnalyticsQuery(); } - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - public IoTSecurityAggregatedRecommendationInner innerModel() { return this.innerObject; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionModelImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionModelImpl.java index 4445d00a0a81a..3aeeba4658ee1 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionModelImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionModelImpl.java @@ -47,6 +47,15 @@ public SystemData systemData() { return this.innerModel().systemData(); } + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public String workspace() { return this.innerModel().workspace(); } @@ -121,15 +130,6 @@ public List additionalWorkspaces() { } } - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - public Region region() { return Region.fromName(this.regionName()); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertModelImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertModelImpl.java deleted file mode 100644 index c236b0feb0a4e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertModelImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.IotAlertModelInner; -import com.azure.resourcemanager.security.models.IotAlertModel; -import java.util.Collections; -import java.util.List; - -public final class IotAlertModelImpl implements IotAlertModel { - private IotAlertModelInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotAlertModelImpl( - IotAlertModelInner 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 systemAlertId() { - return this.innerModel().systemAlertId(); - } - - public String compromisedEntity() { - return this.innerModel().compromisedEntity(); - } - - public String alertType() { - return this.innerModel().alertType(); - } - - public String startTimeUtc() { - return this.innerModel().startTimeUtc(); - } - - public String endTimeUtc() { - return this.innerModel().endTimeUtc(); - } - - public List entities() { - List inner = this.innerModel().entities(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Object extendedProperties() { - return this.innerModel().extendedProperties(); - } - - public IotAlertModelInner 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/IotAlertTypeImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypeImpl.java deleted file mode 100644 index 2a3af4367be5e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypeImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.IotAlertTypeInner; -import com.azure.resourcemanager.security.models.AlertIntent; -import com.azure.resourcemanager.security.models.AlertSeverity; -import com.azure.resourcemanager.security.models.IotAlertType; -import java.util.Collections; -import java.util.List; - -public final class IotAlertTypeImpl implements IotAlertType { - private IotAlertTypeInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotAlertTypeImpl(IotAlertTypeInner 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 alertDisplayName() { - return this.innerModel().alertDisplayName(); - } - - public AlertSeverity severity() { - return this.innerModel().severity(); - } - - public String description() { - return this.innerModel().description(); - } - - public String providerName() { - return this.innerModel().providerName(); - } - - public String productName() { - return this.innerModel().productName(); - } - - public String productComponentName() { - return this.innerModel().productComponentName(); - } - - public String vendorName() { - return this.innerModel().vendorName(); - } - - public AlertIntent intent() { - return this.innerModel().intent(); - } - - public List remediationSteps() { - List inner = this.innerModel().remediationSteps(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public IotAlertTypeInner 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/IotAlertTypesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypesImpl.java deleted file mode 100644 index e60002db92f38..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypesImpl.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.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.IotAlertTypesClient; -import com.azure.resourcemanager.security.fluent.models.IotAlertTypeInner; -import com.azure.resourcemanager.security.fluent.models.IotAlertTypeListInner; -import com.azure.resourcemanager.security.models.IotAlertType; -import com.azure.resourcemanager.security.models.IotAlertTypeList; -import com.azure.resourcemanager.security.models.IotAlertTypes; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class IotAlertTypesImpl implements IotAlertTypes { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotAlertTypesImpl.class); - - private final IotAlertTypesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotAlertTypesImpl( - IotAlertTypesClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public IotAlertTypeList list() { - IotAlertTypeListInner inner = this.serviceClient().list(); - if (inner != null) { - return new IotAlertTypeListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotAlertTypeListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IotAlertType get(String iotAlertTypeName) { - IotAlertTypeInner inner = this.serviceClient().get(iotAlertTypeName); - if (inner != null) { - return new IotAlertTypeImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String iotAlertTypeName, Context context) { - Response inner = this.serviceClient().getWithResponse(iotAlertTypeName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotAlertTypeImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private IotAlertTypesClient 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/IotAlertsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertsClientImpl.java deleted file mode 100644 index 1ee5d3f55bafd..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertsClientImpl.java +++ /dev/null @@ -1,620 +0,0 @@ -// Copyright (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.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotAlertsClient; -import com.azure.resourcemanager.security.fluent.models.IotAlertModelInner; -import com.azure.resourcemanager.security.models.IotAlertListModel; -import com.azure.resourcemanager.security.models.ManagementState; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in IotAlertsClient. */ -public final class IotAlertsClientImpl implements IotAlertsClient { - private final ClientLogger logger = new ClientLogger(IotAlertsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final IotAlertsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotAlertsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotAlertsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(IotAlertsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotAlerts to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIotAle") - private interface IotAlertsService { - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/iotAlerts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("startTimeUtc>") String minStartTimeUtc, - @QueryParam("startTimeUtc<") String maxStartTimeUtc, - @QueryParam("alertType") String alertType, - @QueryParam("deviceManagementType") ManagementState deviceManagementType, - @QueryParam("compromisedEntity") String compromisedEntity, - @QueryParam("$limit") Integer limit, - @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/iotAlerts/{iotAlertId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("iotAlertId") String iotAlertId, - @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 IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param minStartTimeUtc Filter by minimum startTimeUtc (ISO 8601 format). - * @param maxStartTimeUtc Filter by maximum startTimeUtc (ISO 8601 format). - * @param alertType Filter by alert type. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param compromisedEntity Filter by compromised device. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT alerts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String scope, - String minStartTimeUtc, - String maxStartTimeUtc, - String alertType, - ManagementState deviceManagementType, - String compromisedEntity, - Integer limit, - String skipToken) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - scope, - minStartTimeUtc, - maxStartTimeUtc, - alertType, - deviceManagementType, - compromisedEntity, - limit, - skipToken, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param minStartTimeUtc Filter by minimum startTimeUtc (ISO 8601 format). - * @param maxStartTimeUtc Filter by maximum startTimeUtc (ISO 8601 format). - * @param alertType Filter by alert type. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param compromisedEntity Filter by compromised device. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT alerts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String scope, - String minStartTimeUtc, - String maxStartTimeUtc, - String alertType, - ManagementState deviceManagementType, - String compromisedEntity, - Integer limit, - String skipToken, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - scope, - minStartTimeUtc, - maxStartTimeUtc, - alertType, - deviceManagementType, - compromisedEntity, - limit, - skipToken, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param minStartTimeUtc Filter by minimum startTimeUtc (ISO 8601 format). - * @param maxStartTimeUtc Filter by maximum startTimeUtc (ISO 8601 format). - * @param alertType Filter by alert type. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param compromisedEntity Filter by compromised device. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT alerts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String scope, - String minStartTimeUtc, - String maxStartTimeUtc, - String alertType, - ManagementState deviceManagementType, - String compromisedEntity, - Integer limit, - String skipToken) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - scope, - minStartTimeUtc, - maxStartTimeUtc, - alertType, - deviceManagementType, - compromisedEntity, - limit, - skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT alerts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - final String minStartTimeUtc = null; - final String maxStartTimeUtc = null; - final String alertType = null; - final ManagementState deviceManagementType = null; - final String compromisedEntity = null; - final Integer limit = null; - final String skipToken = null; - return new PagedFlux<>( - () -> - listSinglePageAsync( - scope, - minStartTimeUtc, - maxStartTimeUtc, - alertType, - deviceManagementType, - compromisedEntity, - limit, - skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param minStartTimeUtc Filter by minimum startTimeUtc (ISO 8601 format). - * @param maxStartTimeUtc Filter by maximum startTimeUtc (ISO 8601 format). - * @param alertType Filter by alert type. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param compromisedEntity Filter by compromised device. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT alerts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String scope, - String minStartTimeUtc, - String maxStartTimeUtc, - String alertType, - ManagementState deviceManagementType, - String compromisedEntity, - Integer limit, - String skipToken, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - scope, - minStartTimeUtc, - maxStartTimeUtc, - alertType, - deviceManagementType, - compromisedEntity, - limit, - skipToken, - context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT alerts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - final String minStartTimeUtc = null; - final String maxStartTimeUtc = null; - final String alertType = null; - final ManagementState deviceManagementType = null; - final String compromisedEntity = null; - final Integer limit = null; - final String skipToken = null; - return new PagedIterable<>( - listAsync( - scope, - minStartTimeUtc, - maxStartTimeUtc, - alertType, - deviceManagementType, - compromisedEntity, - limit, - skipToken)); - } - - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param minStartTimeUtc Filter by minimum startTimeUtc (ISO 8601 format). - * @param maxStartTimeUtc Filter by maximum startTimeUtc (ISO 8601 format). - * @param alertType Filter by alert type. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param compromisedEntity Filter by compromised device. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT alerts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String scope, - String minStartTimeUtc, - String maxStartTimeUtc, - String alertType, - ManagementState deviceManagementType, - String compromisedEntity, - Integer limit, - String skipToken, - Context context) { - return new PagedIterable<>( - listAsync( - scope, - minStartTimeUtc, - maxStartTimeUtc, - alertType, - deviceManagementType, - compromisedEntity, - limit, - skipToken, - context)); - } - - /** - * Get IoT alert. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotAlertId Id of the alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String iotAlertId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotAlertId == null) { - return Mono.error(new IllegalArgumentException("Parameter iotAlertId is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), apiVersion, scope, iotAlertId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get IoT alert. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotAlertId Id of the alert. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String iotAlertId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotAlertId == null) { - return Mono.error(new IllegalArgumentException("Parameter iotAlertId is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, iotAlertId, accept, context); - } - - /** - * Get IoT alert. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotAlertId Id of the alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String iotAlertId) { - return getWithResponseAsync(scope, iotAlertId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get IoT alert. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotAlertId Id of the alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotAlertModelInner get(String scope, String iotAlertId) { - return getAsync(scope, iotAlertId).block(); - } - - /** - * Get IoT alert. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotAlertId Id of the alert. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String iotAlertId, Context context) { - return getWithResponseAsync(scope, iotAlertId, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink 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 IoT alerts. - */ - @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 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 IoT alerts. - */ - @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/IotAlertsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertsImpl.java deleted file mode 100644 index 95150c29779e2..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertsImpl.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.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.IotAlertsClient; -import com.azure.resourcemanager.security.fluent.models.IotAlertModelInner; -import com.azure.resourcemanager.security.models.IotAlertModel; -import com.azure.resourcemanager.security.models.IotAlerts; -import com.azure.resourcemanager.security.models.ManagementState; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class IotAlertsImpl implements IotAlerts { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotAlertsImpl.class); - - private final IotAlertsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotAlertsImpl( - IotAlertsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new IotAlertModelImpl(inner1, this.manager())); - } - - public PagedIterable list( - String scope, - String minStartTimeUtc, - String maxStartTimeUtc, - String alertType, - ManagementState deviceManagementType, - String compromisedEntity, - Integer limit, - String skipToken, - Context context) { - PagedIterable inner = - this - .serviceClient() - .list( - scope, - minStartTimeUtc, - maxStartTimeUtc, - alertType, - deviceManagementType, - compromisedEntity, - limit, - skipToken, - context); - return Utils.mapPage(inner, inner1 -> new IotAlertModelImpl(inner1, this.manager())); - } - - public IotAlertModel get(String scope, String iotAlertId) { - IotAlertModelInner inner = this.serviceClient().get(scope, iotAlertId); - if (inner != null) { - return new IotAlertModelImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String scope, String iotAlertId, Context context) { - Response inner = this.serviceClient().getWithResponse(scope, iotAlertId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotAlertModelImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private IotAlertsClient 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/IotDefenderSettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsClientImpl.java deleted file mode 100644 index 0adb99c46e36c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsClientImpl.java +++ /dev/null @@ -1,819 +0,0 @@ -// Copyright (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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotDefenderSettingsClient; -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsListInner; -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsModelInner; -import com.azure.resourcemanager.security.fluent.models.PackageDownloadsInner; -import com.fasterxml.jackson.databind.util.ByteBufferBackedInputStream; -import java.io.InputStream; -import java.io.SequenceInputStream; -import java.nio.ByteBuffer; -import java.util.Enumeration; -import java.util.Iterator; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in IotDefenderSettingsClient. */ -public final class IotDefenderSettingsClientImpl implements IotDefenderSettingsClient { - private final ClientLogger logger = new ClientLogger(IotDefenderSettingsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final IotDefenderSettingsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotDefenderSettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotDefenderSettingsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(IotDefenderSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotDefenderSettings to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIotDef") - private interface IotDefenderSettingsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings") - @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/iotDefenderSettings/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") IotDefenderSettingsModelInner iotDefenderSettingsModel, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default/packageDownloads") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> packageDownloads( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default" - + "/downloadManagerActivation") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono downloadManagerActivation( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List IoT Defender Settings. - * - * @throws 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 IoT Defender settings. - */ - @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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List IoT Defender 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 list of IoT Defender settings. - */ - @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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * List IoT Defender Settings. - * - * @throws 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 IoT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { - return listWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List IoT Defender Settings. - * - * @throws 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 IoT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotDefenderSettingsListInner list() { - return listAsync().block(); - } - - /** - * List IoT Defender 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 list of IoT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); - } - - /** - * Get IoT Defender Settings. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender Settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get IoT Defender 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 ioT Defender Settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * Get IoT Defender Settings. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender Settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync() { - return getWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get IoT Defender Settings. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender Settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotDefenderSettingsModelInner get() { - return getAsync().block(); - } - - /** - * Get IoT Defender 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 ioT Defender Settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(Context context) { - return getWithResponseAsync(context).block(); - } - - /** - * Create or update IoT Defender settings. - * - * @param iotDefenderSettingsModel The IoT defender settings model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - IotDefenderSettingsModelInner iotDefenderSettingsModel) { - 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 (iotDefenderSettingsModel == null) { - return Mono - .error( - new IllegalArgumentException("Parameter iotDefenderSettingsModel is required and cannot be null.")); - } else { - iotDefenderSettingsModel.validate(); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - iotDefenderSettingsModel, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update IoT Defender settings. - * - * @param iotDefenderSettingsModel The IoT defender settings model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - IotDefenderSettingsModelInner iotDefenderSettingsModel, 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 (iotDefenderSettingsModel == null) { - return Mono - .error( - new IllegalArgumentException("Parameter iotDefenderSettingsModel is required and cannot be null.")); - } else { - iotDefenderSettingsModel.validate(); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - iotDefenderSettingsModel, - accept, - context); - } - - /** - * Create or update IoT Defender settings. - * - * @param iotDefenderSettingsModel The IoT defender settings model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - IotDefenderSettingsModelInner iotDefenderSettingsModel) { - return createOrUpdateWithResponseAsync(iotDefenderSettingsModel) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update IoT Defender settings. - * - * @param iotDefenderSettingsModel The IoT defender settings model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotDefenderSettingsModelInner createOrUpdate(IotDefenderSettingsModelInner iotDefenderSettingsModel) { - return createOrUpdateAsync(iotDefenderSettingsModel).block(); - } - - /** - * Create or update IoT Defender settings. - * - * @param iotDefenderSettingsModel The IoT defender settings model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - IotDefenderSettingsModelInner iotDefenderSettingsModel, Context context) { - return createOrUpdateWithResponseAsync(iotDefenderSettingsModel, context).block(); - } - - /** - * Delete IoT Defender settings. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync() { - 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 = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete IoT Defender 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(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 = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * Delete IoT Defender settings. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync() { - return deleteWithResponseAsync().flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete IoT Defender settings. - * - * @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() { - deleteAsync().block(); - } - - /** - * Delete IoT Defender 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 response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(Context context) { - return deleteWithResponseAsync(context).block(); - } - - /** - * Information about downloadable packages. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about package downloads. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> packageDownloadsWithResponseAsync() { - 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 = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .packageDownloads( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Information about downloadable packages. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about package downloads. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> packageDownloadsWithResponseAsync(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 = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .packageDownloads(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * Information about downloadable packages. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about package downloads. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono packageDownloadsAsync() { - return packageDownloadsWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Information about downloadable packages. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about package downloads. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PackageDownloadsInner packageDownloads() { - return packageDownloadsAsync().block(); - } - - /** - * Information about downloadable packages. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about package downloads. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response packageDownloadsWithResponse(Context context) { - return packageDownloadsWithResponseAsync(context).block(); - } - - /** - * Download manager activation data defined for this 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 the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadManagerActivationWithResponseAsync() { - 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 = "2020-08-06-preview"; - final String accept = "application/zip"; - return FluxUtil - .withContext( - context -> - service - .downloadManagerActivation( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Download manager activation data defined for this 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 the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadManagerActivationWithResponseAsync(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 = "2020-08-06-preview"; - final String accept = "application/zip"; - context = this.client.mergeContext(context); - return service - .downloadManagerActivation( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * Download manager activation data defined for this 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 the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Flux downloadManagerActivationAsync() { - return downloadManagerActivationWithResponseAsync().flatMapMany(StreamResponse::getValue); - } - - /** - * Download manager activation data defined for this 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 the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream downloadManagerActivation() { - Iterator iterator = - downloadManagerActivationAsync().map(ByteBufferBackedInputStream::new).toStream().iterator(); - Enumeration enumeration = - new Enumeration() { - @Override - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - @Override - public InputStream nextElement() { - return iterator.next(); - } - }; - return new SequenceInputStream(enumeration); - } - - /** - * Download manager activation data defined for this 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 the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StreamResponse downloadManagerActivationWithResponse(Context context) { - return downloadManagerActivationWithResponseAsync(context).block(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsImpl.java deleted file mode 100644 index 506af402e27fb..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsImpl.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (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.http.rest.StreamResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotDefenderSettingsClient; -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsListInner; -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsModelInner; -import com.azure.resourcemanager.security.fluent.models.PackageDownloadsInner; -import com.azure.resourcemanager.security.models.IotDefenderSettings; -import com.azure.resourcemanager.security.models.IotDefenderSettingsList; -import com.azure.resourcemanager.security.models.IotDefenderSettingsModel; -import com.azure.resourcemanager.security.models.PackageDownloads; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.io.InputStream; - -public final class IotDefenderSettingsImpl implements IotDefenderSettings { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotDefenderSettingsImpl.class); - - private final IotDefenderSettingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotDefenderSettingsImpl( - IotDefenderSettingsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public IotDefenderSettingsList list() { - IotDefenderSettingsListInner inner = this.serviceClient().list(); - if (inner != null) { - return new IotDefenderSettingsListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotDefenderSettingsListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IotDefenderSettingsModel get() { - IotDefenderSettingsModelInner inner = this.serviceClient().get(); - if (inner != null) { - return new IotDefenderSettingsModelImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(Context context) { - Response inner = this.serviceClient().getWithResponse(context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotDefenderSettingsModelImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IotDefenderSettingsModel createOrUpdate(IotDefenderSettingsModelInner iotDefenderSettingsModel) { - IotDefenderSettingsModelInner inner = this.serviceClient().createOrUpdate(iotDefenderSettingsModel); - if (inner != null) { - return new IotDefenderSettingsModelImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse( - IotDefenderSettingsModelInner iotDefenderSettingsModel, Context context) { - Response inner = - this.serviceClient().createOrUpdateWithResponse(iotDefenderSettingsModel, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotDefenderSettingsModelImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete() { - this.serviceClient().delete(); - } - - public Response deleteWithResponse(Context context) { - return this.serviceClient().deleteWithResponse(context); - } - - public PackageDownloads packageDownloads() { - PackageDownloadsInner inner = this.serviceClient().packageDownloads(); - if (inner != null) { - return new PackageDownloadsImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response packageDownloadsWithResponse(Context context) { - Response inner = this.serviceClient().packageDownloadsWithResponse(context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new PackageDownloadsImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public InputStream downloadManagerActivation() { - return this.serviceClient().downloadManagerActivation(); - } - - public StreamResponse downloadManagerActivationWithResponse(Context context) { - return this.serviceClient().downloadManagerActivationWithResponse(context); - } - - private IotDefenderSettingsClient 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/IotDefenderSettingsListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsListImpl.java deleted file mode 100644 index 07b65d4755b7e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsListImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsListInner; -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsModelInner; -import com.azure.resourcemanager.security.models.IotDefenderSettingsList; -import com.azure.resourcemanager.security.models.IotDefenderSettingsModel; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class IotDefenderSettingsListImpl implements IotDefenderSettingsList { - private IotDefenderSettingsListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotDefenderSettingsListImpl( - IotDefenderSettingsListInner 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 IotDefenderSettingsModelImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public IotDefenderSettingsListInner 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/IotDefenderSettingsModelImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsModelImpl.java deleted file mode 100644 index 62417551af920..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotDefenderSettingsModelImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsModelInner; -import com.azure.resourcemanager.security.models.IotDefenderSettingsModel; -import com.azure.resourcemanager.security.models.OnboardingKind; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class IotDefenderSettingsModelImpl implements IotDefenderSettingsModel { - private IotDefenderSettingsModelInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotDefenderSettingsModelImpl( - IotDefenderSettingsModelInner 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 Integer deviceQuota() { - return this.innerModel().deviceQuota(); - } - - public List sentinelWorkspaceResourceIds() { - List inner = this.innerModel().sentinelWorkspaceResourceIds(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public OnboardingKind onboardingKind() { - return this.innerModel().onboardingKind(); - } - - public OffsetDateTime evaluationEndTime() { - return this.innerModel().evaluationEndTime(); - } - - public IotDefenderSettingsModelInner 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/IotRecommendationModelImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationModelImpl.java deleted file mode 100644 index 74ff6238816d3..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationModelImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.IotRecommendationModelInner; -import com.azure.resourcemanager.security.models.IotRecommendationModel; - -public final class IotRecommendationModelImpl implements IotRecommendationModel { - private IotRecommendationModelInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotRecommendationModelImpl( - IotRecommendationModelInner 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 deviceId() { - return this.innerModel().deviceId(); - } - - public String recommendationType() { - return this.innerModel().recommendationType(); - } - - public String discoveredTimeUtc() { - return this.innerModel().discoveredTimeUtc(); - } - - public Object recommendationAdditionalData() { - return this.innerModel().recommendationAdditionalData(); - } - - public IotRecommendationModelInner 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/IotRecommendationTypeImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypeImpl.java deleted file mode 100644 index 1620c9ef55374..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypeImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeInner; -import com.azure.resourcemanager.security.models.IotRecommendationType; -import com.azure.resourcemanager.security.models.RecommendationSeverity; -import java.util.Collections; -import java.util.List; - -public final class IotRecommendationTypeImpl implements IotRecommendationType { - private IotRecommendationTypeInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotRecommendationTypeImpl( - IotRecommendationTypeInner 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 recommendationDisplayName() { - return this.innerModel().recommendationDisplayName(); - } - - public RecommendationSeverity severity() { - return this.innerModel().severity(); - } - - public String description() { - return this.innerModel().description(); - } - - public String productName() { - return this.innerModel().productName(); - } - - public String productComponentName() { - return this.innerModel().productComponentName(); - } - - public String vendorName() { - return this.innerModel().vendorName(); - } - - public String control() { - return this.innerModel().control(); - } - - public List remediationSteps() { - List inner = this.innerModel().remediationSteps(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String dataSource() { - return this.innerModel().dataSource(); - } - - public IotRecommendationTypeInner 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/IotRecommendationTypeListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypeListImpl.java deleted file mode 100644 index b5df59664d331..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypeListImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeInner; -import com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeListInner; -import com.azure.resourcemanager.security.models.IotRecommendationType; -import com.azure.resourcemanager.security.models.IotRecommendationTypeList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class IotRecommendationTypeListImpl implements IotRecommendationTypeList { - private IotRecommendationTypeListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotRecommendationTypeListImpl( - IotRecommendationTypeListInner 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 IotRecommendationTypeImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public IotRecommendationTypeListInner 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/IotRecommendationTypesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypesClientImpl.java deleted file mode 100644 index 1072304d9bca3..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypesClientImpl.java +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright (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.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotRecommendationTypesClient; -import com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeInner; -import com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeListInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in IotRecommendationTypesClient. */ -public final class IotRecommendationTypesClientImpl implements IotRecommendationTypesClient { - private final ClientLogger logger = new ClientLogger(IotRecommendationTypesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final IotRecommendationTypesService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotRecommendationTypesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotRecommendationTypesClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create(IotRecommendationTypesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotRecommendationTypes to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIotRec") - private interface IotRecommendationTypesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes") - @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/iotRecommendationTypes" - + "/{iotRecommendationTypeName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("iotRecommendationTypeName") String iotRecommendationTypeName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List IoT recommendation types. - * - * @throws 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 recommendation types. - */ - @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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List IoT recommendation types. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 recommendation types. - */ - @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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * List IoT recommendation types. - * - * @throws 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 recommendation types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { - return listWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List IoT recommendation types. - * - * @throws 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 recommendation types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotRecommendationTypeListInner list() { - return listAsync().block(); - } - - /** - * List IoT recommendation types. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 recommendation types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); - } - - /** - * Get IoT recommendation type. - * - * @param iotRecommendationTypeName Name of the recommendation 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 ioT recommendation type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String iotRecommendationTypeName) { - 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 (iotRecommendationTypeName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter iotRecommendationTypeName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - iotRecommendationTypeName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get IoT recommendation type. - * - * @param iotRecommendationTypeName Name of the recommendation 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 ioT recommendation type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String iotRecommendationTypeName, 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 (iotRecommendationTypeName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter iotRecommendationTypeName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - iotRecommendationTypeName, - accept, - context); - } - - /** - * Get IoT recommendation type. - * - * @param iotRecommendationTypeName Name of the recommendation 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 ioT recommendation type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String iotRecommendationTypeName) { - return getWithResponseAsync(iotRecommendationTypeName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get IoT recommendation type. - * - * @param iotRecommendationTypeName Name of the recommendation 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 ioT recommendation type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotRecommendationTypeInner get(String iotRecommendationTypeName) { - return getAsync(iotRecommendationTypeName).block(); - } - - /** - * Get IoT recommendation type. - * - * @param iotRecommendationTypeName Name of the recommendation 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 ioT recommendation type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String iotRecommendationTypeName, Context context) { - return getWithResponseAsync(iotRecommendationTypeName, context).block(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypesImpl.java deleted file mode 100644 index 6954641f9605c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationTypesImpl.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.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.IotRecommendationTypesClient; -import com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeInner; -import com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeListInner; -import com.azure.resourcemanager.security.models.IotRecommendationType; -import com.azure.resourcemanager.security.models.IotRecommendationTypeList; -import com.azure.resourcemanager.security.models.IotRecommendationTypes; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class IotRecommendationTypesImpl implements IotRecommendationTypes { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotRecommendationTypesImpl.class); - - private final IotRecommendationTypesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotRecommendationTypesImpl( - IotRecommendationTypesClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public IotRecommendationTypeList list() { - IotRecommendationTypeListInner inner = this.serviceClient().list(); - if (inner != null) { - return new IotRecommendationTypeListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotRecommendationTypeListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IotRecommendationType get(String iotRecommendationTypeName) { - IotRecommendationTypeInner inner = this.serviceClient().get(iotRecommendationTypeName); - if (inner != null) { - return new IotRecommendationTypeImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String iotRecommendationTypeName, Context context) { - Response inner = - this.serviceClient().getWithResponse(iotRecommendationTypeName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotRecommendationTypeImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private IotRecommendationTypesClient 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/IotRecommendationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationsClientImpl.java deleted file mode 100644 index a18eeacf9bf85..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationsClientImpl.java +++ /dev/null @@ -1,509 +0,0 @@ -// Copyright (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.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotRecommendationsClient; -import com.azure.resourcemanager.security.fluent.models.IotRecommendationModelInner; -import com.azure.resourcemanager.security.models.IotRecommendationListModel; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in IotRecommendationsClient. */ -public final class IotRecommendationsClientImpl implements IotRecommendationsClient { - private final ClientLogger logger = new ClientLogger(IotRecommendationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final IotRecommendationsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotRecommendationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotRecommendationsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(IotRecommendationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotRecommendations to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIotRec") - private interface IotRecommendationsService { - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/iotRecommendations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("recommendationType") String recommendationType, - @QueryParam("deviceId") String deviceId, - @QueryParam("$limit") Integer limit, - @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/iotRecommendations/{iotRecommendationId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("iotRecommendationId") String iotRecommendationId, - @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 IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param recommendationType Filter by recommendation type. - * @param deviceId Filter by device id. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT recommendations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String scope, String recommendationType, String deviceId, Integer limit, String skipToken) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - scope, - recommendationType, - deviceId, - limit, - skipToken, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param recommendationType Filter by recommendation type. - * @param deviceId Filter by device id. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT recommendations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String scope, String recommendationType, String deviceId, Integer limit, String skipToken, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - scope, - recommendationType, - deviceId, - limit, - skipToken, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param recommendationType Filter by recommendation type. - * @param deviceId Filter by device id. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String scope, String recommendationType, String deviceId, Integer limit, String skipToken) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, recommendationType, deviceId, limit, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - final String recommendationType = null; - final String deviceId = null; - final Integer limit = null; - final String skipToken = null; - return new PagedFlux<>( - () -> listSinglePageAsync(scope, recommendationType, deviceId, limit, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param recommendationType Filter by recommendation type. - * @param deviceId Filter by device id. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String scope, String recommendationType, String deviceId, Integer limit, String skipToken, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, recommendationType, deviceId, limit, skipToken, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - final String recommendationType = null; - final String deviceId = null; - final Integer limit = null; - final String skipToken = null; - return new PagedIterable<>(listAsync(scope, recommendationType, deviceId, limit, skipToken)); - } - - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param recommendationType Filter by recommendation type. - * @param deviceId Filter by device id. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String scope, String recommendationType, String deviceId, Integer limit, String skipToken, Context context) { - return new PagedIterable<>(listAsync(scope, recommendationType, deviceId, limit, skipToken, context)); - } - - /** - * Get IoT recommendation. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotRecommendationId Id of the recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String iotRecommendationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotRecommendationId == null) { - return Mono - .error(new IllegalArgumentException("Parameter iotRecommendationId is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.get(this.client.getEndpoint(), apiVersion, scope, iotRecommendationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get IoT recommendation. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotRecommendationId Id of the recommendation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scope, String iotRecommendationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotRecommendationId == null) { - return Mono - .error(new IllegalArgumentException("Parameter iotRecommendationId is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, iotRecommendationId, accept, context); - } - - /** - * Get IoT recommendation. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotRecommendationId Id of the recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String iotRecommendationId) { - return getWithResponseAsync(scope, iotRecommendationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get IoT recommendation. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotRecommendationId Id of the recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotRecommendationModelInner get(String scope, String iotRecommendationId) { - return getAsync(scope, iotRecommendationId).block(); - } - - /** - * Get IoT recommendation. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotRecommendationId Id of the recommendation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String scope, String iotRecommendationId, Context context) { - return getWithResponseAsync(scope, iotRecommendationId, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink 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 IoT recommendations. - */ - @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 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 IoT recommendations. - */ - @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/IotRecommendationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationsImpl.java deleted file mode 100644 index 838a95d636896..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotRecommendationsImpl.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.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.IotRecommendationsClient; -import com.azure.resourcemanager.security.fluent.models.IotRecommendationModelInner; -import com.azure.resourcemanager.security.models.IotRecommendationModel; -import com.azure.resourcemanager.security.models.IotRecommendations; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class IotRecommendationsImpl implements IotRecommendations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotRecommendationsImpl.class); - - private final IotRecommendationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotRecommendationsImpl( - IotRecommendationsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new IotRecommendationModelImpl(inner1, this.manager())); - } - - public PagedIterable list( - String scope, String recommendationType, String deviceId, Integer limit, String skipToken, Context context) { - PagedIterable inner = - this.serviceClient().list(scope, recommendationType, deviceId, limit, skipToken, context); - return Utils.mapPage(inner, inner1 -> new IotRecommendationModelImpl(inner1, this.manager())); - } - - public IotRecommendationModel get(String scope, String iotRecommendationId) { - IotRecommendationModelInner inner = this.serviceClient().get(scope, iotRecommendationId); - if (inner != null) { - return new IotRecommendationModelImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String scope, String iotRecommendationId, Context context) { - Response inner = - this.serviceClient().getWithResponse(scope, iotRecommendationId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotRecommendationModelImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private IotRecommendationsClient 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/IotSecuritySolutionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsImpl.java index 59cdf313cd78e..b6cd2d1cf9fe2 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsImpl.java @@ -146,7 +146,7 @@ public void deleteById(String id) { "The resource ID '%s' is not valid. Missing path segment 'iotSecuritySolutions'.", id))); } - this.deleteWithResponse(resourceGroupName, solutionName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, solutionName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsClientImpl.java deleted file mode 100644 index edde9f94c091a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsClientImpl.java +++ /dev/null @@ -1,1026 +0,0 @@ -// Copyright (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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotSensorsClient; -import com.azure.resourcemanager.security.fluent.models.IotSensorsListInner; -import com.azure.resourcemanager.security.fluent.models.IotSensorsModelInner; -import com.azure.resourcemanager.security.models.ResetPasswordInput; -import com.fasterxml.jackson.databind.util.ByteBufferBackedInputStream; -import java.io.InputStream; -import java.io.SequenceInputStream; -import java.nio.ByteBuffer; -import java.util.Enumeration; -import java.util.Iterator; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in IotSensorsClient. */ -public final class IotSensorsClientImpl implements IotSensorsClient { - private final ClientLogger logger = new ClientLogger(IotSensorsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final IotSensorsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotSensorsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotSensorsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(IotSensorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotSensors to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIotSen") - private interface IotSensorsService { - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/iotSensors") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("iotSensorName") String iotSensorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("iotSensorName") String iotSensorName, - @BodyParam("application/json") IotSensorsModelInner iotSensorsModel, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("iotSensorName") String iotSensorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/downloadActivation") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono downloadActivation( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("iotSensorName") String iotSensorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/downloadResetPassword") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono downloadResetPassword( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("iotSensorName") String iotSensorName, - @BodyParam("application/json") ResetPasswordInput body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/triggerTiPackageUpdate") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> triggerTiPackageUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("iotSensorName") String iotSensorName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List IoT sensors. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List IoT sensors. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, accept, context); - } - - /** - * List IoT sensors. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String scope) { - return listWithResponseAsync(scope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List IoT sensors. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotSensorsListInner list(String scope) { - return listAsync(scope).block(); - } - - /** - * List IoT sensors. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String scope, Context context) { - return listWithResponseAsync(scope, context).block(); - } - - /** - * Get IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String iotSensorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), apiVersion, scope, iotSensorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scope, String iotSensorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, iotSensorName, accept, context); - } - - /** - * Get IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String iotSensorName) { - return getWithResponseAsync(scope, iotSensorName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotSensorsModelInner get(String scope, String iotSensorName) { - return getAsync(scope, iotSensorName).block(); - } - - /** - * Get IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String iotSensorName, Context context) { - return getWithResponseAsync(scope, iotSensorName, context).block(); - } - - /** - * Create or update IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param iotSensorsModel The IoT sensor model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String scope, String iotSensorName, IotSensorsModelInner iotSensorsModel) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - if (iotSensorsModel == null) { - return Mono - .error(new IllegalArgumentException("Parameter iotSensorsModel is required and cannot be null.")); - } else { - iotSensorsModel.validate(); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - scope, - iotSensorName, - iotSensorsModel, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param iotSensorsModel The IoT sensor model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String scope, String iotSensorName, IotSensorsModelInner iotSensorsModel, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - if (iotSensorsModel == null) { - return Mono - .error(new IllegalArgumentException("Parameter iotSensorsModel is required and cannot be null.")); - } else { - iotSensorsModel.validate(); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), apiVersion, scope, iotSensorName, iotSensorsModel, accept, context); - } - - /** - * Create or update IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param iotSensorsModel The IoT sensor model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String scope, String iotSensorName, IotSensorsModelInner iotSensorsModel) { - return createOrUpdateWithResponseAsync(scope, iotSensorName, iotSensorsModel) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param iotSensorsModel The IoT sensor model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotSensorsModelInner createOrUpdate( - String scope, String iotSensorName, IotSensorsModelInner iotSensorsModel) { - return createOrUpdateAsync(scope, iotSensorName, iotSensorsModel).block(); - } - - /** - * Create or update IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param iotSensorsModel The IoT sensor model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String scope, String iotSensorName, IotSensorsModelInner iotSensorsModel, Context context) { - return createOrUpdateWithResponseAsync(scope, iotSensorName, iotSensorsModel, context).block(); - } - - /** - * Delete IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String scope, String iotSensorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), apiVersion, scope, iotSensorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String scope, String iotSensorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, scope, iotSensorName, accept, context); - } - - /** - * Delete IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String scope, String iotSensorName) { - return deleteWithResponseAsync(scope, iotSensorName).flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String scope, String iotSensorName) { - deleteAsync(scope, iotSensorName).block(); - } - - /** - * Delete IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String scope, String iotSensorName, Context context) { - return deleteWithResponseAsync(scope, iotSensorName, context).block(); - } - - /** - * Download sensor activation file. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadActivationWithResponseAsync(String scope, String iotSensorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/zip"; - return FluxUtil - .withContext( - context -> - service - .downloadActivation( - this.client.getEndpoint(), apiVersion, scope, iotSensorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Download sensor activation file. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadActivationWithResponseAsync( - String scope, String iotSensorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/zip"; - context = this.client.mergeContext(context); - return service.downloadActivation(this.client.getEndpoint(), apiVersion, scope, iotSensorName, accept, context); - } - - /** - * Download sensor activation file. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Flux downloadActivationAsync(String scope, String iotSensorName) { - return downloadActivationWithResponseAsync(scope, iotSensorName).flatMapMany(StreamResponse::getValue); - } - - /** - * Download sensor activation file. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream downloadActivation(String scope, String iotSensorName) { - Iterator iterator = - downloadActivationAsync(scope, iotSensorName).map(ByteBufferBackedInputStream::new).toStream().iterator(); - Enumeration enumeration = - new Enumeration() { - @Override - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - @Override - public InputStream nextElement() { - return iterator.next(); - } - }; - return new SequenceInputStream(enumeration); - } - - /** - * Download sensor activation file. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StreamResponse downloadActivationWithResponse(String scope, String iotSensorName, Context context) { - return downloadActivationWithResponseAsync(scope, iotSensorName, context).block(); - } - - /** - * Download file for reset password of the sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param body The reset password input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadResetPasswordWithResponseAsync( - String scope, String iotSensorName, ResetPasswordInput body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/zip"; - return FluxUtil - .withContext( - context -> - service - .downloadResetPassword( - this.client.getEndpoint(), apiVersion, scope, iotSensorName, body, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Download file for reset password of the sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param body The reset password input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadResetPasswordWithResponseAsync( - String scope, String iotSensorName, ResetPasswordInput body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/zip"; - context = this.client.mergeContext(context); - return service - .downloadResetPassword(this.client.getEndpoint(), apiVersion, scope, iotSensorName, body, accept, context); - } - - /** - * Download file for reset password of the sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param body The reset password input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Flux downloadResetPasswordAsync(String scope, String iotSensorName, ResetPasswordInput body) { - return downloadResetPasswordWithResponseAsync(scope, iotSensorName, body).flatMapMany(StreamResponse::getValue); - } - - /** - * Download file for reset password of the sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param body The reset password input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream downloadResetPassword(String scope, String iotSensorName, ResetPasswordInput body) { - Iterator iterator = - downloadResetPasswordAsync(scope, iotSensorName, body) - .map(ByteBufferBackedInputStream::new) - .toStream() - .iterator(); - Enumeration enumeration = - new Enumeration() { - @Override - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - @Override - public InputStream nextElement() { - return iterator.next(); - } - }; - return new SequenceInputStream(enumeration); - } - - /** - * Download file for reset password of the sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param body The reset password input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StreamResponse downloadResetPasswordWithResponse( - String scope, String iotSensorName, ResetPasswordInput body, Context context) { - return downloadResetPasswordWithResponseAsync(scope, iotSensorName, body, context).block(); - } - - /** - * Trigger threat intelligence package update. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> triggerTiPackageUpdateWithResponseAsync(String scope, String iotSensorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .triggerTiPackageUpdate( - this.client.getEndpoint(), apiVersion, scope, iotSensorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Trigger threat intelligence package update. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> triggerTiPackageUpdateWithResponseAsync( - String scope, String iotSensorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSensorName == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .triggerTiPackageUpdate(this.client.getEndpoint(), apiVersion, scope, iotSensorName, accept, context); - } - - /** - * Trigger threat intelligence package update. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono triggerTiPackageUpdateAsync(String scope, String iotSensorName) { - return triggerTiPackageUpdateWithResponseAsync(scope, iotSensorName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Trigger threat intelligence package update. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 triggerTiPackageUpdate(String scope, String iotSensorName) { - triggerTiPackageUpdateAsync(scope, iotSensorName).block(); - } - - /** - * Trigger threat intelligence package update. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response triggerTiPackageUpdateWithResponse(String scope, String iotSensorName, Context context) { - return triggerTiPackageUpdateWithResponseAsync(scope, iotSensorName, context).block(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsImpl.java deleted file mode 100644 index 73997c7903a5f..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsImpl.java +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (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.http.rest.StreamResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotSensorsClient; -import com.azure.resourcemanager.security.fluent.models.IotSensorsListInner; -import com.azure.resourcemanager.security.fluent.models.IotSensorsModelInner; -import com.azure.resourcemanager.security.models.IotSensors; -import com.azure.resourcemanager.security.models.IotSensorsList; -import com.azure.resourcemanager.security.models.IotSensorsModel; -import com.azure.resourcemanager.security.models.ResetPasswordInput; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.io.InputStream; - -public final class IotSensorsImpl implements IotSensors { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotSensorsImpl.class); - - private final IotSensorsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotSensorsImpl( - IotSensorsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public IotSensorsList list(String scope) { - IotSensorsListInner inner = this.serviceClient().list(scope); - if (inner != null) { - return new IotSensorsListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse(String scope, Context context) { - Response inner = this.serviceClient().listWithResponse(scope, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotSensorsListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IotSensorsModel get(String scope, String iotSensorName) { - IotSensorsModelInner inner = this.serviceClient().get(scope, iotSensorName); - if (inner != null) { - return new IotSensorsModelImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String scope, String iotSensorName, Context context) { - Response inner = this.serviceClient().getWithResponse(scope, iotSensorName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotSensorsModelImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void deleteByResourceGroup(String scope, String iotSensorName) { - this.serviceClient().delete(scope, iotSensorName); - } - - public Response deleteWithResponse(String scope, String iotSensorName, Context context) { - return this.serviceClient().deleteWithResponse(scope, iotSensorName, context); - } - - public InputStream downloadActivation(String scope, String iotSensorName) { - return this.serviceClient().downloadActivation(scope, iotSensorName); - } - - public StreamResponse downloadActivationWithResponse(String scope, String iotSensorName, Context context) { - return this.serviceClient().downloadActivationWithResponse(scope, iotSensorName, context); - } - - public InputStream downloadResetPassword(String scope, String iotSensorName, ResetPasswordInput body) { - return this.serviceClient().downloadResetPassword(scope, iotSensorName, body); - } - - public StreamResponse downloadResetPasswordWithResponse( - String scope, String iotSensorName, ResetPasswordInput body, Context context) { - return this.serviceClient().downloadResetPasswordWithResponse(scope, iotSensorName, body, context); - } - - public void triggerTiPackageUpdate(String scope, String iotSensorName) { - this.serviceClient().triggerTiPackageUpdate(scope, iotSensorName); - } - - public Response triggerTiPackageUpdateWithResponse(String scope, String iotSensorName, Context context) { - return this.serviceClient().triggerTiPackageUpdateWithResponse(scope, iotSensorName, context); - } - - public IotSensorsModel getById(String id) { - String scope = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", "scope"); - if (scope == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String iotSensorName = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", "iotSensorName"); - if (iotSensorName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'iotSensors'.", id))); - } - return this.getWithResponse(scope, iotSensorName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String scope = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", "scope"); - if (scope == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String iotSensorName = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", "iotSensorName"); - if (iotSensorName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'iotSensors'.", id))); - } - return this.getWithResponse(scope, iotSensorName, context); - } - - public void deleteById(String id) { - String scope = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", "scope"); - if (scope == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String iotSensorName = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", "iotSensorName"); - if (iotSensorName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'iotSensors'.", id))); - } - this.deleteWithResponse(scope, iotSensorName, Context.NONE).getValue(); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String scope = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", "scope"); - if (scope == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String iotSensorName = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", "iotSensorName"); - if (iotSensorName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'iotSensors'.", id))); - } - return this.deleteWithResponse(scope, iotSensorName, context); - } - - private IotSensorsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public IotSensorsModelImpl define(String name) { - return new IotSensorsModelImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsListImpl.java deleted file mode 100644 index dffae09845d2c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsListImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.IotSensorsListInner; -import com.azure.resourcemanager.security.fluent.models.IotSensorsModelInner; -import com.azure.resourcemanager.security.models.IotSensorsList; -import com.azure.resourcemanager.security.models.IotSensorsModel; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class IotSensorsListImpl implements IotSensorsList { - private IotSensorsListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotSensorsListImpl( - IotSensorsListInner 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 IotSensorsModelImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public IotSensorsListInner 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/IotSensorsModelImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsModelImpl.java deleted file mode 100644 index 75cbf9d345a2c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSensorsModelImpl.java +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright (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.StreamResponse; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IotSensorsModelInner; -import com.azure.resourcemanager.security.models.IotSensorsModel; -import com.azure.resourcemanager.security.models.ResetPasswordInput; -import com.azure.resourcemanager.security.models.SensorStatus; -import com.azure.resourcemanager.security.models.SensorType; -import com.azure.resourcemanager.security.models.TiStatus; -import java.io.InputStream; - -public final class IotSensorsModelImpl implements IotSensorsModel, IotSensorsModel.Definition, IotSensorsModel.Update { - private IotSensorsModelInner 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 String connectivityTime() { - return this.innerModel().connectivityTime(); - } - - public String creationTime() { - return this.innerModel().creationTime(); - } - - public Boolean dynamicLearning() { - return this.innerModel().dynamicLearning(); - } - - public Boolean learningMode() { - return this.innerModel().learningMode(); - } - - public SensorStatus sensorStatus() { - return this.innerModel().sensorStatus(); - } - - public String sensorVersion() { - return this.innerModel().sensorVersion(); - } - - public Boolean tiAutomaticUpdates() { - return this.innerModel().tiAutomaticUpdates(); - } - - public TiStatus tiStatus() { - return this.innerModel().tiStatus(); - } - - public String tiVersion() { - return this.innerModel().tiVersion(); - } - - public String zone() { - return this.innerModel().zone(); - } - - public SensorType sensorType() { - return this.innerModel().sensorType(); - } - - public IotSensorsModelInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String scope; - - private String iotSensorName; - - public IotSensorsModelImpl withExistingScope(String scope) { - this.scope = scope; - return this; - } - - public IotSensorsModel create() { - this.innerObject = - serviceManager - .serviceClient() - .getIotSensors() - .createOrUpdateWithResponse(scope, iotSensorName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public IotSensorsModel create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getIotSensors() - .createOrUpdateWithResponse(scope, iotSensorName, this.innerModel(), context) - .getValue(); - return this; - } - - IotSensorsModelImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new IotSensorsModelInner(); - this.serviceManager = serviceManager; - this.iotSensorName = name; - } - - public IotSensorsModelImpl update() { - return this; - } - - public IotSensorsModel apply() { - this.innerObject = - serviceManager - .serviceClient() - .getIotSensors() - .createOrUpdateWithResponse(scope, iotSensorName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public IotSensorsModel apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getIotSensors() - .createOrUpdateWithResponse(scope, iotSensorName, this.innerModel(), context) - .getValue(); - return this; - } - - IotSensorsModelImpl( - IotSensorsModelInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.scope = - Utils - .getValueFromIdByParameterName( - innerObject.id(), "/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", "scope"); - this.iotSensorName = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", - "iotSensorName"); - } - - public IotSensorsModel refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getIotSensors() - .getWithResponse(scope, iotSensorName, Context.NONE) - .getValue(); - return this; - } - - public IotSensorsModel refresh(Context context) { - this.innerObject = - serviceManager.serviceClient().getIotSensors().getWithResponse(scope, iotSensorName, context).getValue(); - return this; - } - - public InputStream downloadActivation() { - return serviceManager.iotSensors().downloadActivation(scope, iotSensorName); - } - - public StreamResponse downloadActivationWithResponse(Context context) { - return serviceManager.iotSensors().downloadActivationWithResponse(scope, iotSensorName, context); - } - - public InputStream downloadResetPassword(ResetPasswordInput body) { - return serviceManager.iotSensors().downloadResetPassword(scope, iotSensorName, body); - } - - public StreamResponse downloadResetPasswordWithResponse(ResetPasswordInput body, Context context) { - return serviceManager.iotSensors().downloadResetPasswordWithResponse(scope, iotSensorName, body, context); - } - - public void triggerTiPackageUpdate() { - serviceManager.iotSensors().triggerTiPackageUpdate(scope, iotSensorName); - } - - public Response triggerTiPackageUpdateWithResponse(Context context) { - return serviceManager.iotSensors().triggerTiPackageUpdateWithResponse(scope, iotSensorName, context); - } - - public IotSensorsModelImpl withTiAutomaticUpdates(Boolean tiAutomaticUpdates) { - this.innerModel().withTiAutomaticUpdates(tiAutomaticUpdates); - return this; - } - - public IotSensorsModelImpl withZone(String zone) { - this.innerModel().withZone(zone); - return this; - } - - public IotSensorsModelImpl withSensorType(SensorType sensorType) { - this.innerModel().withSensorType(sensorType); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesClientImpl.java deleted file mode 100644 index 47c040539e41a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesClientImpl.java +++ /dev/null @@ -1,537 +0,0 @@ -// Copyright (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.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.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotSitesClient; -import com.azure.resourcemanager.security.fluent.models.IotSitesListInner; -import com.azure.resourcemanager.security.fluent.models.IotSitesModelInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in IotSitesClient. */ -public final class IotSitesClientImpl implements IotSitesClient { - private final ClientLogger logger = new ClientLogger(IotSitesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final IotSitesService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotSitesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotSitesClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(IotSitesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotSites to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIotSit") - private interface IotSitesService { - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/iotSites") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/iotSites/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{scope}/providers/Microsoft.Security/iotSites/default") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @BodyParam("application/json") IotSitesModelInner iotSitesModel, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{scope}/providers/Microsoft.Security/iotSites/default") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List IoT sites. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT sites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List IoT sites. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT sites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, accept, context); - } - - /** - * List IoT sites. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT sites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String scope) { - return listWithResponseAsync(scope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List IoT sites. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT sites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotSitesListInner list(String scope) { - return listAsync(scope).block(); - } - - /** - * List IoT sites. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IoT sites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String scope, Context context) { - return listWithResponseAsync(scope, context).block(); - } - - /** - * Get IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, scope, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, accept, context); - } - - /** - * Get IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope) { - return getWithResponseAsync(scope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotSitesModelInner get(String scope) { - return getAsync(scope).block(); - } - - /** - * Get IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, Context context) { - return getWithResponseAsync(scope, context).block(); - } - - /** - * Create or update IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSitesModel The IoT sites model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String scope, IotSitesModelInner iotSitesModel) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSitesModel == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSitesModel is required and cannot be null.")); - } else { - iotSitesModel.validate(); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate(this.client.getEndpoint(), apiVersion, scope, iotSitesModel, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSitesModel The IoT sites model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String scope, IotSitesModelInner iotSitesModel, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (iotSitesModel == null) { - return Mono.error(new IllegalArgumentException("Parameter iotSitesModel is required and cannot be null.")); - } else { - iotSitesModel.validate(); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, iotSitesModel, accept, context); - } - - /** - * Create or update IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSitesModel The IoT sites model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String scope, IotSitesModelInner iotSitesModel) { - return createOrUpdateWithResponseAsync(scope, iotSitesModel) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSitesModel The IoT sites model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotSitesModelInner createOrUpdate(String scope, IotSitesModelInner iotSitesModel) { - return createOrUpdateAsync(scope, iotSitesModel).block(); - } - - /** - * Create or update IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSitesModel The IoT sites model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String scope, IotSitesModelInner iotSitesModel, Context context) { - return createOrUpdateWithResponseAsync(scope, iotSitesModel, context).block(); - } - - /** - * Delete IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, scope, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, scope, accept, context); - } - - /** - * Delete IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String scope) { - return deleteWithResponseAsync(scope).flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String scope) { - deleteAsync(scope).block(); - } - - /** - * Delete IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String scope, Context context) { - return deleteWithResponseAsync(scope, context).block(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesImpl.java deleted file mode 100644 index 4b705e75ad666..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesImpl.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (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.IotSitesClient; -import com.azure.resourcemanager.security.fluent.models.IotSitesListInner; -import com.azure.resourcemanager.security.fluent.models.IotSitesModelInner; -import com.azure.resourcemanager.security.models.IotSites; -import com.azure.resourcemanager.security.models.IotSitesList; -import com.azure.resourcemanager.security.models.IotSitesModel; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class IotSitesImpl implements IotSites { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotSitesImpl.class); - - private final IotSitesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotSitesImpl(IotSitesClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public IotSitesList list(String scope) { - IotSitesListInner inner = this.serviceClient().list(scope); - if (inner != null) { - return new IotSitesListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse(String scope, Context context) { - Response inner = this.serviceClient().listWithResponse(scope, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotSitesListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IotSitesModel get(String scope) { - IotSitesModelInner inner = this.serviceClient().get(scope); - if (inner != null) { - return new IotSitesModelImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String scope, Context context) { - Response inner = this.serviceClient().getWithResponse(scope, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotSitesModelImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IotSitesModel createOrUpdate(String scope, IotSitesModelInner iotSitesModel) { - IotSitesModelInner inner = this.serviceClient().createOrUpdate(scope, iotSitesModel); - if (inner != null) { - return new IotSitesModelImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse( - String scope, IotSitesModelInner iotSitesModel, Context context) { - Response inner = - this.serviceClient().createOrUpdateWithResponse(scope, iotSitesModel, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IotSitesModelImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String scope) { - this.serviceClient().delete(scope); - } - - public Response deleteWithResponse(String scope, Context context) { - return this.serviceClient().deleteWithResponse(scope, context); - } - - private IotSitesClient 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/IotSitesListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesListImpl.java deleted file mode 100644 index a4c09713ae5f5..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesListImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.IotSitesListInner; -import com.azure.resourcemanager.security.fluent.models.IotSitesModelInner; -import com.azure.resourcemanager.security.models.IotSitesList; -import com.azure.resourcemanager.security.models.IotSitesModel; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class IotSitesListImpl implements IotSitesList { - private IotSitesListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotSitesListImpl(IotSitesListInner 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 IotSitesModelImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public IotSitesListInner 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/IotSitesModelImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesModelImpl.java deleted file mode 100644 index 93d7305087cd4..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSitesModelImpl.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.IotSitesModelInner; -import com.azure.resourcemanager.security.models.IotSitesModel; -import java.util.Collections; -import java.util.Map; - -public final class IotSitesModelImpl implements IotSitesModel { - private IotSitesModelInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IotSitesModelImpl( - IotSitesModelInner 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 tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public IotSitesModelInner 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/JitNetworkAccessPoliciesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPoliciesImpl.java index aaf32f637f5c2..69f6262bc9a30 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPoliciesImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPoliciesImpl.java @@ -233,7 +233,7 @@ public void deleteById(String id) { "The resource ID '%s' is not valid. Missing path segment 'jitNetworkAccessPolicies'.", id))); } - this.deleteWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPolicyImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPolicyImpl.java index eb48f5aa58c7a..b978ea5e4f044 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPolicyImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPolicyImpl.java @@ -33,6 +33,14 @@ public String type() { return this.innerModel().type(); } + public String kind() { + return this.innerModel().kind(); + } + + public String location() { + return this.innerModel().location(); + } + public List virtualMachines() { List inner = this.innerModel().virtualMachines(); if (inner != null) { @@ -60,14 +68,6 @@ public String provisioningState() { return this.innerModel().provisioningState(); } - public String kind() { - return this.innerModel().kind(); - } - - public String location() { - return this.innerModel().location(); - } - public Region region() { return Region.fromName(this.regionName()); } @@ -184,13 +184,13 @@ public JitNetworkAccessPolicyImpl withVirtualMachines(List requests) { - this.innerModel().withRequests(requests); + public JitNetworkAccessPolicyImpl withKind(String kind) { + this.innerModel().withKind(kind); return this; } - public JitNetworkAccessPolicyImpl withKind(String kind) { - this.innerModel().withKind(kind); + public JitNetworkAccessPolicyImpl withRequests(List requests) { + this.innerModel().withRequests(requests); return this; } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataImpl.java similarity index 53% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorImpl.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataImpl.java index 0e90e7e569cbb..fdf2e0b92f461 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataImpl.java @@ -4,16 +4,16 @@ package com.azure.resourcemanager.security.implementation; -import com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorInner; -import com.azure.resourcemanager.security.models.OnPremiseIotSensor; +import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner; +import com.azure.resourcemanager.security.models.MdeOnboardingData; -public final class OnPremiseIotSensorImpl implements OnPremiseIotSensor { - private OnPremiseIotSensorInner innerObject; +public final class MdeOnboardingDataImpl implements MdeOnboardingData { + private MdeOnboardingDataInner innerObject; private final com.azure.resourcemanager.security.SecurityManager serviceManager; - OnPremiseIotSensorImpl( - OnPremiseIotSensorInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + MdeOnboardingDataImpl( + MdeOnboardingDataInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -30,11 +30,15 @@ public String type() { return this.innerModel().type(); } - public Object properties() { - return this.innerModel().properties(); + public byte[] onboardingPackageWindows() { + return this.innerModel().onboardingPackageWindows(); } - public OnPremiseIotSensorInner innerModel() { + public byte[] onboardingPackageLinux() { + return this.innerModel().onboardingPackageLinux(); + } + + public MdeOnboardingDataInner innerModel() { return this.innerObject; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypeListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataListImpl.java similarity index 52% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypeListImpl.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataListImpl.java index 70c5b894a55df..a6a826ba37146 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypeListImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataListImpl.java @@ -4,40 +4,40 @@ package com.azure.resourcemanager.security.implementation; -import com.azure.resourcemanager.security.fluent.models.IotAlertTypeInner; -import com.azure.resourcemanager.security.fluent.models.IotAlertTypeListInner; -import com.azure.resourcemanager.security.models.IotAlertType; -import com.azure.resourcemanager.security.models.IotAlertTypeList; +import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner; +import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataListInner; +import com.azure.resourcemanager.security.models.MdeOnboardingData; +import com.azure.resourcemanager.security.models.MdeOnboardingDataList; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -public final class IotAlertTypeListImpl implements IotAlertTypeList { - private IotAlertTypeListInner innerObject; +public final class MdeOnboardingDataListImpl implements MdeOnboardingDataList { + private MdeOnboardingDataListInner innerObject; private final com.azure.resourcemanager.security.SecurityManager serviceManager; - IotAlertTypeListImpl( - IotAlertTypeListInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + MdeOnboardingDataListImpl( + MdeOnboardingDataListInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } - public List value() { - List inner = this.innerModel().value(); + public List value() { + List inner = this.innerModel().value(); if (inner != null) { return Collections .unmodifiableList( inner .stream() - .map(inner1 -> new IotAlertTypeImpl(inner1, this.manager())) + .map(inner1 -> new MdeOnboardingDataImpl(inner1, this.manager())) .collect(Collectors.toList())); } else { return Collections.emptyList(); } } - public IotAlertTypeListInner innerModel() { + public MdeOnboardingDataListInner innerModel() { return this.innerObject; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsClientImpl.java similarity index 68% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypesClientImpl.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsClientImpl.java index ac01b45500fb8..3d75411b321d6 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotAlertTypesClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsClientImpl.java @@ -22,44 +22,44 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotAlertTypesClient; -import com.azure.resourcemanager.security.fluent.models.IotAlertTypeInner; -import com.azure.resourcemanager.security.fluent.models.IotAlertTypeListInner; +import com.azure.resourcemanager.security.fluent.MdeOnboardingsClient; +import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner; +import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataListInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in IotAlertTypesClient. */ -public final class IotAlertTypesClientImpl implements IotAlertTypesClient { - private final ClientLogger logger = new ClientLogger(IotAlertTypesClientImpl.class); +/** An instance of this class provides access to all the operations defined in MdeOnboardingsClient. */ +public final class MdeOnboardingsClientImpl implements MdeOnboardingsClient { + private final ClientLogger logger = new ClientLogger(MdeOnboardingsClientImpl.class); /** The proxy service used to perform REST calls. */ - private final IotAlertTypesService service; + private final MdeOnboardingsService service; /** The service client containing this operation class. */ private final SecurityCenterImpl client; /** - * Initializes an instance of IotAlertTypesClientImpl. + * Initializes an instance of MdeOnboardingsClientImpl. * * @param client the instance of the service client containing this operation class. */ - IotAlertTypesClientImpl(SecurityCenterImpl client) { + MdeOnboardingsClientImpl(SecurityCenterImpl client) { this.service = - RestProxy.create(IotAlertTypesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + RestProxy.create(MdeOnboardingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for SecurityCenterIotAlertTypes to be used by the proxy service to + * The interface defining all the services for SecurityCenterMdeOnboardings to be used by the proxy service to * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIotAle") - private interface IotAlertTypesService { + @ServiceInterface(name = "SecurityCenterMdeOnb") + private interface MdeOnboardingsService { @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -67,27 +67,26 @@ Mono> list( Context context); @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes/{iotAlertTypeName}") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings/default") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( + Mono> get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("iotAlertTypeName") String iotAlertTypeName, @HeaderParam("Accept") String accept, Context context); } /** - * List IoT alert types. + * The configuration or data needed to onboard the machine to MDE. * * @throws 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 alert types. + * @return list of all MDE onboarding data resources. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync() { + private Mono> listWithResponseAsync() { if (this.client.getEndpoint() == null) { return Mono .error( @@ -100,7 +99,7 @@ private Mono> listWithResponseAsync() { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-06-preview"; + final String apiVersion = "2021-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -111,16 +110,16 @@ private Mono> listWithResponseAsync() { } /** - * List IoT alert types. + * The configuration or data needed to onboard the machine to MDE. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 alert types. + * @return list of all MDE onboarding data resources. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(Context context) { + private Mono> listWithResponseAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -133,24 +132,24 @@ private Mono> listWithResponseAsync(Context cont new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-06-preview"; + final String apiVersion = "2021-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); } /** - * List IoT alert types. + * The configuration or data needed to onboard the machine to MDE. * * @throws 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 alert types. + * @return list of all MDE onboarding data resources. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { + private Mono listAsync() { return listWithResponseAsync() .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -160,42 +159,40 @@ private Mono listAsync() { } /** - * List IoT alert types. + * The configuration or data needed to onboard the machine to MDE. * * @throws 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 alert types. + * @return list of all MDE onboarding data resources. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IotAlertTypeListInner list() { + public MdeOnboardingDataListInner list() { return listAsync().block(); } /** - * List IoT alert types. + * The configuration or data needed to onboard the machine to MDE. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 alert types. + * @return list of all MDE onboarding data resources. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { + public Response listWithResponse(Context context) { return listWithResponseAsync(context).block(); } /** - * Get IoT alert type. + * The default configuration or data needed to onboard the machine to MDE. * - * @param iotAlertTypeName Name of the alert 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 ioT alert type. + * @return the resource of the configuration or data needed to onboard the machine to MDE. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String iotAlertTypeName) { + private Mono> getWithResponseAsync() { if (this.client.getEndpoint() == null) { return Mono .error( @@ -208,38 +205,27 @@ private Mono> getWithResponseAsync(String iotAlertTy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (iotAlertTypeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter iotAlertTypeName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; + final String apiVersion = "2021-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - iotAlertTypeName, - accept, - context)) + .get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get IoT alert type. + * The default configuration or data needed to onboard the machine to MDE. * - * @param iotAlertTypeName Name of the alert 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 ioT alert type. + * @return the resource of the configuration or data needed to onboard the machine to MDE. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String iotAlertTypeName, Context context) { + private Mono> getWithResponseAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -252,37 +238,24 @@ private Mono> getWithResponseAsync(String iotAlertTy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (iotAlertTypeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter iotAlertTypeName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; + final String apiVersion = "2021-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - iotAlertTypeName, - accept, - context); + return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); } /** - * Get IoT alert type. + * The default configuration or data needed to onboard the machine to MDE. * - * @param iotAlertTypeName Name of the alert 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 ioT alert type. + * @return the resource of the configuration or data needed to onboard the machine to MDE. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String iotAlertTypeName) { - return getWithResponseAsync(iotAlertTypeName) + private Mono getAsync() { + return getWithResponseAsync() .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -292,31 +265,28 @@ private Mono getAsync(String iotAlertTypeName) { } /** - * Get IoT alert type. + * The default configuration or data needed to onboard the machine to MDE. * - * @param iotAlertTypeName Name of the alert 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 ioT alert type. + * @return the resource of the configuration or data needed to onboard the machine to MDE. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IotAlertTypeInner get(String iotAlertTypeName) { - return getAsync(iotAlertTypeName).block(); + public MdeOnboardingDataInner get() { + return getAsync().block(); } /** - * Get IoT alert type. + * The default configuration or data needed to onboard the machine to MDE. * - * @param iotAlertTypeName Name of the alert 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 ioT alert type. + * @return the resource of the configuration or data needed to onboard the machine to MDE. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String iotAlertTypeName, Context context) { - return getWithResponseAsync(iotAlertTypeName, context).block(); + public Response getWithResponse(Context context) { + return getWithResponseAsync(context).block(); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsImpl.java new file mode 100644 index 0000000000000..3e69407d1d3ff --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsImpl.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.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.MdeOnboardingsClient; +import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner; +import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataListInner; +import com.azure.resourcemanager.security.models.MdeOnboardingData; +import com.azure.resourcemanager.security.models.MdeOnboardingDataList; +import com.azure.resourcemanager.security.models.MdeOnboardings; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class MdeOnboardingsImpl implements MdeOnboardings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MdeOnboardingsImpl.class); + + private final MdeOnboardingsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public MdeOnboardingsImpl( + MdeOnboardingsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public MdeOnboardingDataList list() { + MdeOnboardingDataListInner inner = this.serviceClient().list(); + if (inner != null) { + return new MdeOnboardingDataListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse(Context context) { + Response inner = this.serviceClient().listWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MdeOnboardingDataListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MdeOnboardingData get() { + MdeOnboardingDataInner inner = this.serviceClient().get(); + if (inner != null) { + return new MdeOnboardingDataImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(Context context) { + Response inner = this.serviceClient().getWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MdeOnboardingDataImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private MdeOnboardingsClient 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/OnPremiseIotSensorsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorsClientImpl.java deleted file mode 100644 index baab7b119bdbe..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorsClientImpl.java +++ /dev/null @@ -1,971 +0,0 @@ -// Copyright (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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.OnPremiseIotSensorsClient; -import com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorInner; -import com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorsListInner; -import com.azure.resourcemanager.security.models.ResetPasswordInput; -import com.fasterxml.jackson.databind.util.ByteBufferBackedInputStream; -import java.io.InputStream; -import java.io.SequenceInputStream; -import java.nio.ByteBuffer; -import java.util.Enumeration; -import java.util.Iterator; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OnPremiseIotSensorsClient. */ -public final class OnPremiseIotSensorsClientImpl implements OnPremiseIotSensorsClient { - private final ClientLogger logger = new ClientLogger(OnPremiseIotSensorsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final OnPremiseIotSensorsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of OnPremiseIotSensorsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OnPremiseIotSensorsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(OnPremiseIotSensorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterOnPremiseIotSensors to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterOnPrem") - private interface OnPremiseIotSensorsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors") - @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/onPremiseIotSensors/{onPremiseIotSensorName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("onPremiseIotSensorName") String onPremiseIotSensorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("onPremiseIotSensorName") String onPremiseIotSensorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("onPremiseIotSensorName") String onPremiseIotSensorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}" - + "/downloadActivation") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono downloadActivation( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("onPremiseIotSensorName") String onPremiseIotSensorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}" - + "/downloadResetPassword") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono downloadResetPassword( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("onPremiseIotSensorName") String onPremiseIotSensorName, - @BodyParam("application/json") ResetPasswordInput body, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List on-premise IoT sensors. - * - * @throws 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 on-premise IoT sensors. - */ - @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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List on-premise IoT sensors. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 on-premise IoT sensors. - */ - @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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * List on-premise IoT sensors. - * - * @throws 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 on-premise IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { - return listWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List on-premise IoT sensors. - * - * @throws 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 on-premise IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OnPremiseIotSensorsListInner list() { - return listAsync().block(); - } - - /** - * List on-premise IoT sensors. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 on-premise IoT sensors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); - } - - /** - * Get on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String onPremiseIotSensorName) { - 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 (onPremiseIotSensorName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - onPremiseIotSensorName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String onPremiseIotSensorName, 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 (onPremiseIotSensorName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - onPremiseIotSensorName, - accept, - context); - } - - /** - * Get on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String onPremiseIotSensorName) { - return getWithResponseAsync(onPremiseIotSensorName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OnPremiseIotSensorInner get(String onPremiseIotSensorName) { - return getAsync(onPremiseIotSensorName).block(); - } - - /** - * Get on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String onPremiseIotSensorName, Context context) { - return getWithResponseAsync(onPremiseIotSensorName, context).block(); - } - - /** - * Create or update on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String onPremiseIotSensorName) { - 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 (onPremiseIotSensorName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - onPremiseIotSensorName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String onPremiseIotSensorName, 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 (onPremiseIotSensorName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - onPremiseIotSensorName, - accept, - context); - } - - /** - * Create or update on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String onPremiseIotSensorName) { - return createOrUpdateWithResponseAsync(onPremiseIotSensorName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OnPremiseIotSensorInner createOrUpdate(String onPremiseIotSensorName) { - return createOrUpdateAsync(onPremiseIotSensorName).block(); - } - - /** - * Create or update on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return on-premise IoT sensor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String onPremiseIotSensorName, Context context) { - return createOrUpdateWithResponseAsync(onPremiseIotSensorName, context).block(); - } - - /** - * Delete on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String onPremiseIotSensorName) { - 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 (onPremiseIotSensorName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - onPremiseIotSensorName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String onPremiseIotSensorName, 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 (onPremiseIotSensorName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - onPremiseIotSensorName, - accept, - context); - } - - /** - * Delete on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String onPremiseIotSensorName) { - return deleteWithResponseAsync(onPremiseIotSensorName).flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 onPremiseIotSensorName) { - deleteAsync(onPremiseIotSensorName).block(); - } - - /** - * Delete on-premise IoT sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String onPremiseIotSensorName, Context context) { - return deleteWithResponseAsync(onPremiseIotSensorName, context).block(); - } - - /** - * Download sensor activation file. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadActivationWithResponseAsync(String onPremiseIotSensorName) { - 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 (onPremiseIotSensorName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/zip"; - return FluxUtil - .withContext( - context -> - service - .downloadActivation( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - onPremiseIotSensorName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Download sensor activation file. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadActivationWithResponseAsync(String onPremiseIotSensorName, 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 (onPremiseIotSensorName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/zip"; - context = this.client.mergeContext(context); - return service - .downloadActivation( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - onPremiseIotSensorName, - accept, - context); - } - - /** - * Download sensor activation file. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Flux downloadActivationAsync(String onPremiseIotSensorName) { - return downloadActivationWithResponseAsync(onPremiseIotSensorName).flatMapMany(StreamResponse::getValue); - } - - /** - * Download sensor activation file. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream downloadActivation(String onPremiseIotSensorName) { - Iterator iterator = - downloadActivationAsync(onPremiseIotSensorName).map(ByteBufferBackedInputStream::new).toStream().iterator(); - Enumeration enumeration = - new Enumeration() { - @Override - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - @Override - public InputStream nextElement() { - return iterator.next(); - } - }; - return new SequenceInputStream(enumeration); - } - - /** - * Download sensor activation file. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StreamResponse downloadActivationWithResponse(String onPremiseIotSensorName, Context context) { - return downloadActivationWithResponseAsync(onPremiseIotSensorName, context).block(); - } - - /** - * Download file for reset password of the sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param body Input for reset password. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadResetPasswordWithResponseAsync( - String onPremiseIotSensorName, ResetPasswordInput body) { - 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 (onPremiseIotSensorName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/zip"; - return FluxUtil - .withContext( - context -> - service - .downloadResetPassword( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - onPremiseIotSensorName, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Download file for reset password of the sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param body Input for reset password. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadResetPasswordWithResponseAsync( - String onPremiseIotSensorName, ResetPasswordInput body, 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 (onPremiseIotSensorName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String apiVersion = "2020-08-06-preview"; - final String accept = "application/zip"; - context = this.client.mergeContext(context); - return service - .downloadResetPassword( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - onPremiseIotSensorName, - body, - accept, - context); - } - - /** - * Download file for reset password of the sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param body Input for reset password. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Flux downloadResetPasswordAsync(String onPremiseIotSensorName, ResetPasswordInput body) { - return downloadResetPasswordWithResponseAsync(onPremiseIotSensorName, body) - .flatMapMany(StreamResponse::getValue); - } - - /** - * Download file for reset password of the sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param body Input for reset password. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream downloadResetPassword(String onPremiseIotSensorName, ResetPasswordInput body) { - Iterator iterator = - downloadResetPasswordAsync(onPremiseIotSensorName, body) - .map(ByteBufferBackedInputStream::new) - .toStream() - .iterator(); - Enumeration enumeration = - new Enumeration() { - @Override - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - @Override - public InputStream nextElement() { - return iterator.next(); - } - }; - return new SequenceInputStream(enumeration); - } - - /** - * Download file for reset password of the sensor. - * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param body Input for reset password. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StreamResponse downloadResetPasswordWithResponse( - String onPremiseIotSensorName, ResetPasswordInput body, Context context) { - return downloadResetPasswordWithResponseAsync(onPremiseIotSensorName, body, context).block(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorsImpl.java deleted file mode 100644 index 74df09ca6ff53..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorsImpl.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.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.OnPremiseIotSensorsClient; -import com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorInner; -import com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorsListInner; -import com.azure.resourcemanager.security.models.OnPremiseIotSensor; -import com.azure.resourcemanager.security.models.OnPremiseIotSensors; -import com.azure.resourcemanager.security.models.OnPremiseIotSensorsList; -import com.azure.resourcemanager.security.models.ResetPasswordInput; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.io.InputStream; - -public final class OnPremiseIotSensorsImpl implements OnPremiseIotSensors { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OnPremiseIotSensorsImpl.class); - - private final OnPremiseIotSensorsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public OnPremiseIotSensorsImpl( - OnPremiseIotSensorsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public OnPremiseIotSensorsList list() { - OnPremiseIotSensorsListInner inner = this.serviceClient().list(); - if (inner != null) { - return new OnPremiseIotSensorsListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new OnPremiseIotSensorsListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public OnPremiseIotSensor get(String onPremiseIotSensorName) { - OnPremiseIotSensorInner inner = this.serviceClient().get(onPremiseIotSensorName); - if (inner != null) { - return new OnPremiseIotSensorImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String onPremiseIotSensorName, Context context) { - Response inner = this.serviceClient().getWithResponse(onPremiseIotSensorName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new OnPremiseIotSensorImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public OnPremiseIotSensor createOrUpdate(String onPremiseIotSensorName) { - OnPremiseIotSensorInner inner = this.serviceClient().createOrUpdate(onPremiseIotSensorName); - if (inner != null) { - return new OnPremiseIotSensorImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse(String onPremiseIotSensorName, Context context) { - Response inner = - this.serviceClient().createOrUpdateWithResponse(onPremiseIotSensorName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new OnPremiseIotSensorImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String onPremiseIotSensorName) { - this.serviceClient().delete(onPremiseIotSensorName); - } - - public Response deleteWithResponse(String onPremiseIotSensorName, Context context) { - return this.serviceClient().deleteWithResponse(onPremiseIotSensorName, context); - } - - public InputStream downloadActivation(String onPremiseIotSensorName) { - return this.serviceClient().downloadActivation(onPremiseIotSensorName); - } - - public StreamResponse downloadActivationWithResponse(String onPremiseIotSensorName, Context context) { - return this.serviceClient().downloadActivationWithResponse(onPremiseIotSensorName, context); - } - - public InputStream downloadResetPassword(String onPremiseIotSensorName, ResetPasswordInput body) { - return this.serviceClient().downloadResetPassword(onPremiseIotSensorName, body); - } - - public StreamResponse downloadResetPasswordWithResponse( - String onPremiseIotSensorName, ResetPasswordInput body, Context context) { - return this.serviceClient().downloadResetPasswordWithResponse(onPremiseIotSensorName, body, context); - } - - private OnPremiseIotSensorsClient 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/OnPremiseIotSensorsListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorsListImpl.java deleted file mode 100644 index 2a4b774c145ca..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OnPremiseIotSensorsListImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorInner; -import com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorsListInner; -import com.azure.resourcemanager.security.models.OnPremiseIotSensor; -import com.azure.resourcemanager.security.models.OnPremiseIotSensorsList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class OnPremiseIotSensorsListImpl implements OnPremiseIotSensorsList { - private OnPremiseIotSensorsListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - OnPremiseIotSensorsListImpl( - OnPremiseIotSensorsListInner 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 OnPremiseIotSensorImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public OnPremiseIotSensorsListInner 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/OperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsClientImpl.java index 5609a7a475cac..46f54a6c241c3 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsClientImpl.java @@ -85,7 +85,7 @@ Mono> listNext( * * @throws 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 possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -118,7 +118,7 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -149,7 +149,7 @@ private Mono> listSinglePageAsync(Context context) * * @throws 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 possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -163,7 +163,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -176,7 +176,7 @@ private PagedFlux listAsync(Context context) { * * @throws 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 possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -190,7 +190,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -204,7 +204,7 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -240,7 +240,7 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PackageDownloadsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PackageDownloadsImpl.java deleted file mode 100644 index 41263da35fe82..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PackageDownloadsImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.PackageDownloadsInner; -import com.azure.resourcemanager.security.models.PackageDownloadInfo; -import com.azure.resourcemanager.security.models.PackageDownloads; -import com.azure.resourcemanager.security.models.PackageDownloadsCentralManager; -import com.azure.resourcemanager.security.models.PackageDownloadsSensor; -import java.util.Collections; -import java.util.List; - -public final class PackageDownloadsImpl implements PackageDownloads { - private PackageDownloadsInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - PackageDownloadsImpl( - PackageDownloadsInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public PackageDownloadsSensor sensor() { - return this.innerModel().sensor(); - } - - public PackageDownloadsCentralManager centralManager() { - return this.innerModel().centralManager(); - } - - public List threatIntelligence() { - List inner = this.innerModel().threatIntelligence(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List snmp() { - List inner = this.innerModel().snmp(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List wmiTool() { - List inner = this.innerModel().wmiTool(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List authorizedDevicesImportTemplate() { - List inner = this.innerModel().authorizedDevicesImportTemplate(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List deviceInformationUpdateImportTemplate() { - List inner = this.innerModel().deviceInformationUpdateImportTemplate(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public PackageDownloadsInner 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/SecureScoreControlScoreDetailsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlScoreDetailsImpl.java new file mode 100644 index 0000000000000..d3a1b368b1f60 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlScoreDetailsImpl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; +import com.azure.resourcemanager.security.fluent.models.SecureScoreControlScoreDetailsInner; +import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionItem; +import com.azure.resourcemanager.security.models.SecureScoreControlScoreDetails; + +public final class SecureScoreControlScoreDetailsImpl implements SecureScoreControlScoreDetails { + private SecureScoreControlScoreDetailsInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + SecureScoreControlScoreDetailsImpl( + SecureScoreControlScoreDetailsInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public Integer healthyResourceCount() { + return this.innerModel().healthyResourceCount(); + } + + public Integer unhealthyResourceCount() { + return this.innerModel().unhealthyResourceCount(); + } + + public Integer notApplicableResourceCount() { + return this.innerModel().notApplicableResourceCount(); + } + + public Long weight() { + return this.innerModel().weight(); + } + + public SecureScoreControlDefinitionItem definition() { + SecureScoreControlDefinitionItemInner inner = this.innerModel().definition(); + if (inner != null) { + return new SecureScoreControlDefinitionItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public Integer max() { + return this.innerModel().max(); + } + + public Double current() { + return this.innerModel().current(); + } + + public Double percentage() { + return this.innerModel().percentage(); + } + + public SecureScoreControlScoreDetailsInner 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/SecurityAssessmentMetadataImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentMetadataResponseImpl.java similarity index 58% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentMetadataImpl.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentMetadataResponseImpl.java index bec0aedd291b2..7455b39d5a297 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentMetadataImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentMetadataResponseImpl.java @@ -5,26 +5,29 @@ package com.azure.resourcemanager.security.implementation; import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataInner; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner; import com.azure.resourcemanager.security.models.AssessmentType; import com.azure.resourcemanager.security.models.Categories; import com.azure.resourcemanager.security.models.ImplementationEffort; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadata; import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPartnerData; +import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates; +import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataResponse; import com.azure.resourcemanager.security.models.Severity; +import com.azure.resourcemanager.security.models.Tactics; +import com.azure.resourcemanager.security.models.Techniques; import com.azure.resourcemanager.security.models.Threats; import com.azure.resourcemanager.security.models.UserImpact; import java.util.Collections; import java.util.List; -public final class SecurityAssessmentMetadataImpl - implements SecurityAssessmentMetadata, SecurityAssessmentMetadata.Definition { - private SecurityAssessmentMetadataInner innerObject; +public final class SecurityAssessmentMetadataResponseImpl + implements SecurityAssessmentMetadataResponse, SecurityAssessmentMetadataResponse.Definition { + private SecurityAssessmentMetadataResponseInner innerObject; private final com.azure.resourcemanager.security.SecurityManager serviceManager; - SecurityAssessmentMetadataImpl( - SecurityAssessmentMetadataInner innerObject, + SecurityAssessmentMetadataResponseImpl( + SecurityAssessmentMetadataResponseInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -42,6 +45,32 @@ public String type() { return this.innerModel().type(); } + public SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates() { + return this.innerModel().publishDates(); + } + + public String plannedDeprecationDate() { + return this.innerModel().plannedDeprecationDate(); + } + + public List tactics() { + List inner = this.innerModel().tactics(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List techniques() { + List inner = this.innerModel().techniques(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public String displayName() { return this.innerModel().displayName(); } @@ -100,7 +129,7 @@ public SecurityAssessmentMetadataPartnerData partnerData() { return this.innerModel().partnerData(); } - public SecurityAssessmentMetadataInner innerModel() { + public SecurityAssessmentMetadataResponseInner innerModel() { return this.innerObject; } @@ -110,7 +139,7 @@ private com.azure.resourcemanager.security.SecurityManager manager() { private String assessmentMetadataName; - public SecurityAssessmentMetadata create() { + public SecurityAssessmentMetadataResponse create() { this.innerObject = serviceManager .serviceClient() @@ -120,7 +149,7 @@ public SecurityAssessmentMetadata create() { return this; } - public SecurityAssessmentMetadata create(Context context) { + public SecurityAssessmentMetadataResponse create(Context context) { this.innerObject = serviceManager .serviceClient() @@ -130,13 +159,14 @@ public SecurityAssessmentMetadata create(Context context) { return this; } - SecurityAssessmentMetadataImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new SecurityAssessmentMetadataInner(); + SecurityAssessmentMetadataResponseImpl( + String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = new SecurityAssessmentMetadataResponseInner(); this.serviceManager = serviceManager; this.assessmentMetadataName = name; } - public SecurityAssessmentMetadata refresh() { + public SecurityAssessmentMetadataResponse refresh() { this.innerObject = serviceManager .serviceClient() @@ -146,7 +176,7 @@ public SecurityAssessmentMetadata refresh() { return this; } - public SecurityAssessmentMetadata refresh(Context context) { + public SecurityAssessmentMetadataResponse refresh(Context context) { this.innerObject = serviceManager .serviceClient() @@ -156,57 +186,78 @@ public SecurityAssessmentMetadata refresh(Context context) { return this; } - public SecurityAssessmentMetadataImpl withDisplayName(String displayName) { + public SecurityAssessmentMetadataResponseImpl withPublishDates( + SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates) { + this.innerModel().withPublishDates(publishDates); + return this; + } + + public SecurityAssessmentMetadataResponseImpl withPlannedDeprecationDate(String plannedDeprecationDate) { + this.innerModel().withPlannedDeprecationDate(plannedDeprecationDate); + return this; + } + + public SecurityAssessmentMetadataResponseImpl withTactics(List tactics) { + this.innerModel().withTactics(tactics); + return this; + } + + public SecurityAssessmentMetadataResponseImpl withTechniques(List techniques) { + this.innerModel().withTechniques(techniques); + return this; + } + + public SecurityAssessmentMetadataResponseImpl withDisplayName(String displayName) { this.innerModel().withDisplayName(displayName); return this; } - public SecurityAssessmentMetadataImpl withDescription(String description) { + public SecurityAssessmentMetadataResponseImpl withDescription(String description) { this.innerModel().withDescription(description); return this; } - public SecurityAssessmentMetadataImpl withRemediationDescription(String remediationDescription) { + public SecurityAssessmentMetadataResponseImpl withRemediationDescription(String remediationDescription) { this.innerModel().withRemediationDescription(remediationDescription); return this; } - public SecurityAssessmentMetadataImpl withCategories(List categories) { + public SecurityAssessmentMetadataResponseImpl withCategories(List categories) { this.innerModel().withCategories(categories); return this; } - public SecurityAssessmentMetadataImpl withSeverity(Severity severity) { + public SecurityAssessmentMetadataResponseImpl withSeverity(Severity severity) { this.innerModel().withSeverity(severity); return this; } - public SecurityAssessmentMetadataImpl withUserImpact(UserImpact userImpact) { + public SecurityAssessmentMetadataResponseImpl withUserImpact(UserImpact userImpact) { this.innerModel().withUserImpact(userImpact); return this; } - public SecurityAssessmentMetadataImpl withImplementationEffort(ImplementationEffort implementationEffort) { + public SecurityAssessmentMetadataResponseImpl withImplementationEffort(ImplementationEffort implementationEffort) { this.innerModel().withImplementationEffort(implementationEffort); return this; } - public SecurityAssessmentMetadataImpl withThreats(List threats) { + public SecurityAssessmentMetadataResponseImpl withThreats(List threats) { this.innerModel().withThreats(threats); return this; } - public SecurityAssessmentMetadataImpl withPreview(Boolean preview) { + public SecurityAssessmentMetadataResponseImpl withPreview(Boolean preview) { this.innerModel().withPreview(preview); return this; } - public SecurityAssessmentMetadataImpl withAssessmentType(AssessmentType assessmentType) { + public SecurityAssessmentMetadataResponseImpl withAssessmentType(AssessmentType assessmentType) { this.innerModel().withAssessmentType(assessmentType); return this; } - public SecurityAssessmentMetadataImpl withPartnerData(SecurityAssessmentMetadataPartnerData partnerData) { + public SecurityAssessmentMetadataResponseImpl withPartnerData(SecurityAssessmentMetadataPartnerData partnerData) { this.innerModel().withPartnerData(partnerData); return this; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentResponseImpl.java similarity index 57% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentImpl.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentResponseImpl.java index bccc29197d912..b589cb09daae9 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentResponseImpl.java @@ -5,20 +5,22 @@ package com.azure.resourcemanager.security.implementation; import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentInner; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataProperties; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner; import com.azure.resourcemanager.security.models.AssessmentLinks; import com.azure.resourcemanager.security.models.AssessmentStatus; +import com.azure.resourcemanager.security.models.AssessmentStatusResponse; import com.azure.resourcemanager.security.models.ExpandEnum; import com.azure.resourcemanager.security.models.ResourceDetails; import com.azure.resourcemanager.security.models.SecurityAssessment; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataProperties; import com.azure.resourcemanager.security.models.SecurityAssessmentPartnerData; +import com.azure.resourcemanager.security.models.SecurityAssessmentResponse; import java.util.Collections; import java.util.Map; -public final class SecurityAssessmentImpl - implements SecurityAssessment, SecurityAssessment.Definition, SecurityAssessment.Update { - private SecurityAssessmentInner innerObject; +public final class SecurityAssessmentResponseImpl + implements SecurityAssessmentResponse, SecurityAssessmentResponse.Definition, SecurityAssessmentResponse.Update { + private SecurityAssessmentResponseInner innerObject; private final com.azure.resourcemanager.security.SecurityManager serviceManager; @@ -34,6 +36,10 @@ public String type() { return this.innerModel().type(); } + public AssessmentStatusResponse status() { + return this.innerModel().status(); + } + public ResourceDetails resourceDetails() { return this.innerModel().resourceDetails(); } @@ -42,10 +48,6 @@ public String displayName() { return this.innerModel().displayName(); } - public AssessmentStatus status() { - return this.innerModel().status(); - } - public Map additionalData() { Map inner = this.innerModel().additionalData(); if (inner != null) { @@ -67,7 +69,7 @@ public SecurityAssessmentPartnerData partnersData() { return this.innerModel().partnersData(); } - public SecurityAssessmentInner innerModel() { + public SecurityAssessmentResponseInner innerModel() { return this.innerObject; } @@ -79,63 +81,70 @@ private com.azure.resourcemanager.security.SecurityManager manager() { private String assessmentName; - public SecurityAssessmentImpl withExistingResourceId(String resourceId) { + private SecurityAssessment createAssessment; + + private SecurityAssessment updateAssessment; + + public SecurityAssessmentResponseImpl withExistingResourceId(String resourceId) { this.resourceId = resourceId; return this; } - public SecurityAssessment create() { + public SecurityAssessmentResponse create() { this.innerObject = serviceManager .serviceClient() .getAssessments() - .createOrUpdateWithResponse(resourceId, assessmentName, this.innerModel(), Context.NONE) + .createOrUpdateWithResponse(resourceId, assessmentName, createAssessment, Context.NONE) .getValue(); return this; } - public SecurityAssessment create(Context context) { + public SecurityAssessmentResponse create(Context context) { this.innerObject = serviceManager .serviceClient() .getAssessments() - .createOrUpdateWithResponse(resourceId, assessmentName, this.innerModel(), context) + .createOrUpdateWithResponse(resourceId, assessmentName, createAssessment, context) .getValue(); return this; } - SecurityAssessmentImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new SecurityAssessmentInner(); + SecurityAssessmentResponseImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = new SecurityAssessmentResponseInner(); this.serviceManager = serviceManager; this.assessmentName = name; + this.createAssessment = new SecurityAssessment(); } - public SecurityAssessmentImpl update() { + public SecurityAssessmentResponseImpl update() { + this.updateAssessment = new SecurityAssessment(); return this; } - public SecurityAssessment apply() { + public SecurityAssessmentResponse apply() { this.innerObject = serviceManager .serviceClient() .getAssessments() - .createOrUpdateWithResponse(resourceId, assessmentName, this.innerModel(), Context.NONE) + .createOrUpdateWithResponse(resourceId, assessmentName, updateAssessment, Context.NONE) .getValue(); return this; } - public SecurityAssessment apply(Context context) { + public SecurityAssessmentResponse apply(Context context) { this.innerObject = serviceManager .serviceClient() .getAssessments() - .createOrUpdateWithResponse(resourceId, assessmentName, this.innerModel(), context) + .createOrUpdateWithResponse(resourceId, assessmentName, updateAssessment, context) .getValue(); return this; } - SecurityAssessmentImpl( - SecurityAssessmentInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + SecurityAssessmentResponseImpl( + SecurityAssessmentResponseInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceId = @@ -152,7 +161,7 @@ public SecurityAssessment apply(Context context) { "assessmentName"); } - public SecurityAssessment refresh() { + public SecurityAssessmentResponse refresh() { ExpandEnum localExpand = null; this.innerObject = serviceManager @@ -163,7 +172,7 @@ public SecurityAssessment refresh() { return this; } - public SecurityAssessment refresh(Context context) { + public SecurityAssessmentResponse refresh(Context context) { ExpandEnum localExpand = null; this.innerObject = serviceManager @@ -174,28 +183,57 @@ public SecurityAssessment refresh(Context context) { return this; } - public SecurityAssessmentImpl withResourceDetails(ResourceDetails resourceDetails) { - this.innerModel().withResourceDetails(resourceDetails); - return this; + public SecurityAssessmentResponseImpl withStatus(AssessmentStatus status) { + if (isInCreateMode()) { + this.createAssessment.withStatus(status); + return this; + } else { + this.updateAssessment.withStatus(status); + return this; + } } - public SecurityAssessmentImpl withStatus(AssessmentStatus status) { - this.innerModel().withStatus(status); - return this; + public SecurityAssessmentResponseImpl withResourceDetails(ResourceDetails resourceDetails) { + if (isInCreateMode()) { + this.createAssessment.withResourceDetails(resourceDetails); + return this; + } else { + this.updateAssessment.withResourceDetails(resourceDetails); + return this; + } } - public SecurityAssessmentImpl withAdditionalData(Map additionalData) { - this.innerModel().withAdditionalData(additionalData); - return this; + public SecurityAssessmentResponseImpl withAdditionalData(Map additionalData) { + if (isInCreateMode()) { + this.createAssessment.withAdditionalData(additionalData); + return this; + } else { + this.updateAssessment.withAdditionalData(additionalData); + return this; + } } - public SecurityAssessmentImpl withMetadata(SecurityAssessmentMetadataProperties metadata) { - this.innerModel().withMetadata(metadata); - return this; + public SecurityAssessmentResponseImpl withMetadata(SecurityAssessmentMetadataProperties metadata) { + if (isInCreateMode()) { + this.createAssessment.withMetadata(metadata); + return this; + } else { + this.updateAssessment.withMetadata(metadata); + return this; + } } - public SecurityAssessmentImpl withPartnersData(SecurityAssessmentPartnerData partnersData) { - this.innerModel().withPartnersData(partnersData); - return this; + public SecurityAssessmentResponseImpl withPartnersData(SecurityAssessmentPartnerData partnersData) { + if (isInCreateMode()) { + this.createAssessment.withPartnersData(partnersData); + return this; + } else { + this.updateAssessment.withPartnersData(partnersData); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; } } 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 7501c30676cfc..c89bdf994d74a 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 @@ -34,28 +34,20 @@ 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.DeviceSecurityGroupsClient; -import com.azure.resourcemanager.security.fluent.DevicesClient; -import com.azure.resourcemanager.security.fluent.DevicesForHubsClient; -import com.azure.resourcemanager.security.fluent.DevicesForSubscriptionsClient; import com.azure.resourcemanager.security.fluent.DiscoveredSecuritySolutionsClient; import com.azure.resourcemanager.security.fluent.ExternalSecuritySolutionsClient; import com.azure.resourcemanager.security.fluent.InformationProtectionPoliciesClient; import com.azure.resourcemanager.security.fluent.IngestionSettingsClient; -import com.azure.resourcemanager.security.fluent.IotAlertTypesClient; -import com.azure.resourcemanager.security.fluent.IotAlertsClient; -import com.azure.resourcemanager.security.fluent.IotDefenderSettingsClient; -import com.azure.resourcemanager.security.fluent.IotRecommendationTypesClient; -import com.azure.resourcemanager.security.fluent.IotRecommendationsClient; import com.azure.resourcemanager.security.fluent.IotSecuritySolutionAnalyticsClient; import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsAnalyticsAggregatedAlertsClient; import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsAnalyticsRecommendationsClient; import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.IotSensorsClient; -import com.azure.resourcemanager.security.fluent.IotSitesClient; import com.azure.resourcemanager.security.fluent.JitNetworkAccessPoliciesClient; import com.azure.resourcemanager.security.fluent.LocationsClient; -import com.azure.resourcemanager.security.fluent.OnPremiseIotSensorsClient; +import com.azure.resourcemanager.security.fluent.MdeOnboardingsClient; import com.azure.resourcemanager.security.fluent.OperationsClient; import com.azure.resourcemanager.security.fluent.PricingsClient; import com.azure.resourcemanager.security.fluent.RegulatoryComplianceAssessmentsClient; @@ -65,6 +57,7 @@ import com.azure.resourcemanager.security.fluent.SecureScoreControlsClient; import com.azure.resourcemanager.security.fluent.SecureScoresClient; import com.azure.resourcemanager.security.fluent.SecurityCenter; +import com.azure.resourcemanager.security.fluent.SecurityConnectorsClient; import com.azure.resourcemanager.security.fluent.SecurityContactsClient; import com.azure.resourcemanager.security.fluent.SecuritySolutionsClient; import com.azure.resourcemanager.security.fluent.SecuritySolutionsReferenceDatasClient; @@ -153,6 +146,42 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } + /** The MdeOnboardingsClient object to access its operations. */ + private final MdeOnboardingsClient mdeOnboardings; + + /** + * Gets the MdeOnboardingsClient object to access its operations. + * + * @return the MdeOnboardingsClient object. + */ + public MdeOnboardingsClient getMdeOnboardings() { + return this.mdeOnboardings; + } + + /** The CustomAssessmentAutomationsClient object to access its operations. */ + private final CustomAssessmentAutomationsClient customAssessmentAutomations; + + /** + * Gets the CustomAssessmentAutomationsClient object to access its operations. + * + * @return the CustomAssessmentAutomationsClient object. + */ + public CustomAssessmentAutomationsClient getCustomAssessmentAutomations() { + return this.customAssessmentAutomations; + } + + /** The CustomEntityStoreAssignmentsClient object to access its operations. */ + private final CustomEntityStoreAssignmentsClient customEntityStoreAssignments; + + /** + * Gets the CustomEntityStoreAssignmentsClient object to access its operations. + * + * @return the CustomEntityStoreAssignmentsClient object. + */ + public CustomEntityStoreAssignmentsClient getCustomEntityStoreAssignments() { + return this.customEntityStoreAssignments; + } + /** The ComplianceResultsClient object to access its operations. */ private final ComplianceResultsClient complianceResults; @@ -645,138 +674,6 @@ public SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessme return this.sqlVulnerabilityAssessmentBaselineRules; } - /** The IotDefenderSettingsClient object to access its operations. */ - private final IotDefenderSettingsClient iotDefenderSettings; - - /** - * Gets the IotDefenderSettingsClient object to access its operations. - * - * @return the IotDefenderSettingsClient object. - */ - public IotDefenderSettingsClient getIotDefenderSettings() { - return this.iotDefenderSettings; - } - - /** The IotSensorsClient object to access its operations. */ - private final IotSensorsClient iotSensors; - - /** - * Gets the IotSensorsClient object to access its operations. - * - * @return the IotSensorsClient object. - */ - public IotSensorsClient getIotSensors() { - return this.iotSensors; - } - - /** The DevicesForSubscriptionsClient object to access its operations. */ - private final DevicesForSubscriptionsClient devicesForSubscriptions; - - /** - * Gets the DevicesForSubscriptionsClient object to access its operations. - * - * @return the DevicesForSubscriptionsClient object. - */ - public DevicesForSubscriptionsClient getDevicesForSubscriptions() { - return this.devicesForSubscriptions; - } - - /** The DevicesForHubsClient object to access its operations. */ - private final DevicesForHubsClient devicesForHubs; - - /** - * Gets the DevicesForHubsClient object to access its operations. - * - * @return the DevicesForHubsClient object. - */ - public DevicesForHubsClient getDevicesForHubs() { - return this.devicesForHubs; - } - - /** The DevicesClient object to access its operations. */ - private final DevicesClient devices; - - /** - * Gets the DevicesClient object to access its operations. - * - * @return the DevicesClient object. - */ - public DevicesClient getDevices() { - return this.devices; - } - - /** The OnPremiseIotSensorsClient object to access its operations. */ - private final OnPremiseIotSensorsClient onPremiseIotSensors; - - /** - * Gets the OnPremiseIotSensorsClient object to access its operations. - * - * @return the OnPremiseIotSensorsClient object. - */ - public OnPremiseIotSensorsClient getOnPremiseIotSensors() { - return this.onPremiseIotSensors; - } - - /** The IotSitesClient object to access its operations. */ - private final IotSitesClient iotSites; - - /** - * Gets the IotSitesClient object to access its operations. - * - * @return the IotSitesClient object. - */ - public IotSitesClient getIotSites() { - return this.iotSites; - } - - /** The IotAlertsClient object to access its operations. */ - private final IotAlertsClient iotAlerts; - - /** - * Gets the IotAlertsClient object to access its operations. - * - * @return the IotAlertsClient object. - */ - public IotAlertsClient getIotAlerts() { - return this.iotAlerts; - } - - /** The IotAlertTypesClient object to access its operations. */ - private final IotAlertTypesClient iotAlertTypes; - - /** - * Gets the IotAlertTypesClient object to access its operations. - * - * @return the IotAlertTypesClient object. - */ - public IotAlertTypesClient getIotAlertTypes() { - return this.iotAlertTypes; - } - - /** The IotRecommendationsClient object to access its operations. */ - private final IotRecommendationsClient iotRecommendations; - - /** - * Gets the IotRecommendationsClient object to access its operations. - * - * @return the IotRecommendationsClient object. - */ - public IotRecommendationsClient getIotRecommendations() { - return this.iotRecommendations; - } - - /** The IotRecommendationTypesClient object to access its operations. */ - private final IotRecommendationTypesClient iotRecommendationTypes; - - /** - * Gets the IotRecommendationTypesClient object to access its operations. - * - * @return the IotRecommendationTypesClient object. - */ - public IotRecommendationTypesClient getIotRecommendationTypes() { - return this.iotRecommendationTypes; - } - /** The AlertsClient object to access its operations. */ private final AlertsClient alerts; @@ -825,6 +722,18 @@ public SoftwareInventoriesClient getSoftwareInventories() { return this.softwareInventories; } + /** 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; + } + /** * Initializes an instance of SecurityCenter client. * @@ -847,6 +756,9 @@ public SoftwareInventoriesClient getSoftwareInventories() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.mdeOnboardings = new MdeOnboardingsClientImpl(this); + this.customAssessmentAutomations = new CustomAssessmentAutomationsClientImpl(this); + this.customEntityStoreAssignments = new CustomEntityStoreAssignmentsClientImpl(this); this.complianceResults = new ComplianceResultsClientImpl(this); this.pricings = new PricingsClientImpl(this); this.advancedThreatProtections = new AdvancedThreatProtectionsClientImpl(this); @@ -890,21 +802,11 @@ public SoftwareInventoriesClient getSoftwareInventories() { this.sqlVulnerabilityAssessmentScans = new SqlVulnerabilityAssessmentScansClientImpl(this); this.sqlVulnerabilityAssessmentScanResults = new SqlVulnerabilityAssessmentScanResultsClientImpl(this); this.sqlVulnerabilityAssessmentBaselineRules = new SqlVulnerabilityAssessmentBaselineRulesClientImpl(this); - this.iotDefenderSettings = new IotDefenderSettingsClientImpl(this); - this.iotSensors = new IotSensorsClientImpl(this); - this.devicesForSubscriptions = new DevicesForSubscriptionsClientImpl(this); - this.devicesForHubs = new DevicesForHubsClientImpl(this); - this.devices = new DevicesClientImpl(this); - this.onPremiseIotSensors = new OnPremiseIotSensorsClientImpl(this); - this.iotSites = new IotSitesClientImpl(this); - this.iotAlerts = new IotAlertsClientImpl(this); - this.iotAlertTypes = new IotAlertTypesClientImpl(this); - this.iotRecommendations = new IotRecommendationsClientImpl(this); - this.iotRecommendationTypes = new IotRecommendationTypesClientImpl(this); this.alerts = new AlertsClientImpl(this); this.settings = new SettingsClientImpl(this); this.ingestionSettings = new IngestionSettingsClientImpl(this); this.softwareInventories = new SoftwareInventoriesClientImpl(this); + this.securityConnectors = new SecurityConnectorsClientImpl(this); } /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorImpl.java new file mode 100644 index 0000000000000..80fcb093898a4 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorImpl.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +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.SecurityConnector; +import com.azure.resourcemanager.security.models.SecurityConnectorPropertiesOrganizationalData; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class SecurityConnectorImpl + implements SecurityConnector, SecurityConnector.Definition, SecurityConnector.Update { + private SecurityConnectorInner 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 String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String hierarchyIdentifier() { + return this.innerModel().hierarchyIdentifier(); + } + + public CloudName cloudName() { + return this.innerModel().cloudName(); + } + + public List offerings() { + List inner = this.innerModel().offerings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SecurityConnectorPropertiesOrganizationalData organizationalData() { + return this.innerModel().organizationalData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SecurityConnectorInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String securityConnectorName; + + public SecurityConnectorImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SecurityConnector create() { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityConnectors() + .createOrUpdateWithResponse(resourceGroupName, securityConnectorName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SecurityConnector create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityConnectors() + .createOrUpdateWithResponse(resourceGroupName, securityConnectorName, this.innerModel(), context) + .getValue(); + return this; + } + + SecurityConnectorImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = new SecurityConnectorInner(); + this.serviceManager = serviceManager; + this.securityConnectorName = name; + } + + public SecurityConnectorImpl update() { + return this; + } + + public SecurityConnector apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityConnectors() + .updateWithResponse(resourceGroupName, securityConnectorName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SecurityConnector apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityConnectors() + .updateWithResponse(resourceGroupName, securityConnectorName, this.innerModel(), context) + .getValue(); + return this; + } + + SecurityConnectorImpl( + SecurityConnectorInner 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"); + } + + public SecurityConnector refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityConnectors() + .getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, Context.NONE) + .getValue(); + return this; + } + + public SecurityConnector refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityConnectors() + .getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, context) + .getValue(); + return this; + } + + public SecurityConnectorImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SecurityConnectorImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SecurityConnectorImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public SecurityConnectorImpl withHierarchyIdentifier(String hierarchyIdentifier) { + this.innerModel().withHierarchyIdentifier(hierarchyIdentifier); + return this; + } + + public SecurityConnectorImpl withCloudName(CloudName cloudName) { + this.innerModel().withCloudName(cloudName); + return this; + } + + public SecurityConnectorImpl withOfferings(List offerings) { + this.innerModel().withOfferings(offerings); + return this; + } + + public SecurityConnectorImpl withOrganizationalData( + SecurityConnectorPropertiesOrganizationalData organizationalData) { + this.innerModel().withOrganizationalData(organizationalData); + return 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 new file mode 100644 index 0000000000000..e44346a8871b1 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsClientImpl.java @@ -0,0 +1,1315 @@ +// Copyright (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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.fluent.SecurityConnectorsClient; +import com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner; +import com.azure.resourcemanager.security.models.SecurityConnectorsList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SecurityConnectorsClient. */ +public final class SecurityConnectorsClientImpl implements SecurityConnectorsClient { + private final ClientLogger logger = new ClientLogger(SecurityConnectorsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SecurityConnectorsService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of SecurityConnectorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecurityConnectorsClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy.create(SecurityConnectorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterSecurityConnectors to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterSecuri") + private interface SecurityConnectorsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors") + @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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security" + + "/securityConnectors") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security" + + "/securityConnectors/{securityConnectorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security" + + "/securityConnectors/{securityConnectorName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @BodyParam("application/json") SecurityConnectorInner securityConnector, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security" + + "/securityConnectors/{securityConnectorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @BodyParam("application/json") SecurityConnectorInner securityConnector, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security" + + "/securityConnectors/{securityConnectorName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to + * get the next page of security connectors for the specified 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 security connectors response. + */ + @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-07-01-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())); + } + + /** + * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to + * get the next page of security connectors for the specified 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 security connectors response. + */ + @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-07-01-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)); + } + + /** + * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to + * get the next page of security connectors for the specified 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 security connectors response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to + * get the next page of security connectors for the specified 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 security connectors response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to + * get the next page of security connectors for the specified 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 security connectors response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to + * get the next page of security connectors for the specified 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 security connectors response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to + * get the next page of security connectors for the specified resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of security connectors response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to + * get the next page of security connectors for the specified resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of security connectors response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to + * get the next page of security connectors for the specified resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of security connectors response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to + * get the next page of security connectors for the specified resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of security connectors response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to + * get the next page of security connectors for the specified resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of security connectors response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to + * get the next page of security connectors for the specified resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of security connectors response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieves details of a specific security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + 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 = "2021-07-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves details of a specific security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + 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 = "2021-07-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + accept, + context); + } + + /** + * Retrieves details of a specific security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String securityConnectorName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, securityConnectorName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves details of a specific security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityConnectorInner getByResourceGroup(String resourceGroupName, String securityConnectorName) { + return getByResourceGroupAsync(resourceGroupName, securityConnectorName).block(); + } + + /** + * Retrieves details of a specific security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String securityConnectorName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, securityConnectorName, context).block(); + } + + /** + * Creates or updates a security connector. If a security connector is already created and a subsequent request is + * issued for the same security connector id, then it will be updated. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param securityConnectorName The security connector name. + * @param securityConnector The security connector resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector) { + 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 (securityConnector == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnector is required and cannot be null.")); + } else { + securityConnector.validate(); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + securityConnector, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a security connector. If a security connector is already created and a subsequent request is + * issued for the same security connector id, then it will be updated. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param securityConnectorName The security connector name. + * @param securityConnector The security connector 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 the security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String securityConnectorName, + SecurityConnectorInner securityConnector, + 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 (securityConnector == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnector is required and cannot be null.")); + } else { + securityConnector.validate(); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + securityConnector, + accept, + context); + } + + /** + * Creates or updates a security connector. If a security connector is already created and a subsequent request is + * issued for the same security connector id, then it will be updated. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param securityConnectorName The security connector name. + * @param securityConnector The security connector resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector) { + return createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, securityConnector) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a security connector. If a security connector is already created and a subsequent request is + * issued for the same security connector id, then it will be updated. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param securityConnectorName The security connector name. + * @param securityConnector The security connector resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityConnectorInner createOrUpdate( + String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector) { + return createOrUpdateAsync(resourceGroupName, securityConnectorName, securityConnector).block(); + } + + /** + * Creates or updates a security connector. If a security connector is already created and a subsequent request is + * issued for the same security connector id, then it will be updated. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param securityConnectorName The security connector name. + * @param securityConnector The security connector 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 the security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String securityConnectorName, + SecurityConnectorInner securityConnector, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, securityConnector, context) + .block(); + } + + /** + * Updates a security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param securityConnectorName The security connector name. + * @param securityConnector The security connector resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector) { + 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 (securityConnector == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnector is required and cannot be null.")); + } else { + securityConnector.validate(); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + securityConnector, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param securityConnectorName The security connector name. + * @param securityConnector The security connector 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 the security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String securityConnectorName, + SecurityConnectorInner securityConnector, + 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 (securityConnector == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityConnector is required and cannot be null.")); + } else { + securityConnector.validate(); + } + final String apiVersion = "2021-07-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + securityConnector, + accept, + context); + } + + /** + * Updates a security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param securityConnectorName The security connector name. + * @param securityConnector The security connector resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector) { + return updateWithResponseAsync(resourceGroupName, securityConnectorName, securityConnector) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param securityConnectorName The security connector name. + * @param securityConnector The security connector resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityConnectorInner update( + String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector) { + return updateAsync(resourceGroupName, securityConnectorName, securityConnector).block(); + } + + /** + * Updates a security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param securityConnectorName The security connector name. + * @param securityConnector The security connector 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 the security connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String securityConnectorName, + SecurityConnectorInner securityConnector, + Context context) { + return updateWithResponseAsync(resourceGroupName, securityConnectorName, securityConnector, context).block(); + } + + /** + * Deletes a security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 completion. + */ + @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 = "2021-07-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 completion. + */ + @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 = "2021-07-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + securityConnectorName, + accept, + context); + } + + /** + * Deletes a security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String securityConnectorName) { + return deleteWithResponseAsync(resourceGroupName, securityConnectorName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 security connector. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String securityConnectorName, Context context) { + return deleteWithResponseAsync(resourceGroupName, securityConnectorName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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 security connectors response. + */ + @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 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 security connectors response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 security connectors response. + */ + @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 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 security connectors response. + */ + @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)); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsImpl.java new file mode 100644 index 0000000000000..5955e85380dc6 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.SecurityConnectorsClient; +import com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner; +import com.azure.resourcemanager.security.models.SecurityConnector; +import com.azure.resourcemanager.security.models.SecurityConnectors; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SecurityConnectorsImpl implements SecurityConnectors { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityConnectorsImpl.class); + + private final SecurityConnectorsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public SecurityConnectorsImpl( + SecurityConnectorsClient 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 SecurityConnectorImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); + } + + public SecurityConnector getByResourceGroup(String resourceGroupName, String securityConnectorName) { + SecurityConnectorInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, securityConnectorName); + if (inner != null) { + return new SecurityConnectorImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String securityConnectorName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SecurityConnectorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String securityConnectorName) { + this.serviceClient().delete(resourceGroupName, securityConnectorName); + } + + public Response deleteWithResponse(String resourceGroupName, String securityConnectorName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, securityConnectorName, context); + } + + public SecurityConnector 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))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, 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))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, context); + } + + public void deleteById(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))); + } + this.deleteWithResponse(resourceGroupName, securityConnectorName, Context.NONE); + } + + public Response deleteByIdWithResponse(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))); + } + return this.deleteWithResponse(resourceGroupName, securityConnectorName, context); + } + + private SecurityConnectorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } + + public SecurityConnectorImpl define(String name) { + return new SecurityConnectorImpl(name, this.manager()); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsImpl.java index 38d44220628bf..5b9139c8ff6f5 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsImpl.java @@ -104,7 +104,7 @@ public void deleteById(String id) { .format( "The resource ID '%s' is not valid. Missing path segment 'securityContacts'.", id))); } - this.deleteWithResponse(securityContactName, Context.NONE).getValue(); + this.deleteWithResponse(securityContactName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionImpl.java index 2104e64221a2c..daa171b42ba68 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionImpl.java @@ -32,6 +32,10 @@ public String type() { return this.innerModel().type(); } + public String location() { + return this.innerModel().location(); + } + public SecurityFamily securityFamily() { return this.innerModel().securityFamily(); } @@ -48,10 +52,6 @@ public String protectionStatus() { return this.innerModel().protectionStatus(); } - public String location() { - return this.innerModel().location(); - } - public SecuritySolutionInner innerModel() { return this.innerObject; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsClientImpl.java index 6cd6ba6e41236..92f2d2b8ac819 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsClientImpl.java @@ -853,14 +853,15 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -877,7 +878,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { context = this.client.mergeContext(context); @@ -901,7 +902,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { return beginDeleteAsync(resourceGroupName, resourceNamespace, resourceType, resourceName).getSyncPoller(); @@ -921,7 +922,7 @@ public SyncPoller, Void> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { return beginDeleteAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, context) diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsClientImpl.java index 03354fdad88f6..af6c5969124c6 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsClientImpl.java @@ -129,7 +129,7 @@ private Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-06-01"; + final String apiVersion = "2021-07-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -171,7 +171,7 @@ private Mono> listSinglePageAsync(Context context) { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-06-01"; + final String apiVersion = "2021-07-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -266,7 +266,7 @@ private Mono> getWithResponseAsync(SettingsSettingName se if (settingName == null) { return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); } - final String apiVersion = "2021-06-01"; + final String apiVersion = "2021-07-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -309,7 +309,7 @@ private Mono> getWithResponseAsync(SettingsSettingName se if (settingName == null) { return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); } - final String apiVersion = "2021-06-01"; + final String apiVersion = "2021-07-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -400,7 +400,7 @@ private Mono> updateWithResponseAsync( } else { setting.validate(); } - final String apiVersion = "2021-06-01"; + final String apiVersion = "2021-07-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -451,7 +451,7 @@ private Mono> updateWithResponseAsync( } else { setting.validate(); } - final String apiVersion = "2021-06-01"; + final String apiVersion = "2021-07-01"; 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/TopologyResourceImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologyResourceImpl.java index e3a7eac735127..9a4e235014809 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologyResourceImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologyResourceImpl.java @@ -34,6 +34,10 @@ public String type() { return this.innerModel().type(); } + public String location() { + return this.innerModel().location(); + } + public OffsetDateTime calculatedDateTime() { return this.innerModel().calculatedDateTime(); } @@ -47,10 +51,6 @@ public List topologyResources() { } } - public String location() { - return this.innerModel().location(); - } - public TopologyResourceInner innerModel() { return this.innerObject; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsImpl.java index 1d2acad307d86..dffb99decf264 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsImpl.java @@ -104,7 +104,7 @@ public void deleteById(String id) { .format( "The resource ID '%s' is not valid. Missing path segment 'workspaceSettings'.", id))); } - this.deleteWithResponse(workspaceSettingName, Context.NONE).getValue(); + this.deleteWithResponse(workspaceSettingName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityState.java index f1fede6bde7df..85145a61c2b98 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityState.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityState.java @@ -4,47 +4,34 @@ package com.azure.resourcemanager.security.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; -/** Describes an Azure resource with kind. */ -@Fluent -public class AadConnectivityState { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AadConnectivityState.class); +/** Defines values for AadConnectivityState. */ +public final class AadConnectivityState extends ExpandableStringEnum { + /** Static value Discovered for AadConnectivityState. */ + public static final AadConnectivityState DISCOVERED = fromString("Discovered"); - /* - * The connectivity state of the external AAD solution - */ - @JsonProperty(value = "connectivityState") - private AadConnectivityStateValue connectivityState; + /** Static value NotLicensed for AadConnectivityState. */ + public static final AadConnectivityState NOT_LICENSED = fromString("NotLicensed"); - /** - * Get the connectivityState property: The connectivity state of the external AAD solution. - * - * @return the connectivityState value. - */ - public AadConnectivityStateValue connectivityState() { - return this.connectivityState; - } + /** Static value Connected for AadConnectivityState. */ + public static final AadConnectivityState CONNECTED = fromString("Connected"); /** - * Set the connectivityState property: The connectivity state of the external AAD solution. + * Creates or finds a AadConnectivityState from its string representation. * - * @param connectivityState the connectivityState value to set. - * @return the AadConnectivityState object itself. + * @param name a name to look for. + * @return the corresponding AadConnectivityState. */ - public AadConnectivityState withConnectivityState(AadConnectivityStateValue connectivityState) { - this.connectivityState = connectivityState; - return this; + @JsonCreator + public static AadConnectivityState fromString(String name) { + return fromString(name, AadConnectivityState.class); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { + /** @return known AadConnectivityState values. */ + public static Collection values() { + return values(AadConnectivityState.class); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityStateAutoGenerated.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityStateAutoGenerated.java new file mode 100644 index 0000000000000..646392ea186c4 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityStateAutoGenerated.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes an Azure resource with kind. */ +@Fluent +public class AadConnectivityStateAutoGenerated { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AadConnectivityStateAutoGenerated.class); + + /* + * The connectivity state of the external AAD solution + */ + @JsonProperty(value = "connectivityState") + private AadConnectivityState connectivityState; + + /** + * Get the connectivityState property: The connectivity state of the external AAD solution. + * + * @return the connectivityState value. + */ + public AadConnectivityState connectivityState() { + return this.connectivityState; + } + + /** + * Set the connectivityState property: The connectivity state of the external AAD solution. + * + * @param connectivityState the connectivityState value to set. + * @return the AadConnectivityStateAutoGenerated object itself. + */ + public AadConnectivityStateAutoGenerated withConnectivityState(AadConnectivityState connectivityState) { + this.connectivityState = connectivityState; + 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/AadConnectivityStateValue.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityStateValue.java deleted file mode 100644 index 5f2deb6227fff..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityStateValue.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AadConnectivityStateValue. */ -public final class AadConnectivityStateValue extends ExpandableStringEnum { - /** Static value Discovered for AadConnectivityStateValue. */ - public static final AadConnectivityStateValue DISCOVERED = fromString("Discovered"); - - /** Static value NotLicensed for AadConnectivityStateValue. */ - public static final AadConnectivityStateValue NOT_LICENSED = fromString("NotLicensed"); - - /** Static value Connected for AadConnectivityStateValue. */ - public static final AadConnectivityStateValue CONNECTED = fromString("Connected"); - - /** - * Creates or finds a AadConnectivityStateValue from its string representation. - * - * @param name a name to look for. - * @return the corresponding AadConnectivityStateValue. - */ - @JsonCreator - public static AadConnectivityStateValue fromString(String name) { - return fromString(name, AadConnectivityStateValue.class); - } - - /** @return known AadConnectivityStateValue values. */ - public static Collection values() { - return values(AadConnectivityStateValue.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadSolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadSolutionProperties.java index e3611d63a3f18..8c4a8171e053b 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadSolutionProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadSolutionProperties.java @@ -18,14 +18,14 @@ public final class AadSolutionProperties extends ExternalSecuritySolutionPropert * The connectivity state of the external AAD solution */ @JsonProperty(value = "connectivityState") - private AadConnectivityStateValue connectivityState; + private AadConnectivityState connectivityState; /** * Get the connectivityState property: The connectivity state of the external AAD solution. * * @return the connectivityState value. */ - public AadConnectivityStateValue connectivityState() { + public AadConnectivityState connectivityState() { return this.connectivityState; } @@ -35,7 +35,7 @@ public AadConnectivityStateValue connectivityState() { * @param connectivityState the connectivityState value to set. * @return the AadSolutionProperties object itself. */ - public AadSolutionProperties withConnectivityState(AadConnectivityStateValue connectivityState) { + public AadSolutionProperties withConnectivityState(AadConnectivityState connectivityState) { this.connectivityState = connectivityState; return this; } 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 57fb4ee27ac46..cb789472d0892 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 @@ -32,6 +32,13 @@ public interface AdaptiveApplicationControlGroup { */ String type(); + /** + * Gets the location property: Location where the resource is stored. + * + * @return the location value. + */ + String location(); + /** * Gets the enforcementMode property: The application control policy enforcement/protection mode of the machine * group. @@ -90,13 +97,6 @@ public interface AdaptiveApplicationControlGroup { */ List pathRecommendations(); - /** - * Gets the location property: Location where the resource is stored. - * - * @return the location value. - */ - String location(); - /** * Gets the region of the resource. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertIntent.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertIntent.java deleted file mode 100644 index 9e01ef809a19c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertIntent.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (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 AlertIntent. */ -public final class AlertIntent extends ExpandableStringEnum { - /** Static value Unknown for AlertIntent. */ - public static final AlertIntent UNKNOWN = fromString("Unknown"); - - /** Static value PreAttack for AlertIntent. */ - public static final AlertIntent PRE_ATTACK = fromString("PreAttack"); - - /** Static value InitialAccess for AlertIntent. */ - public static final AlertIntent INITIAL_ACCESS = fromString("InitialAccess"); - - /** Static value Persistence for AlertIntent. */ - public static final AlertIntent PERSISTENCE = fromString("Persistence"); - - /** Static value PrivilegeEscalation for AlertIntent. */ - public static final AlertIntent PRIVILEGE_ESCALATION = fromString("PrivilegeEscalation"); - - /** Static value DefenseEvasion for AlertIntent. */ - public static final AlertIntent DEFENSE_EVASION = fromString("DefenseEvasion"); - - /** Static value CredentialAccess for AlertIntent. */ - public static final AlertIntent CREDENTIAL_ACCESS = fromString("CredentialAccess"); - - /** Static value Discovery for AlertIntent. */ - public static final AlertIntent DISCOVERY = fromString("Discovery"); - - /** Static value LateralMovement for AlertIntent. */ - public static final AlertIntent LATERAL_MOVEMENT = fromString("LateralMovement"); - - /** Static value Execution for AlertIntent. */ - public static final AlertIntent EXECUTION = fromString("Execution"); - - /** Static value Collection for AlertIntent. */ - public static final AlertIntent COLLECTION = fromString("Collection"); - - /** Static value Exfiltration for AlertIntent. */ - public static final AlertIntent EXFILTRATION = fromString("Exfiltration"); - - /** Static value CommandAndControl for AlertIntent. */ - public static final AlertIntent COMMAND_AND_CONTROL = fromString("CommandAndControl"); - - /** Static value Impact for AlertIntent. */ - public static final AlertIntent IMPACT = fromString("Impact"); - - /** Static value Probing for AlertIntent. */ - public static final AlertIntent PROBING = fromString("Probing"); - - /** Static value Exploitation for AlertIntent. */ - public static final AlertIntent EXPLOITATION = fromString("Exploitation"); - - /** - * Creates or finds a AlertIntent from its string representation. - * - * @param name a name to look for. - * @return the corresponding AlertIntent. - */ - @JsonCreator - public static AlertIntent fromString(String name) { - return fromString(name, AlertIntent.class); - } - - /** @return known AlertIntent values. */ - public static Collection values() { - return values(AlertIntent.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSyncSettings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSyncSettings.java index 28e11c1d3f46e..aa675c59e00e5 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSyncSettings.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSyncSettings.java @@ -5,8 +5,8 @@ package com.azure.resourcemanager.security.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.fluent.models.AlertSyncSettingProperties; import com.azure.resourcemanager.security.fluent.models.SettingInner; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -16,16 +16,24 @@ /** Represents an alert sync setting. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("AlertSyncSettings") -@JsonFlatten @Fluent -public class AlertSyncSettings extends SettingInner { +public final class AlertSyncSettings extends SettingInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertSyncSettings.class); /* - * Is the alert sync setting enabled + * Alert sync setting data */ - @JsonProperty(value = "properties.enabled") - private Boolean enabled; + @JsonProperty(value = "properties") + private AlertSyncSettingProperties innerProperties; + + /** + * Get the innerProperties property: Alert sync setting data. + * + * @return the innerProperties value. + */ + private AlertSyncSettingProperties innerProperties() { + return this.innerProperties; + } /** * Get the enabled property: Is the alert sync setting enabled. @@ -33,7 +41,7 @@ public class AlertSyncSettings extends SettingInner { * @return the enabled value. */ public Boolean enabled() { - return this.enabled; + return this.innerProperties() == null ? null : this.innerProperties().enabled(); } /** @@ -43,7 +51,10 @@ public Boolean enabled() { * @return the AlertSyncSettings object itself. */ public AlertSyncSettings withEnabled(Boolean enabled) { - this.enabled = enabled; + if (this.innerProperties() == null) { + this.innerProperties = new AlertSyncSettingProperties(); + } + this.innerProperties().withEnabled(enabled); return this; } @@ -55,5 +66,8 @@ public AlertSyncSettings withEnabled(Boolean enabled) { @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/AllowedConnectionsResource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnectionsResource.java index 90f45e4f1b700..f7544bb61cefe 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnectionsResource.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnectionsResource.java @@ -31,6 +31,13 @@ public interface AllowedConnectionsResource { */ String type(); + /** + * Gets the location property: Location where the resource is stored. + * + * @return the location value. + */ + String location(); + /** * Gets the calculatedDateTime property: The UTC time on which the allowed connections resource was calculated. * @@ -45,13 +52,6 @@ public interface AllowedConnectionsResource { */ List connectableResources(); - /** - * Gets the location property: Location where the resource is stored. - * - * @return the location value. - */ - String location(); - /** * Gets the inner com.azure.resourcemanager.security.fluent.models.AllowedConnectionsResourceInner object. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatus.java index 3c7a749bdce1f..e1401f13da188 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatus.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatus.java @@ -11,7 +11,7 @@ /** The result of the assessment. */ @Fluent -public final class AssessmentStatus { +public class AssessmentStatus { @JsonIgnore private final ClientLogger logger = new ClientLogger(AssessmentStatus.class); /* diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatusResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatusResponse.java new file mode 100644 index 0000000000000..e2630682b53c4 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatusResponse.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The result of the assessment. */ +@Fluent +public final class AssessmentStatusResponse extends AssessmentStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AssessmentStatusResponse.class); + + /* + * The time that the assessment was created and first evaluated. Returned + * as UTC time in ISO 8601 format + */ + @JsonProperty(value = "firstEvaluationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime firstEvaluationDate; + + /* + * The time that the status of the assessment last changed. Returned as UTC + * time in ISO 8601 format + */ + @JsonProperty(value = "statusChangeDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime statusChangeDate; + + /** + * Get the firstEvaluationDate property: The time that the assessment was created and first evaluated. Returned as + * UTC time in ISO 8601 format. + * + * @return the firstEvaluationDate value. + */ + public OffsetDateTime firstEvaluationDate() { + return this.firstEvaluationDate; + } + + /** + * Get the statusChangeDate property: The time that the status of the assessment last changed. Returned as UTC time + * in ISO 8601 format. + * + * @return the statusChangeDate value. + */ + public OffsetDateTime statusChangeDate() { + return this.statusChangeDate; + } + + /** {@inheritDoc} */ + @Override + public AssessmentStatusResponse withCode(AssessmentStatusCode code) { + super.withCode(code); + return this; + } + + /** {@inheritDoc} */ + @Override + public AssessmentStatusResponse withCause(String cause) { + super.withCause(cause); + return this; + } + + /** {@inheritDoc} */ + @Override + public AssessmentStatusResponse withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assessments.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assessments.java index db0c6b7e9d661..dc2a3012def55 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assessments.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assessments.java @@ -20,7 +20,7 @@ public interface Assessments { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return security assessments on all your scanned resources inside a scope. */ - PagedIterable list(String scope); + PagedIterable list(String scope); /** * Get security assessments on all your scanned resources inside a scope. @@ -33,7 +33,7 @@ public interface Assessments { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return security assessments on all your scanned resources inside a scope. */ - PagedIterable list(String scope, Context context); + PagedIterable list(String scope, Context context); /** * Get a security assessment on your scanned resource. @@ -45,7 +45,7 @@ public interface Assessments { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a security assessment on your scanned resource. */ - SecurityAssessment get(String resourceId, String assessmentName); + SecurityAssessmentResponse get(String resourceId, String assessmentName); /** * Get a security assessment on your scanned resource. @@ -59,7 +59,7 @@ public interface Assessments { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a security assessment on your scanned resource. */ - Response getWithResponse( + Response getWithResponse( String resourceId, String assessmentName, ExpandEnum expand, Context context); /** @@ -97,7 +97,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a security assessment on your scanned resource. */ - SecurityAssessment getById(String id); + SecurityAssessmentResponse getById(String id); /** * Get a security assessment on your scanned resource. @@ -110,7 +110,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a security assessment on your scanned resource. */ - Response getByIdWithResponse(String id, ExpandEnum expand, Context context); + Response getByIdWithResponse(String id, ExpandEnum expand, Context context); /** * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be @@ -137,10 +137,10 @@ Response getWithResponse( Response deleteByIdWithResponse(String id, Context context); /** - * Begins definition for a new SecurityAssessment resource. + * Begins definition for a new SecurityAssessmentResponse resource. * * @param name resource name. - * @return the first stage of the new SecurityAssessment definition. + * @return the first stage of the new SecurityAssessmentResponse definition. */ - SecurityAssessment.DefinitionStages.Blank define(String name); + SecurityAssessmentResponse.DefinitionStages.Blank define(String name); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentsMetadatas.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentsMetadatas.java index 2f50814406093..801ee0eba75d2 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentsMetadatas.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentsMetadatas.java @@ -17,7 +17,7 @@ public interface AssessmentsMetadatas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metadata information on all assessment types. */ - PagedIterable list(); + PagedIterable list(); /** * Get metadata information on all assessment types. @@ -28,7 +28,7 @@ public interface AssessmentsMetadatas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metadata information on all assessment types. */ - PagedIterable list(Context context); + PagedIterable list(Context context); /** * Get metadata information on an assessment type. @@ -39,7 +39,7 @@ public interface AssessmentsMetadatas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metadata information on an assessment type. */ - SecurityAssessmentMetadata get(String assessmentMetadataName); + SecurityAssessmentMetadataResponse get(String assessmentMetadataName); /** * Get metadata information on an assessment type. @@ -51,7 +51,7 @@ public interface AssessmentsMetadatas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metadata information on an assessment type. */ - Response getWithResponse(String assessmentMetadataName, Context context); + Response getWithResponse(String assessmentMetadataName, Context context); /** * Get metadata information on all assessment types in a specific subscription. @@ -60,7 +60,7 @@ public interface AssessmentsMetadatas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metadata information on all assessment types in a specific subscription. */ - PagedIterable listBySubscription(); + PagedIterable listBySubscription(); /** * Get metadata information on all assessment types in a specific subscription. @@ -71,7 +71,7 @@ public interface AssessmentsMetadatas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metadata information on all assessment types in a specific subscription. */ - PagedIterable listBySubscription(Context context); + PagedIterable listBySubscription(Context context); /** * Get metadata information on an assessment type in a specific subscription. @@ -82,7 +82,7 @@ public interface AssessmentsMetadatas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metadata information on an assessment type in a specific subscription. */ - SecurityAssessmentMetadata getInSubscription(String assessmentMetadataName); + SecurityAssessmentMetadataResponse getInSubscription(String assessmentMetadataName); /** * Get metadata information on an assessment type in a specific subscription. @@ -94,7 +94,8 @@ public interface AssessmentsMetadatas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metadata information on an assessment type in a specific subscription. */ - Response getInSubscriptionWithResponse(String assessmentMetadataName, Context context); + Response getInSubscriptionWithResponse( + String assessmentMetadataName, Context context); /** * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the @@ -129,7 +130,7 @@ public interface AssessmentsMetadatas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metadata information on an assessment type in a specific subscription. */ - SecurityAssessmentMetadata getInSubscriptionById(String id); + SecurityAssessmentMetadataResponse getInSubscriptionById(String id); /** * Get metadata information on an assessment type in a specific subscription. @@ -141,7 +142,7 @@ public interface AssessmentsMetadatas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metadata information on an assessment type in a specific subscription. */ - Response getInSubscriptionByIdWithResponse(String id, Context context); + Response getInSubscriptionByIdWithResponse(String id, Context context); /** * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the @@ -168,10 +169,10 @@ public interface AssessmentsMetadatas { Response deleteInSubscriptionByIdWithResponse(String id, Context context); /** - * Begins definition for a new SecurityAssessmentMetadata resource. + * Begins definition for a new SecurityAssessmentMetadataResponse resource. * * @param name resource name. - * @return the first stage of the new SecurityAssessmentMetadata definition. + * @return the first stage of the new SecurityAssessmentMetadataResponse definition. */ - SecurityAssessmentMetadata.DefinitionStages.Blank define(String name); + SecurityAssessmentMetadataResponse.DefinitionStages.Blank define(String name); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthorizationState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthorizationState.java deleted file mode 100644 index 9d668debfd2a3..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthorizationState.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AuthorizationState. */ -public final class AuthorizationState extends ExpandableStringEnum { - /** Static value Authorized for AuthorizationState. */ - public static final AuthorizationState AUTHORIZED = fromString("Authorized"); - - /** Static value Unauthorized for AuthorizationState. */ - public static final AuthorizationState UNAUTHORIZED = fromString("Unauthorized"); - - /** - * Creates or finds a AuthorizationState from its string representation. - * - * @param name a name to look for. - * @return the corresponding AuthorizationState. - */ - @JsonCreator - public static AuthorizationState fromString(String name) { - return fromString(name, AuthorizationState.class); - } - - /** @return known AuthorizationState values. */ - public static Collection values() { - return values(AuthorizationState.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudErrorBody.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudErrorBody.java deleted file mode 100644 index 145479b92b30b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudErrorBody.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (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.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The error detail. */ -@Immutable -public final class CloudErrorBody { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudErrorBody.class); - - /* - * The error code. - */ - @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) - private String code; - - /* - * The error message. - */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) - private String message; - - /* - * The error target. - */ - @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) - private String target; - - /* - * The error details. - */ - @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) - private List details; - - /* - * The error additional info. - */ - @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) - private List additionalInfo; - - /** - * Get the code property: The error code. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Get the message property: The error message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Get the target property: The error target. - * - * @return the target value. - */ - public String target() { - return this.target; - } - - /** - * Get the details property: The error details. - * - * @return the details value. - */ - public List details() { - return this.details; - } - - /** - * Get the additionalInfo property: The error additional info. - * - * @return the additionalInfo value. - */ - public List additionalInfo() { - return this.additionalInfo; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (details() != null) { - details().forEach(e -> e.validate()); - } - if (additionalInfo() != null) { - additionalInfo().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudName.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudName.java new file mode 100644 index 0000000000000..96cad5e62dfa2 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudName.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CloudName. */ +public final class CloudName extends ExpandableStringEnum { + /** Static value Azure for CloudName. */ + public static final CloudName AZURE = fromString("Azure"); + + /** Static value AWS for CloudName. */ + public static final CloudName AWS = fromString("AWS"); + + /** Static value GCP for CloudName. */ + public static final CloudName GCP = fromString("GCP"); + + /** + * Creates or finds a CloudName from its string representation. + * + * @param name a name to look for. + * @return the corresponding CloudName. + */ + @JsonCreator + public static CloudName fromString(String name) { + return fromString(name, CloudName.class); + } + + /** @return known CloudName values. */ + public static Collection values() { + return values(CloudName.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudOffering.java new file mode 100644 index 0000000000000..bf7fb634ff5a9 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudOffering.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The security offering details. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "offeringType", + defaultImpl = CloudOffering.class) +@JsonTypeName("CloudOffering") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "CspmMonitorAws", value = CspmMonitorAwsOffering.class), + @JsonSubTypes.Type(name = "DefenderForContainersAws", value = DefenderForContainersAwsOffering.class), + @JsonSubTypes.Type(name = "DefenderForServersAWS", value = DefenderForServersAwsOffering.class) +}) +@Immutable +public class CloudOffering { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudOffering.class); + + /* + * The offering description. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the description property: The offering description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ContainerRegistryVulnerabilityProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ContainerRegistryVulnerabilityProperties.java index f55e744440752..31c33d484a123 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ContainerRegistryVulnerabilityProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ContainerRegistryVulnerabilityProperties.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -32,6 +33,7 @@ public final class ContainerRegistryVulnerabilityProperties extends AdditionalDa * Dictionary from cvss version to cvss details object */ @JsonProperty(value = "cvss", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map cvss; /* diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOffering.java new file mode 100644 index 0000000000000..6cd8b4f05113b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOffering.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The CSPM monitoring for AWS offering configurations. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") +@JsonTypeName("CspmMonitorAws") +@Fluent +public final class CspmMonitorAwsOffering extends CloudOffering { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CspmMonitorAwsOffering.class); + + /* + * The native cloud connection configuration + */ + @JsonProperty(value = "nativeCloudConnection") + private CspmMonitorAwsOfferingNativeCloudConnection nativeCloudConnection; + + /** + * Get the nativeCloudConnection property: The native cloud connection configuration. + * + * @return the nativeCloudConnection value. + */ + public CspmMonitorAwsOfferingNativeCloudConnection nativeCloudConnection() { + return this.nativeCloudConnection; + } + + /** + * Set the nativeCloudConnection property: The native cloud connection configuration. + * + * @param nativeCloudConnection the nativeCloudConnection value to set. + * @return the CspmMonitorAwsOffering object itself. + */ + public CspmMonitorAwsOffering withNativeCloudConnection( + CspmMonitorAwsOfferingNativeCloudConnection nativeCloudConnection) { + this.nativeCloudConnection = nativeCloudConnection; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (nativeCloudConnection() != null) { + nativeCloudConnection().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOfferingNativeCloudConnection.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOfferingNativeCloudConnection.java new file mode 100644 index 0000000000000..00d41af4777aa --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOfferingNativeCloudConnection.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The native cloud connection configuration. */ +@Fluent +public final class CspmMonitorAwsOfferingNativeCloudConnection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CspmMonitorAwsOfferingNativeCloudConnection.class); + + /* + * The cloud role ARN in AWS for this feature + */ + @JsonProperty(value = "cloudRoleArn") + private String cloudRoleArn; + + /** + * 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 CspmMonitorAwsOfferingNativeCloudConnection object itself. + */ + public CspmMonitorAwsOfferingNativeCloudConnection 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/CustomAssessmentAutomation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomation.java new file mode 100644 index 0000000000000..59ff105ba2b42 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomation.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationInner; + +/** An immutable client-side representation of CustomAssessmentAutomation. */ +public interface CustomAssessmentAutomation { + /** + * 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 compressedQuery property: GZip encoded KQL query representing the assessment automation results + * required. + * + * @return the compressedQuery value. + */ + String compressedQuery(); + + /** + * Gets the supportedCloud property: Relevant cloud for the custom assessment automation. + * + * @return the supportedCloud value. + */ + SupportedCloudEnum supportedCloud(); + + /** + * Gets the severity property: The severity to relate to the assessments generated by this assessment automation. + * + * @return the severity value. + */ + SeverityEnum severity(); + + /** + * Gets the displayName property: The display name of the assessments generated by this assessment automation. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the description property: The description to relate to the assessments generated by this assessment + * automation. + * + * @return the description value. + */ + String description(); + + /** + * Gets the remediationDescription property: The remediation description to relate to the assessments generated by + * this assessment automation. + * + * @return the remediationDescription value. + */ + String remediationDescription(); + + /** + * Gets the assessmentKey property: The assessment metadata key used when an assessment is generated for this + * assessment automation. + * + * @return the assessmentKey value. + */ + String assessmentKey(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationInner object. + * + * @return the inner object. + */ + CustomAssessmentAutomationInner innerModel(); + + /** The entirety of the CustomAssessmentAutomation definition. */ + 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 { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @return the next definition stage. + */ + 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. + */ + interface WithCreate + extends DefinitionStages.WithCompressedQuery, + DefinitionStages.WithSupportedCloud, + DefinitionStages.WithSeverity, + DefinitionStages.WithDisplayName, + DefinitionStages.WithDescription, + DefinitionStages.WithRemediationDescription { + /** + * Executes the create request. + * + * @return the created resource. + */ + CustomAssessmentAutomation create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CustomAssessmentAutomation create(Context context); + } + /** The stage of the CustomAssessmentAutomation definition allowing to specify compressedQuery. */ + interface WithCompressedQuery { + /** + * Specifies the compressedQuery property: Base 64 encoded KQL query representing the assessment automation + * results required.. + * + * @param compressedQuery Base 64 encoded KQL query representing the assessment automation results required. + * @return the next definition stage. + */ + WithCreate withCompressedQuery(String compressedQuery); + } + /** The stage of the CustomAssessmentAutomation definition allowing to specify supportedCloud. */ + interface WithSupportedCloud { + /** + * Specifies the supportedCloud property: Relevant cloud for the custom assessment automation.. + * + * @param supportedCloud Relevant cloud for the custom assessment automation. + * @return the next definition stage. + */ + WithCreate withSupportedCloud(SupportedCloudEnum supportedCloud); + } + /** The stage of the CustomAssessmentAutomation definition allowing to specify severity. */ + interface WithSeverity { + /** + * Specifies the severity property: The severity to relate to the assessments generated by this assessment + * automation.. + * + * @param severity The severity to relate to the assessments generated by this assessment automation. + * @return the next definition stage. + */ + WithCreate withSeverity(SeverityEnum severity); + } + /** The stage of the CustomAssessmentAutomation definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name of the assessments generated by this assessment + * automation.. + * + * @param displayName The display name of the assessments generated by this assessment automation. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the CustomAssessmentAutomation definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The description to relate to the assessments generated by this + * assessment automation.. + * + * @param description The description to relate to the assessments generated by this assessment automation. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the CustomAssessmentAutomation definition allowing to specify remediationDescription. */ + interface WithRemediationDescription { + /** + * Specifies the remediationDescription property: The remediation description to relate to the assessments + * generated by this assessment automation.. + * + * @param remediationDescription The remediation description to relate to the assessments generated by this + * assessment automation. + * @return the next definition stage. + */ + WithCreate withRemediationDescription(String remediationDescription); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CustomAssessmentAutomation refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CustomAssessmentAutomation refresh(Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationRequest.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationRequest.java new file mode 100644 index 0000000000000..39fb5dcec983a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationRequest.java @@ -0,0 +1,188 @@ +// Copyright (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.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationRequestProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom Assessment Automation request. */ +@Fluent +public final class CustomAssessmentAutomationRequest extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomAssessmentAutomationRequest.class); + + /* + * describes Custom Assessment Automation request properties. + */ + @JsonProperty(value = "properties") + private CustomAssessmentAutomationRequestProperties innerProperties; + + /** + * Get the innerProperties property: describes Custom Assessment Automation request properties. + * + * @return the innerProperties value. + */ + private CustomAssessmentAutomationRequestProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the compressedQuery property: Base 64 encoded KQL query representing the assessment automation results + * required. + * + * @return the compressedQuery value. + */ + public String compressedQuery() { + return this.innerProperties() == null ? null : this.innerProperties().compressedQuery(); + } + + /** + * Set the compressedQuery property: Base 64 encoded KQL query representing the assessment automation results + * required. + * + * @param compressedQuery the compressedQuery value to set. + * @return the CustomAssessmentAutomationRequest object itself. + */ + public CustomAssessmentAutomationRequest withCompressedQuery(String compressedQuery) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomAssessmentAutomationRequestProperties(); + } + this.innerProperties().withCompressedQuery(compressedQuery); + return this; + } + + /** + * Get the supportedCloud property: Relevant cloud for the custom assessment automation. + * + * @return the supportedCloud value. + */ + public SupportedCloudEnum supportedCloud() { + return this.innerProperties() == null ? null : this.innerProperties().supportedCloud(); + } + + /** + * Set the supportedCloud property: Relevant cloud for the custom assessment automation. + * + * @param supportedCloud the supportedCloud value to set. + * @return the CustomAssessmentAutomationRequest object itself. + */ + public CustomAssessmentAutomationRequest withSupportedCloud(SupportedCloudEnum supportedCloud) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomAssessmentAutomationRequestProperties(); + } + this.innerProperties().withSupportedCloud(supportedCloud); + return this; + } + + /** + * Get the severity property: The severity to relate to the assessments generated by this assessment automation. + * + * @return the severity value. + */ + public SeverityEnum severity() { + return this.innerProperties() == null ? null : this.innerProperties().severity(); + } + + /** + * Set the severity property: The severity to relate to the assessments generated by this assessment automation. + * + * @param severity the severity value to set. + * @return the CustomAssessmentAutomationRequest object itself. + */ + public CustomAssessmentAutomationRequest withSeverity(SeverityEnum severity) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomAssessmentAutomationRequestProperties(); + } + this.innerProperties().withSeverity(severity); + return this; + } + + /** + * Get the displayName property: The display name of the assessments generated by this assessment automation. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name of the assessments generated by this assessment automation. + * + * @param displayName the displayName value to set. + * @return the CustomAssessmentAutomationRequest object itself. + */ + public CustomAssessmentAutomationRequest withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomAssessmentAutomationRequestProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the description property: The description to relate to the assessments generated by this assessment + * automation. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description to relate to the assessments generated by this assessment + * automation. + * + * @param description the description value to set. + * @return the CustomAssessmentAutomationRequest object itself. + */ + public CustomAssessmentAutomationRequest withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomAssessmentAutomationRequestProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the remediationDescription property: The remediation description to relate to the assessments generated by + * this assessment automation. + * + * @return the remediationDescription value. + */ + public String remediationDescription() { + return this.innerProperties() == null ? null : this.innerProperties().remediationDescription(); + } + + /** + * Set the remediationDescription property: The remediation description to relate to the assessments generated by + * this assessment automation. + * + * @param remediationDescription the remediationDescription value to set. + * @return the CustomAssessmentAutomationRequest object itself. + */ + public CustomAssessmentAutomationRequest withRemediationDescription(String remediationDescription) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomAssessmentAutomationRequestProperties(); + } + this.innerProperties().withRemediationDescription(remediationDescription); + 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/models/CustomAssessmentAutomations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomations.java new file mode 100644 index 0000000000000..cf20c98c87082 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomations.java @@ -0,0 +1,164 @@ +// Copyright (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 CustomAssessmentAutomations. */ +public interface CustomAssessmentAutomations { + /** + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom assessment automation by name for the provided subscription and resource group. + */ + CustomAssessmentAutomation getByResourceGroup(String resourceGroupName, String customAssessmentAutomationName); + + /** + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom assessment automation by name for the provided subscription and resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String customAssessmentAutomationName, Context context); + + /** + * Deletes a custom assessment automation by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 customAssessmentAutomationName); + + /** + * Deletes a custom assessment automation by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customAssessmentAutomationName Name of the Custom Assessment Automation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse(String resourceGroupName, String customAssessmentAutomationName, Context context); + + /** + * List custom assessment automations by provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 Custom Assessment Automations. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List custom assessment automations by provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 Custom Assessment Automations. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List custom assessment automations by provided 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 a list of Custom Assessment Automations. + */ + PagedIterable list(); + + /** + * List custom assessment automations by provided 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 a list of Custom Assessment Automations. + */ + PagedIterable list(Context context); + + /** + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom assessment automation by name for the provided subscription and resource group. + */ + CustomAssessmentAutomation getById(String id); + + /** + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom assessment automation by name for the provided subscription and resource group. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a custom assessment automation by name for a provided 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 a custom assessment automation by name for a provided 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 response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CustomAssessmentAutomation resource. + * + * @param name resource name. + * @return the first stage of the new CustomAssessmentAutomation definition. + */ + CustomAssessmentAutomation.DefinitionStages.Blank define(String name); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationsListResult.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationsListResult.java new file mode 100644 index 0000000000000..ad8b917ac6e62 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationsListResult.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of Custom Assessment Automations. */ +@Fluent +public final class CustomAssessmentAutomationsListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomAssessmentAutomationsListResult.class); + + /* + * Collection of Custom Assessment Automations + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Collection of Custom Assessment Automations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the CustomAssessmentAutomationsListResult object itself. + */ + public CustomAssessmentAutomationsListResult 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/CustomEntityStoreAssignment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignment.java new file mode 100644 index 0000000000000..fcdf9e4547fec --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignment.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentInner; + +/** An immutable client-side representation of CustomEntityStoreAssignment. */ +public interface CustomEntityStoreAssignment { + /** + * 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 principal property: The principal assigned with entity store. Format of principal is: [AAD + * type]=[PrincipalObjectId];[TenantId]. + * + * @return the principal value. + */ + String principal(); + + /** + * Gets the entityStoreDatabaseLink property: The link to entity store database. + * + * @return the entityStoreDatabaseLink value. + */ + String entityStoreDatabaseLink(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentInner object. + * + * @return the inner object. + */ + CustomEntityStoreAssignmentInner innerModel(); + + /** The entirety of the CustomEntityStoreAssignment definition. */ + 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 { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @return the next definition stage. + */ + 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. + */ + interface WithCreate extends DefinitionStages.WithPrincipal { + /** + * Executes the create request. + * + * @return the created resource. + */ + CustomEntityStoreAssignment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CustomEntityStoreAssignment create(Context context); + } + /** The stage of the CustomEntityStoreAssignment definition allowing to specify principal. */ + interface WithPrincipal { + /** + * Specifies the principal property: The principal assigned with entity store. If not provided, will use + * caller principal. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. + * + * @param principal The principal assigned with entity store. If not provided, will use caller principal. + * Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. + * @return the next definition stage. + */ + WithCreate withPrincipal(String principal); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CustomEntityStoreAssignment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CustomEntityStoreAssignment refresh(Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentRequest.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentRequest.java new file mode 100644 index 0000000000000..165651e43e9e4 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentRequest.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentRequestProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** describes the custom entity store assignment request. */ +@Fluent +public final class CustomEntityStoreAssignmentRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomEntityStoreAssignmentRequest.class); + + /* + * describes properties of custom entity store assignment request + */ + @JsonProperty(value = "properties") + private CustomEntityStoreAssignmentRequestProperties innerProperties; + + /** + * Get the innerProperties property: describes properties of custom entity store assignment request. + * + * @return the innerProperties value. + */ + private CustomEntityStoreAssignmentRequestProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the principal property: The principal assigned with entity store. If not provided, will use caller principal. + * Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. + * + * @return the principal value. + */ + public String principal() { + return this.innerProperties() == null ? null : this.innerProperties().principal(); + } + + /** + * Set the principal property: The principal assigned with entity store. If not provided, will use caller principal. + * Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. + * + * @param principal the principal value to set. + * @return the CustomEntityStoreAssignmentRequest object itself. + */ + public CustomEntityStoreAssignmentRequest withPrincipal(String principal) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomEntityStoreAssignmentRequestProperties(); + } + this.innerProperties().withPrincipal(principal); + 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/models/CustomEntityStoreAssignments.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignments.java new file mode 100644 index 0000000000000..d48cabef08666 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignments.java @@ -0,0 +1,165 @@ +// Copyright (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 CustomEntityStoreAssignments. */ +public interface CustomEntityStoreAssignments { + /** + * Gets a single custom entity store assignment by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom entity store assignment by name for the provided subscription and resource group. + */ + CustomEntityStoreAssignment getByResourceGroup(String resourceGroupName, String customEntityStoreAssignmentName); + + /** + * Gets a single custom entity store assignment by name for the provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom entity store assignment by name for the provided subscription and resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String customEntityStoreAssignmentName, Context context); + + /** + * Delete a custom entity store assignment by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String customEntityStoreAssignmentName); + + /** + * Delete a custom entity store assignment by name for a provided subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String customEntityStoreAssignmentName, Context context); + + /** + * List custom entity store assignments by a provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 custom entity store assignments. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List custom entity store assignments by a provided subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 custom entity store assignments. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List custom entity store assignments by provided 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 a list of custom entity store assignments. + */ + PagedIterable list(); + + /** + * List custom entity store assignments by provided 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 a list of custom entity store assignments. + */ + PagedIterable list(Context context); + + /** + * Gets a single custom entity store assignment by name for the provided subscription and resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom entity store assignment by name for the provided subscription and resource group. + */ + CustomEntityStoreAssignment getById(String id); + + /** + * Gets a single custom entity store assignment by name for the provided subscription and resource group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single custom entity store assignment by name for the provided subscription and resource group. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a custom entity store assignment by name for a provided 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); + + /** + * Delete a custom entity store assignment by name for a provided 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 response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CustomEntityStoreAssignment resource. + * + * @param name resource name. + * @return the first stage of the new CustomEntityStoreAssignment definition. + */ + CustomEntityStoreAssignment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentsListResult.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentsListResult.java new file mode 100644 index 0000000000000..6bd5e5c82ae58 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentsListResult.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of custom entity store assignments. */ +@Fluent +public final class CustomEntityStoreAssignmentsListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomEntityStoreAssignmentsListResult.class); + + /* + * Collection of custom entity store assignments + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Collection of custom entity store assignments. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the CustomEntityStoreAssignmentsListResult object itself. + */ + public CustomEntityStoreAssignmentsListResult 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/DataExportSettings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataExportSettings.java index 19d6438d68b0e..3d79600089808 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataExportSettings.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataExportSettings.java @@ -5,8 +5,8 @@ package com.azure.resourcemanager.security.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.fluent.models.DataExportSettingProperties; import com.azure.resourcemanager.security.fluent.models.SettingInner; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -16,16 +16,24 @@ /** Represents a data export setting. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("DataExportSettings") -@JsonFlatten @Fluent -public class DataExportSettings extends SettingInner { +public final class DataExportSettings extends SettingInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(DataExportSettings.class); /* - * Is the data export setting enabled + * Data export setting data */ - @JsonProperty(value = "properties.enabled") - private Boolean enabled; + @JsonProperty(value = "properties") + private DataExportSettingProperties innerProperties; + + /** + * Get the innerProperties property: Data export setting data. + * + * @return the innerProperties value. + */ + private DataExportSettingProperties innerProperties() { + return this.innerProperties; + } /** * Get the enabled property: Is the data export setting enabled. @@ -33,7 +41,7 @@ public class DataExportSettings extends SettingInner { * @return the enabled value. */ public Boolean enabled() { - return this.enabled; + return this.innerProperties() == null ? null : this.innerProperties().enabled(); } /** @@ -43,7 +51,10 @@ public Boolean enabled() { * @return the DataExportSettings object itself. */ public DataExportSettings withEnabled(Boolean enabled) { - this.enabled = enabled; + if (this.innerProperties() == null) { + this.innerProperties = new DataExportSettingProperties(); + } + this.innerProperties().withEnabled(enabled); return this; } @@ -55,5 +66,8 @@ public DataExportSettings withEnabled(Boolean enabled) { @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/DefenderForContainersAwsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOffering.java new file mode 100644 index 0000000000000..39692a53ee196 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOffering.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The Defender for Containers AWS offering configurations. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") +@JsonTypeName("DefenderForContainersAws") +@Fluent +public final class DefenderForContainersAwsOffering extends CloudOffering { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefenderForContainersAwsOffering.class); + + /* + * The kubernetes service connection configuration + */ + @JsonProperty(value = "kubernetesService") + private DefenderForContainersAwsOfferingKubernetesService kubernetesService; + + /* + * The kubernetes to scuba connection configuration + */ + @JsonProperty(value = "kubernetesScubaReader") + private DefenderForContainersAwsOfferingKubernetesScubaReader kubernetesScubaReader; + + /* + * The cloudwatch to kinesis connection configuration + */ + @JsonProperty(value = "cloudWatchToKinesis") + private DefenderForContainersAwsOfferingCloudWatchToKinesis cloudWatchToKinesis; + + /* + * The kinesis to s3 connection configuration + */ + @JsonProperty(value = "kinesisToS3") + private DefenderForContainersAwsOfferingKinesisToS3 kinesisToS3; + + /** + * Get the kubernetesService property: The kubernetes service connection configuration. + * + * @return the kubernetesService value. + */ + public DefenderForContainersAwsOfferingKubernetesService kubernetesService() { + return this.kubernetesService; + } + + /** + * Set the kubernetesService property: The kubernetes service connection configuration. + * + * @param kubernetesService the kubernetesService value to set. + * @return the DefenderForContainersAwsOffering object itself. + */ + public DefenderForContainersAwsOffering withKubernetesService( + DefenderForContainersAwsOfferingKubernetesService kubernetesService) { + this.kubernetesService = kubernetesService; + return this; + } + + /** + * Get the kubernetesScubaReader property: The kubernetes to scuba connection configuration. + * + * @return the kubernetesScubaReader value. + */ + public DefenderForContainersAwsOfferingKubernetesScubaReader kubernetesScubaReader() { + return this.kubernetesScubaReader; + } + + /** + * Set the kubernetesScubaReader property: The kubernetes to scuba connection configuration. + * + * @param kubernetesScubaReader the kubernetesScubaReader value to set. + * @return the DefenderForContainersAwsOffering object itself. + */ + public DefenderForContainersAwsOffering withKubernetesScubaReader( + DefenderForContainersAwsOfferingKubernetesScubaReader kubernetesScubaReader) { + this.kubernetesScubaReader = kubernetesScubaReader; + return this; + } + + /** + * Get the cloudWatchToKinesis property: The cloudwatch to kinesis connection configuration. + * + * @return the cloudWatchToKinesis value. + */ + public DefenderForContainersAwsOfferingCloudWatchToKinesis cloudWatchToKinesis() { + return this.cloudWatchToKinesis; + } + + /** + * Set the cloudWatchToKinesis property: The cloudwatch to kinesis connection configuration. + * + * @param cloudWatchToKinesis the cloudWatchToKinesis value to set. + * @return the DefenderForContainersAwsOffering object itself. + */ + public DefenderForContainersAwsOffering withCloudWatchToKinesis( + DefenderForContainersAwsOfferingCloudWatchToKinesis cloudWatchToKinesis) { + this.cloudWatchToKinesis = cloudWatchToKinesis; + return this; + } + + /** + * Get the kinesisToS3 property: The kinesis to s3 connection configuration. + * + * @return the kinesisToS3 value. + */ + public DefenderForContainersAwsOfferingKinesisToS3 kinesisToS3() { + return this.kinesisToS3; + } + + /** + * Set the kinesisToS3 property: The kinesis to s3 connection configuration. + * + * @param kinesisToS3 the kinesisToS3 value to set. + * @return the DefenderForContainersAwsOffering object itself. + */ + public DefenderForContainersAwsOffering withKinesisToS3(DefenderForContainersAwsOfferingKinesisToS3 kinesisToS3) { + this.kinesisToS3 = kinesisToS3; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (kubernetesService() != null) { + kubernetesService().validate(); + } + if (kubernetesScubaReader() != null) { + kubernetesScubaReader().validate(); + } + if (cloudWatchToKinesis() != null) { + cloudWatchToKinesis().validate(); + } + if (kinesisToS3() != null) { + kinesisToS3().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingCloudWatchToKinesis.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingCloudWatchToKinesis.java new file mode 100644 index 0000000000000..a6867afe17acf --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingCloudWatchToKinesis.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The cloudwatch to kinesis connection configuration. */ +@Fluent +public final class DefenderForContainersAwsOfferingCloudWatchToKinesis { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(DefenderForContainersAwsOfferingCloudWatchToKinesis.class); + + /* + * The cloud role ARN in AWS for this feature + */ + @JsonProperty(value = "cloudRoleArn") + private String cloudRoleArn; + + /** + * 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 DefenderForContainersAwsOfferingCloudWatchToKinesis object itself. + */ + public DefenderForContainersAwsOfferingCloudWatchToKinesis 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/DefenderForContainersAwsOfferingKinesisToS3.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKinesisToS3.java new file mode 100644 index 0000000000000..0e2455abeb203 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKinesisToS3.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The kinesis to s3 connection configuration. */ +@Fluent +public final class DefenderForContainersAwsOfferingKinesisToS3 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefenderForContainersAwsOfferingKinesisToS3.class); + + /* + * The cloud role ARN in AWS for this feature + */ + @JsonProperty(value = "cloudRoleArn") + private String cloudRoleArn; + + /** + * 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 DefenderForContainersAwsOfferingKinesisToS3 object itself. + */ + public DefenderForContainersAwsOfferingKinesisToS3 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/DefenderForContainersAwsOfferingKubernetesScubaReader.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesScubaReader.java new file mode 100644 index 0000000000000..c3c8556905a88 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesScubaReader.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The kubernetes to scuba connection configuration. */ +@Fluent +public final class DefenderForContainersAwsOfferingKubernetesScubaReader { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(DefenderForContainersAwsOfferingKubernetesScubaReader.class); + + /* + * The cloud role ARN in AWS for this feature + */ + @JsonProperty(value = "cloudRoleArn") + private String cloudRoleArn; + + /** + * 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 DefenderForContainersAwsOfferingKubernetesScubaReader object itself. + */ + public DefenderForContainersAwsOfferingKubernetesScubaReader 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/DefenderForContainersAwsOfferingKubernetesService.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesService.java new file mode 100644 index 0000000000000..4bbe7445f71a9 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesService.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The kubernetes service connection configuration. */ +@Fluent +public final class DefenderForContainersAwsOfferingKubernetesService { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(DefenderForContainersAwsOfferingKubernetesService.class); + + /* + * The cloud role ARN in AWS for this feature + */ + @JsonProperty(value = "cloudRoleArn") + private String cloudRoleArn; + + /** + * 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 DefenderForContainersAwsOfferingKubernetesService object itself. + */ + public DefenderForContainersAwsOfferingKubernetesService 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/DefenderForServersAwsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOffering.java new file mode 100644 index 0000000000000..a25a2b8d89036 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOffering.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The Defender for Servers AWS offering configurations. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") +@JsonTypeName("DefenderForServersAWS") +@Fluent +public final class DefenderForServersAwsOffering extends CloudOffering { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefenderForServersAwsOffering.class); + + /* + * The Defender for servers connection configuration + */ + @JsonProperty(value = "defenderForServers") + private DefenderForServersAwsOfferingDefenderForServers defenderForServers; + + /* + * The ARC autoprovisioning configuration + */ + @JsonProperty(value = "arcAutoProvisioning") + private DefenderForServersAwsOfferingArcAutoProvisioning arcAutoProvisioning; + + /** + * Get the defenderForServers property: The Defender for servers connection configuration. + * + * @return the defenderForServers value. + */ + public DefenderForServersAwsOfferingDefenderForServers defenderForServers() { + return this.defenderForServers; + } + + /** + * Set the defenderForServers property: The Defender for servers connection configuration. + * + * @param defenderForServers the defenderForServers value to set. + * @return the DefenderForServersAwsOffering object itself. + */ + public DefenderForServersAwsOffering withDefenderForServers( + DefenderForServersAwsOfferingDefenderForServers defenderForServers) { + this.defenderForServers = defenderForServers; + return this; + } + + /** + * Get the arcAutoProvisioning property: The ARC autoprovisioning configuration. + * + * @return the arcAutoProvisioning value. + */ + public DefenderForServersAwsOfferingArcAutoProvisioning arcAutoProvisioning() { + return this.arcAutoProvisioning; + } + + /** + * Set the arcAutoProvisioning property: The ARC autoprovisioning configuration. + * + * @param arcAutoProvisioning the arcAutoProvisioning value to set. + * @return the DefenderForServersAwsOffering object itself. + */ + public DefenderForServersAwsOffering withArcAutoProvisioning( + DefenderForServersAwsOfferingArcAutoProvisioning arcAutoProvisioning) { + this.arcAutoProvisioning = arcAutoProvisioning; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (defenderForServers() != null) { + defenderForServers().validate(); + } + if (arcAutoProvisioning() != null) { + arcAutoProvisioning().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioning.java new file mode 100644 index 0000000000000..95c4c3d0c832c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioning.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ARC autoprovisioning configuration. */ +@Fluent +public final class DefenderForServersAwsOfferingArcAutoProvisioning { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(DefenderForServersAwsOfferingArcAutoProvisioning.class); + + /* + * Is arc auto provisioning enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Metadata of Service Principal secret for autoprovisioning + */ + @JsonProperty(value = "servicePrincipalSecretMetadata") + private DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata + servicePrincipalSecretMetadata; + + /** + * Get the enabled property: Is arc auto provisioning enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Is arc auto provisioning enabled. + * + * @param enabled the enabled value to set. + * @return the DefenderForServersAwsOfferingArcAutoProvisioning object itself. + */ + public DefenderForServersAwsOfferingArcAutoProvisioning withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the servicePrincipalSecretMetadata property: Metadata of Service Principal secret for autoprovisioning. + * + * @return the servicePrincipalSecretMetadata value. + */ + public DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata + servicePrincipalSecretMetadata() { + return this.servicePrincipalSecretMetadata; + } + + /** + * Set the servicePrincipalSecretMetadata property: Metadata of Service Principal secret for autoprovisioning. + * + * @param servicePrincipalSecretMetadata the servicePrincipalSecretMetadata value to set. + * @return the DefenderForServersAwsOfferingArcAutoProvisioning object itself. + */ + public DefenderForServersAwsOfferingArcAutoProvisioning withServicePrincipalSecretMetadata( + DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata servicePrincipalSecretMetadata) { + this.servicePrincipalSecretMetadata = servicePrincipalSecretMetadata; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (servicePrincipalSecretMetadata() != null) { + servicePrincipalSecretMetadata().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata.java new file mode 100644 index 0000000000000..618bf98b1db61 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Metadata of Service Principal secret for autoprovisioning. */ +@Fluent +public final class DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata.class); + + /* + * expiration date of service principal secret + */ + @JsonProperty(value = "expiryDate") + private String expiryDate; + + /* + * region of parameter store where secret is kept + */ + @JsonProperty(value = "parameterStoreRegion") + private String parameterStoreRegion; + + /* + * name of secret resource in parameter store + */ + @JsonProperty(value = "parameterNameInStore") + private String parameterNameInStore; + + /** + * Get the expiryDate property: expiration date of service principal secret. + * + * @return the expiryDate value. + */ + public String expiryDate() { + return this.expiryDate; + } + + /** + * Set the expiryDate property: expiration date of service principal secret. + * + * @param expiryDate the expiryDate value to set. + * @return the DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata object itself. + */ + public DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata withExpiryDate( + String expiryDate) { + this.expiryDate = expiryDate; + return this; + } + + /** + * Get the parameterStoreRegion property: region of parameter store where secret is kept. + * + * @return the parameterStoreRegion value. + */ + public String parameterStoreRegion() { + return this.parameterStoreRegion; + } + + /** + * Set the parameterStoreRegion property: region of parameter store where secret is kept. + * + * @param parameterStoreRegion the parameterStoreRegion value to set. + * @return the DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata object itself. + */ + public DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata withParameterStoreRegion( + String parameterStoreRegion) { + this.parameterStoreRegion = parameterStoreRegion; + return this; + } + + /** + * Get the parameterNameInStore property: name of secret resource in parameter store. + * + * @return the parameterNameInStore value. + */ + public String parameterNameInStore() { + return this.parameterNameInStore; + } + + /** + * Set the parameterNameInStore property: name of secret resource in parameter store. + * + * @param parameterNameInStore the parameterNameInStore value to set. + * @return the DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata object itself. + */ + public DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata withParameterNameInStore( + String parameterNameInStore) { + this.parameterNameInStore = parameterNameInStore; + 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/DefenderForServersAwsOfferingDefenderForServers.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingDefenderForServers.java new file mode 100644 index 0000000000000..9c84edeef60e3 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingDefenderForServers.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Defender for servers connection configuration. */ +@Fluent +public final class DefenderForServersAwsOfferingDefenderForServers { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(DefenderForServersAwsOfferingDefenderForServers.class); + + /* + * The cloud role ARN in AWS for this feature + */ + @JsonProperty(value = "cloudRoleArn") + private String cloudRoleArn; + + /** + * 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 DefenderForServersAwsOfferingDefenderForServers object itself. + */ + public DefenderForServersAwsOfferingDefenderForServers 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/Device.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Device.java deleted file mode 100644 index 71d5333cfed3a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Device.java +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (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.DeviceInner; -import java.time.OffsetDateTime; -import java.util.List; - -/** An immutable client-side representation of Device. */ -public interface Device { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the displayName property: Device display name given by the collector. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the deviceType property: Device type. - * - * @return the deviceType value. - */ - String deviceType(); - - /** - * Gets the sourceName property: The source that created the device. - * - * @return the sourceName value. - */ - String sourceName(); - - /** - * Gets the networkInterfaces property: List of network interfaces. - * - * @return the networkInterfaces value. - */ - List networkInterfaces(); - - /** - * Gets the vendor property: Device vendor. - * - * @return the vendor value. - */ - String vendor(); - - /** - * Gets the osName property: Device operating system name. - * - * @return the osName value. - */ - String osName(); - - /** - * Gets the protocols property: List of protocols. - * - * @return the protocols value. - */ - List protocols(); - - /** - * Gets the lastActiveTime property: last time the device was active in the network. - * - * @return the lastActiveTime value. - */ - OffsetDateTime lastActiveTime(); - - /** - * Gets the lastUpdateTime property: last time the device was updated. - * - * @return the lastUpdateTime value. - */ - OffsetDateTime lastUpdateTime(); - - /** - * Gets the managementState property: Managed state of the device. - * - * @return the managementState value. - */ - ManagementState managementState(); - - /** - * Gets the authorizationState property: Authorized state of the device. - * - * @return the authorizationState value. - */ - AuthorizationState authorizationState(); - - /** - * Gets the deviceCriticality property: Device criticality. - * - * @return the deviceCriticality value. - */ - DeviceCriticality deviceCriticality(); - - /** - * Gets the purdueLevel property: Purdue level of the device. - * - * @return the purdueLevel value. - */ - PurdueLevel purdueLevel(); - - /** - * Gets the notes property: user notes for the device, up to 300 characters. - * - * @return the notes value. - */ - String notes(); - - /** - * Gets the firmwares property: List of device firmwares. - * - * @return the firmwares value. - */ - List firmwares(); - - /** - * Gets the discoveryTime property: Discovered time of the device. - * - * @return the discoveryTime value. - */ - OffsetDateTime discoveryTime(); - - /** - * Gets the programmingState property: Indicates whether this device is programming. - * - * @return the programmingState value. - */ - ProgrammingState programmingState(); - - /** - * Gets the lastProgrammingTime property: last time the device was programming or programed. - * - * @return the lastProgrammingTime value. - */ - OffsetDateTime lastProgrammingTime(); - - /** - * Gets the scanningFunctionality property: Indicates whether the device is a scanner. - * - * @return the scanningFunctionality value. - */ - ScanningFunctionality scanningFunctionality(); - - /** - * Gets the lastScanTime property: last time the device was scanning. - * - * @return the lastScanTime value. - */ - OffsetDateTime lastScanTime(); - - /** - * Gets the riskScore property: risk score of the device. - * - * @return the riskScore value. - */ - Integer riskScore(); - - /** - * Gets the sensors property: List of sensors that scanned this device. - * - * @return the sensors value. - */ - List sensors(); - - /** - * Gets the site property: Site data. - * - * @return the site value. - */ - Site site(); - - /** - * Gets the deviceStatus property: Device status. - * - * @return the deviceStatus value. - */ - DeviceStatus deviceStatus(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.DeviceInner object. - * - * @return the inner object. - */ - DeviceInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceCriticality.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceCriticality.java deleted file mode 100644 index 0ad8a0d59c092..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceCriticality.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DeviceCriticality. */ -public final class DeviceCriticality extends ExpandableStringEnum { - /** Static value Important for DeviceCriticality. */ - public static final DeviceCriticality IMPORTANT = fromString("Important"); - - /** Static value Standard for DeviceCriticality. */ - public static final DeviceCriticality STANDARD = fromString("Standard"); - - /** - * Creates or finds a DeviceCriticality from its string representation. - * - * @param name a name to look for. - * @return the corresponding DeviceCriticality. - */ - @JsonCreator - public static DeviceCriticality fromString(String name) { - return fromString(name, DeviceCriticality.class); - } - - /** @return known DeviceCriticality values. */ - public static Collection values() { - return values(DeviceCriticality.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceStatus.java deleted file mode 100644 index e45e5661f745a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceStatus.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DeviceStatus. */ -public final class DeviceStatus extends ExpandableStringEnum { - /** Static value Active for DeviceStatus. */ - public static final DeviceStatus ACTIVE = fromString("Active"); - - /** Static value Removed for DeviceStatus. */ - public static final DeviceStatus REMOVED = fromString("Removed"); - - /** - * Creates or finds a DeviceStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding DeviceStatus. - */ - @JsonCreator - public static DeviceStatus fromString(String name) { - return fromString(name, DeviceStatus.class); - } - - /** @return known DeviceStatus values. */ - public static Collection values() { - return values(DeviceStatus.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Devices.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Devices.java deleted file mode 100644 index 202f64be237ea..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Devices.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.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of Devices. */ -public interface Devices { - /** - * Get device. - * - * @param resourceId The identifier of the resource. - * @param deviceId Identifier of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device. - */ - Device get(String resourceId, String deviceId); - - /** - * Get device. - * - * @param resourceId The identifier of the resource. - * @param deviceId Identifier of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device. - */ - Response getWithResponse(String resourceId, String deviceId, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevicesForHubs.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevicesForHubs.java deleted file mode 100644 index f2da70879d186..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevicesForHubs.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.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of DevicesForHubs. */ -public interface DevicesForHubs { - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of the devices for the specified IoT Hub resource. - */ - PagedIterable list(String resourceId); - - /** - * Get list of the devices for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 the devices for the specified IoT Hub resource. - */ - PagedIterable list( - String resourceId, Integer limit, String skipToken, ManagementState deviceManagementType, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevicesForSubscriptions.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevicesForSubscriptions.java deleted file mode 100644 index b53f278dc088c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevicesForSubscriptions.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.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of DevicesForSubscriptions. */ -public interface DevicesForSubscriptions { - /** - * Get list of the devices by their 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 the devices by their subscription. - */ - PagedIterable list(); - - /** - * Get list of the devices by their subscription. - * - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 the devices by their subscription. - */ - PagedIterable list(Integer limit, String skipToken, ManagementState deviceManagementType, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolution.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolution.java index bb8f1a56ab249..ffb98c4d786db 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolution.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolution.java @@ -29,6 +29,13 @@ public interface DiscoveredSecuritySolution { */ String type(); + /** + * Gets the location property: Location where the resource is stored. + * + * @return the location value. + */ + String location(); + /** * Gets the securityFamily property: The security family of the discovered solution. * @@ -57,13 +64,6 @@ public interface DiscoveredSecuritySolution { */ String sku(); - /** - * Gets the location property: Location where the resource is stored. - * - * @return the location value. - */ - String location(); - /** * Gets the inner com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner object. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ErrorAdditionalInfo.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ErrorAdditionalInfo.java deleted file mode 100644 index 0be5b8bf2e2dc..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ErrorAdditionalInfo.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.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The resource management error additional info. */ -@Immutable -public final class ErrorAdditionalInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorAdditionalInfo.class); - - /* - * The additional info type. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * The additional info. - */ - @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) - private Object info; - - /** - * Get the type property: The additional info type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the info property: The additional info. - * - * @return the info value. - */ - public Object info() { - return this.info; - } - - /** - * 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/EventSource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EventSource.java index 1b2a6b86c1977..54fd7235d6b3e 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EventSource.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EventSource.java @@ -13,9 +13,15 @@ public final class EventSource extends ExpandableStringEnum { /** Static value Assessments for EventSource. */ public static final EventSource ASSESSMENTS = fromString("Assessments"); + /** Static value AssessmentsSnapshot for EventSource. */ + public static final EventSource ASSESSMENTS_SNAPSHOT = fromString("AssessmentsSnapshot"); + /** Static value SubAssessments for EventSource. */ public static final EventSource SUB_ASSESSMENTS = fromString("SubAssessments"); + /** Static value SubAssessmentsSnapshot for EventSource. */ + public static final EventSource SUB_ASSESSMENTS_SNAPSHOT = fromString("SubAssessmentsSnapshot"); + /** Static value Alerts for EventSource. */ public static final EventSource ALERTS = fromString("Alerts"); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKind.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKind.java new file mode 100644 index 0000000000000..7d480b5492079 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKind.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExternalSecuritySolutionKind. */ +public final class ExternalSecuritySolutionKind extends ExpandableStringEnum { + /** Static value CEF for ExternalSecuritySolutionKind. */ + public static final ExternalSecuritySolutionKind CEF = fromString("CEF"); + + /** Static value ATA for ExternalSecuritySolutionKind. */ + public static final ExternalSecuritySolutionKind ATA = fromString("ATA"); + + /** Static value AAD for ExternalSecuritySolutionKind. */ + public static final ExternalSecuritySolutionKind AAD = fromString("AAD"); + + /** + * Creates or finds a ExternalSecuritySolutionKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExternalSecuritySolutionKind. + */ + @JsonCreator + public static ExternalSecuritySolutionKind fromString(String name) { + return fromString(name, ExternalSecuritySolutionKind.class); + } + + /** @return known ExternalSecuritySolutionKind values. */ + public static Collection values() { + return values(ExternalSecuritySolutionKind.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKindValue.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKindValue.java deleted file mode 100644 index d77e2eea62ab9..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKindValue.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ExternalSecuritySolutionKindValue. */ -public final class ExternalSecuritySolutionKindValue extends ExpandableStringEnum { - /** Static value CEF for ExternalSecuritySolutionKindValue. */ - public static final ExternalSecuritySolutionKindValue CEF = fromString("CEF"); - - /** Static value ATA for ExternalSecuritySolutionKindValue. */ - public static final ExternalSecuritySolutionKindValue ATA = fromString("ATA"); - - /** Static value AAD for ExternalSecuritySolutionKindValue. */ - public static final ExternalSecuritySolutionKindValue AAD = fromString("AAD"); - - /** - * Creates or finds a ExternalSecuritySolutionKindValue from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExternalSecuritySolutionKindValue. - */ - @JsonCreator - public static ExternalSecuritySolutionKindValue fromString(String name) { - return fromString(name, ExternalSecuritySolutionKindValue.class); - } - - /** @return known ExternalSecuritySolutionKindValue values. */ - public static Collection values() { - return values(ExternalSecuritySolutionKindValue.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Firmware.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Firmware.java deleted file mode 100644 index d1fa6bff32643..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Firmware.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (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.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Firmware information. */ -@Immutable -public final class Firmware { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Firmware.class); - - /* - * Address of the specific module a firmware is related to - */ - @JsonProperty(value = "moduleAddress", access = JsonProperty.Access.WRITE_ONLY) - private String moduleAddress; - - /* - * Rack number of the module a firmware is related to. - */ - @JsonProperty(value = "rack", access = JsonProperty.Access.WRITE_ONLY) - private String rack; - - /* - * Slot number in the rack of the module a firmware is related to - */ - @JsonProperty(value = "slot", access = JsonProperty.Access.WRITE_ONLY) - private String slot; - - /* - * Serial of the firmware - */ - @JsonProperty(value = "serial", access = JsonProperty.Access.WRITE_ONLY) - private String serial; - - /* - * Firmware model - */ - @JsonProperty(value = "model", access = JsonProperty.Access.WRITE_ONLY) - private String model; - - /* - * Firmware version - */ - @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) - private String version; - - /* - * A bag of fields which extends the firmware information. - */ - @JsonProperty(value = "additionalData", access = JsonProperty.Access.WRITE_ONLY) - private Object additionalData; - - /** - * Get the moduleAddress property: Address of the specific module a firmware is related to. - * - * @return the moduleAddress value. - */ - public String moduleAddress() { - return this.moduleAddress; - } - - /** - * Get the rack property: Rack number of the module a firmware is related to. - * - * @return the rack value. - */ - public String rack() { - return this.rack; - } - - /** - * Get the slot property: Slot number in the rack of the module a firmware is related to. - * - * @return the slot value. - */ - public String slot() { - return this.slot; - } - - /** - * Get the serial property: Serial of the firmware. - * - * @return the serial value. - */ - public String serial() { - return this.serial; - } - - /** - * Get the model property: Firmware model. - * - * @return the model value. - */ - public String model() { - return this.model; - } - - /** - * Get the version property: Firmware version. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Get the additionalData property: A bag of fields which extends the firmware information. - * - * @return the additionalData value. - */ - public Object additionalData() { - return this.additionalData; - } - - /** - * 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/IoTSecurityAggregatedAlert.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedAlert.java index acabac8ad9f2a..d449235f7c916 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedAlert.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedAlert.java @@ -32,6 +32,13 @@ public interface IoTSecurityAggregatedAlert { */ String type(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the alertType property: Name of the alert type. * @@ -124,13 +131,6 @@ public interface IoTSecurityAggregatedAlert { */ List topDevicesList(); - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - /** * Gets the inner com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedAlertInner object. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedRecommendation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedRecommendation.java index 2913b77d620b3..225b2f7a2ea96 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedRecommendation.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedRecommendation.java @@ -30,6 +30,13 @@ public interface IoTSecurityAggregatedRecommendation { */ String type(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the recommendationName property: Name of the recommendation. * @@ -100,13 +107,6 @@ public interface IoTSecurityAggregatedRecommendation { */ String logAnalyticsQuery(); - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - /** * Gets the inner com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationInner object. * 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 e950517c6d391..a39bf20d7dd78 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 @@ -48,6 +48,13 @@ public interface IoTSecuritySolutionModel { */ SystemData systemData(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the workspace property: Workspace resource ID. * @@ -127,13 +134,6 @@ public interface IoTSecuritySolutionModel { */ List additionalWorkspaces(); - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - /** * Gets the region of the resource. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertListModel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertListModel.java deleted file mode 100644 index b28c3830e14f7..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertListModel.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.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.IotAlertModelInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of IoT alerts. */ -@Immutable -public final class IotAlertListModel { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotAlertListModel.class); - - /* - * List data - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * When available, follow the URI to get the next page of data - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: List data. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: When available, follow the URI to get the next page of data. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertModel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertModel.java deleted file mode 100644 index fec18e0dabcc1..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertModel.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (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.IotAlertModelInner; -import java.util.List; - -/** An immutable client-side representation of IotAlertModel. */ -public interface IotAlertModel { - /** - * 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 systemAlertId property: Holds the product canonical identifier of the alert within the scope of a - * product. - * - * @return the systemAlertId value. - */ - String systemAlertId(); - - /** - * Gets the compromisedEntity property: Display name of the main entity being reported on. - * - * @return the compromisedEntity value. - */ - String compromisedEntity(); - - /** - * Gets the alertType property: The type name of the alert. - * - * @return the alertType value. - */ - String alertType(); - - /** - * Gets the startTimeUtc property: The impact start time of the alert (the time of the first event or activity - * included in the alert). - * - * @return the startTimeUtc value. - */ - String startTimeUtc(); - - /** - * Gets the endTimeUtc property: The impact end time of the alert (the time of the last event or activity included - * in the alert). - * - * @return the endTimeUtc value. - */ - String endTimeUtc(); - - /** - * Gets the entities property: A list of entities related to the alert. - * - * @return the entities value. - */ - List entities(); - - /** - * Gets the extendedProperties property: A bag of fields which extends the alert information. - * - * @return the extendedProperties value. - */ - Object extendedProperties(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotAlertModelInner object. - * - * @return the inner object. - */ - IotAlertModelInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertType.java deleted file mode 100644 index 8a685cd60ccf1..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertType.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (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.IotAlertTypeInner; -import java.util.List; - -/** An immutable client-side representation of IotAlertType. */ -public interface IotAlertType { - /** - * 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 alertDisplayName property: The display name of the alert. - * - * @return the alertDisplayName value. - */ - String alertDisplayName(); - - /** - * Gets the severity property: The severity of the alert. - * - * @return the severity value. - */ - AlertSeverity severity(); - - /** - * Gets the description property: Description of the suspected vulnerability and meaning. - * - * @return the description value. - */ - String description(); - - /** - * Gets the providerName property: The name of the alert provider or internal partner. - * - * @return the providerName value. - */ - String providerName(); - - /** - * Gets the productName property: The name of the product which published this alert. - * - * @return the productName value. - */ - String productName(); - - /** - * Gets the productComponentName property: The name of a component inside the product which generated the alert. - * - * @return the productComponentName value. - */ - String productComponentName(); - - /** - * Gets the vendorName property: The name of the vendor that raise the alert. - * - * @return the vendorName value. - */ - String vendorName(); - - /** - * Gets the intent property: Kill chain related intent behind the alert. Could contain multiple enum values - * (separated by commas). - * - * @return the intent value. - */ - AlertIntent intent(); - - /** - * Gets the remediationSteps property: Manual action items to take to remediate the alert. - * - * @return the remediationSteps value. - */ - List remediationSteps(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotAlertTypeInner object. - * - * @return the inner object. - */ - IotAlertTypeInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertTypeList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertTypeList.java deleted file mode 100644 index da62daaa422c8..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertTypeList.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.IotAlertTypeListInner; -import java.util.List; - -/** An immutable client-side representation of IotAlertTypeList. */ -public interface IotAlertTypeList { - /** - * Gets the value property: List data. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotAlertTypeListInner object. - * - * @return the inner object. - */ - IotAlertTypeListInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlerts.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlerts.java deleted file mode 100644 index 66911a0a93f88..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlerts.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.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 IotAlerts. */ -public interface IotAlerts { - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 IoT alerts. - */ - PagedIterable list(String scope); - - /** - * List IoT alerts. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param minStartTimeUtc Filter by minimum startTimeUtc (ISO 8601 format). - * @param maxStartTimeUtc Filter by maximum startTimeUtc (ISO 8601 format). - * @param alertType Filter by alert type. - * @param deviceManagementType Get devices only from specific type, Managed or Unmanaged. - * @param compromisedEntity Filter by compromised device. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 IoT alerts. - */ - PagedIterable list( - String scope, - String minStartTimeUtc, - String maxStartTimeUtc, - String alertType, - ManagementState deviceManagementType, - String compromisedEntity, - Integer limit, - String skipToken, - Context context); - - /** - * Get IoT alert. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotAlertId Id of the alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert. - */ - IotAlertModel get(String scope, String iotAlertId); - - /** - * Get IoT alert. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotAlertId Id of the alert. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT alert. - */ - Response getWithResponse(String scope, String iotAlertId, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettings.java deleted file mode 100644 index 3d65b1674e48b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettings.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (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.http.rest.StreamResponse; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsModelInner; -import java.io.InputStream; - -/** Resource collection API of IotDefenderSettings. */ -public interface IotDefenderSettings { - /** - * List IoT Defender Settings. - * - * @throws com.azure.core.management.exception.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 IoT Defender settings. - */ - IotDefenderSettingsList list(); - - /** - * List IoT Defender 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 list of IoT Defender settings. - */ - Response listWithResponse(Context context); - - /** - * Get IoT Defender Settings. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender Settings. - */ - IotDefenderSettingsModel get(); - - /** - * Get IoT Defender 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 ioT Defender Settings. - */ - Response getWithResponse(Context context); - - /** - * Create or update IoT Defender settings. - * - * @param iotDefenderSettingsModel The IoT defender settings model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender settings. - */ - IotDefenderSettingsModel createOrUpdate(IotDefenderSettingsModelInner iotDefenderSettingsModel); - - /** - * Create or update IoT Defender settings. - * - * @param iotDefenderSettingsModel The IoT defender settings model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Defender settings. - */ - Response createOrUpdateWithResponse( - IotDefenderSettingsModelInner iotDefenderSettingsModel, Context context); - - /** - * Delete IoT Defender settings. - * - * @throws com.azure.core.management.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(); - - /** - * Delete IoT Defender 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 response. - */ - Response deleteWithResponse(Context context); - - /** - * Information about downloadable packages. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about package downloads. - */ - PackageDownloads packageDownloads(); - - /** - * Information about downloadable packages. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about package downloads. - */ - Response packageDownloadsWithResponse(Context context); - - /** - * Download manager activation data defined for this 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 the response. - */ - InputStream downloadManagerActivation(); - - /** - * Download manager activation data defined for this 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 the response. - */ - StreamResponse downloadManagerActivationWithResponse(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettingsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettingsList.java deleted file mode 100644 index 5c6269219dfbc..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettingsList.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.IotDefenderSettingsListInner; -import java.util.List; - -/** An immutable client-side representation of IotDefenderSettingsList. */ -public interface IotDefenderSettingsList { - /** - * Gets the value property: List data. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsListInner object. - * - * @return the inner object. - */ - IotDefenderSettingsListInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettingsModel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettingsModel.java deleted file mode 100644 index 0ea1211c20223..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotDefenderSettingsModel.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.models; - -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsModelInner; -import java.time.OffsetDateTime; -import java.util.List; - -/** An immutable client-side representation of IotDefenderSettingsModel. */ -public interface IotDefenderSettingsModel { - /** - * 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 deviceQuota property: Size of the device quota (as a opposed to a Pay as You Go billing model). Value is - * required to be in multiples of 1000. - * - * @return the deviceQuota value. - */ - Integer deviceQuota(); - - /** - * Gets the sentinelWorkspaceResourceIds property: Sentinel Workspace Resource Ids. - * - * @return the sentinelWorkspaceResourceIds value. - */ - List sentinelWorkspaceResourceIds(); - - /** - * Gets the onboardingKind property: The kind of onboarding for the subscription. - * - * @return the onboardingKind value. - */ - OnboardingKind onboardingKind(); - - /** - * Gets the evaluationEndTime property: End time of the evaluation period, if such exist. - * - * @return the evaluationEndTime value. - */ - OffsetDateTime evaluationEndTime(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsModelInner object. - * - * @return the inner object. - */ - IotDefenderSettingsModelInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationListModel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationListModel.java deleted file mode 100644 index d4120658d8756..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationListModel.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.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.IotRecommendationModelInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of IoT recommendations. */ -@Immutable -public final class IotRecommendationListModel { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IotRecommendationListModel.class); - - /* - * List data - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * When available, follow the URI to get the next page of data - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: List data. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: When available, follow the URI to get the next page of data. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationModel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationModel.java deleted file mode 100644 index b9d958d5f5b78..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationModel.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.models; - -import com.azure.resourcemanager.security.fluent.models.IotRecommendationModelInner; - -/** An immutable client-side representation of IotRecommendationModel. */ -public interface IotRecommendationModel { - /** - * 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 deviceId property: Identifier of the device being reported on. - * - * @return the deviceId value. - */ - String deviceId(); - - /** - * Gets the recommendationType property: The type name of the recommendation. - * - * @return the recommendationType value. - */ - String recommendationType(); - - /** - * Gets the discoveredTimeUtc property: The discovery time of the recommendation. - * - * @return the discoveredTimeUtc value. - */ - String discoveredTimeUtc(); - - /** - * Gets the recommendationAdditionalData property: A bag of fields which extends the recommendation information. - * - * @return the recommendationAdditionalData value. - */ - Object recommendationAdditionalData(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotRecommendationModelInner object. - * - * @return the inner object. - */ - IotRecommendationModelInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationType.java deleted file mode 100644 index 62d8be131c2d3..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationType.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (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.IotRecommendationTypeInner; -import java.util.List; - -/** An immutable client-side representation of IotRecommendationType. */ -public interface IotRecommendationType { - /** - * 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 recommendationDisplayName property: The display name of the recommendation. - * - * @return the recommendationDisplayName value. - */ - String recommendationDisplayName(); - - /** - * Gets the severity property: The severity of the recommendation. - * - * @return the severity value. - */ - RecommendationSeverity severity(); - - /** - * Gets the description property: Description of the suspected vulnerability and meaning. - * - * @return the description value. - */ - String description(); - - /** - * Gets the productName property: The name of the product which published this recommendation. - * - * @return the productName value. - */ - String productName(); - - /** - * Gets the productComponentName property: The name of a component inside the product which generated the - * recommendation. - * - * @return the productComponentName value. - */ - String productComponentName(); - - /** - * Gets the vendorName property: The name of the vendor that raised the recommendation. - * - * @return the vendorName value. - */ - String vendorName(); - - /** - * Gets the control property: The name of the recommendation's control category. - * - * @return the control value. - */ - String control(); - - /** - * Gets the remediationSteps property: Manual action items to take to resolve the recommendation. - * - * @return the remediationSteps value. - */ - List remediationSteps(); - - /** - * Gets the dataSource property: The alert's data source. - * - * @return the dataSource value. - */ - String dataSource(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeInner object. - * - * @return the inner object. - */ - IotRecommendationTypeInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationTypeList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationTypeList.java deleted file mode 100644 index 40e74c69e017c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationTypeList.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.IotRecommendationTypeListInner; -import java.util.List; - -/** An immutable client-side representation of IotRecommendationTypeList. */ -public interface IotRecommendationTypeList { - /** - * Gets the value property: List data. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotRecommendationTypeListInner object. - * - * @return the inner object. - */ - IotRecommendationTypeListInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationTypes.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationTypes.java deleted file mode 100644 index e0fb570ca48ce..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendationTypes.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.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of IotRecommendationTypes. */ -public interface IotRecommendationTypes { - /** - * List IoT recommendation types. - * - * @throws com.azure.core.management.exception.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 recommendation types. - */ - IotRecommendationTypeList list(); - - /** - * List IoT recommendation types. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 recommendation types. - */ - Response listWithResponse(Context context); - - /** - * Get IoT recommendation type. - * - * @param iotRecommendationTypeName Name of the recommendation 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 ioT recommendation type. - */ - IotRecommendationType get(String iotRecommendationTypeName); - - /** - * Get IoT recommendation type. - * - * @param iotRecommendationTypeName Name of the recommendation 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 ioT recommendation type. - */ - Response getWithResponse(String iotRecommendationTypeName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendations.java deleted file mode 100644 index f0769d010d28f..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotRecommendations.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.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 IotRecommendations. */ -public interface IotRecommendations { - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 IoT recommendations. - */ - PagedIterable list(String scope); - - /** - * List IoT recommendations. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param recommendationType Filter by recommendation type. - * @param deviceId Filter by device id. - * @param limit Limit the number of items returned in a single page. - * @param skipToken Skip token used for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 IoT recommendations. - */ - PagedIterable list( - String scope, String recommendationType, String deviceId, Integer limit, String skipToken, Context context); - - /** - * Get IoT recommendation. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotRecommendationId Id of the recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation. - */ - IotRecommendationModel get(String scope, String iotRecommendationId); - - /** - * Get IoT recommendation. - * - * @param scope Scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}). - * @param iotRecommendationId Id of the recommendation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT recommendation. - */ - Response getWithResponse(String scope, String iotRecommendationId, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensors.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensors.java deleted file mode 100644 index 917b57deb6b43..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensors.java +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (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.http.rest.StreamResponse; -import com.azure.core.util.Context; -import java.io.InputStream; - -/** Resource collection API of IotSensors. */ -public interface IotSensors { - /** - * List IoT sensors. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 IoT sensors. - */ - IotSensorsList list(String scope); - - /** - * List IoT sensors. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 IoT sensors. - */ - Response listWithResponse(String scope, Context context); - - /** - * Get IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor. - */ - IotSensorsModel get(String scope, String iotSensorName); - - /** - * Get IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT sensor. - */ - Response getWithResponse(String scope, String iotSensorName, Context context); - - /** - * Delete IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String scope, String iotSensorName); - - /** - * Delete IoT sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - Response deleteWithResponse(String scope, String iotSensorName, Context context); - - /** - * Download sensor activation file. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - InputStream downloadActivation(String scope, String iotSensorName); - - /** - * Download sensor activation file. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - StreamResponse downloadActivationWithResponse(String scope, String iotSensorName, Context context); - - /** - * Download file for reset password of the sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param body The reset password input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - InputStream downloadResetPassword(String scope, String iotSensorName, ResetPasswordInput body); - - /** - * Download file for reset password of the sensor. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param body The reset password input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - StreamResponse downloadResetPasswordWithResponse( - String scope, String iotSensorName, ResetPasswordInput body, Context context); - - /** - * Trigger threat intelligence package update. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 triggerTiPackageUpdate(String scope, String iotSensorName); - - /** - * Trigger threat intelligence package update. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSensorName Name of the IoT sensor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - Response triggerTiPackageUpdateWithResponse(String scope, String iotSensorName, Context context); - - /** - * Get IoT sensor. - * - * @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 ioT sensor. - */ - IotSensorsModel getById(String id); - - /** - * Get IoT sensor. - * - * @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 ioT sensor. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete IoT sensor. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete IoT sensor. - * - * @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 response. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new IotSensorsModel resource. - * - * @param name resource name. - * @return the first stage of the new IotSensorsModel definition. - */ - IotSensorsModel.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensorsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensorsList.java deleted file mode 100644 index 90434ffaf7d64..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensorsList.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.IotSensorsListInner; -import java.util.List; - -/** An immutable client-side representation of IotSensorsList. */ -public interface IotSensorsList { - /** - * Gets the value property: List data. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotSensorsListInner object. - * - * @return the inner object. - */ - IotSensorsListInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensorsModel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensorsModel.java deleted file mode 100644 index 866e912fe7f1a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensorsModel.java +++ /dev/null @@ -1,325 +0,0 @@ -// Copyright (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.http.rest.StreamResponse; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IotSensorsModelInner; -import java.io.InputStream; - -/** An immutable client-side representation of IotSensorsModel. */ -public interface IotSensorsModel { - /** - * 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 connectivityTime property: Last connectivity time of the IoT sensor. - * - * @return the connectivityTime value. - */ - String connectivityTime(); - - /** - * Gets the creationTime property: Creation time of the IoT sensor. - * - * @return the creationTime value. - */ - String creationTime(); - - /** - * Gets the dynamicLearning property: Dynamic mode status of the IoT sensor. - * - * @return the dynamicLearning value. - */ - Boolean dynamicLearning(); - - /** - * Gets the learningMode property: Learning mode status of the IoT sensor. - * - * @return the learningMode value. - */ - Boolean learningMode(); - - /** - * Gets the sensorStatus property: Status of the IoT sensor. - * - * @return the sensorStatus value. - */ - SensorStatus sensorStatus(); - - /** - * Gets the sensorVersion property: Version of the IoT sensor. - * - * @return the sensorVersion value. - */ - String sensorVersion(); - - /** - * Gets the tiAutomaticUpdates property: TI Automatic mode status of the IoT sensor. - * - * @return the tiAutomaticUpdates value. - */ - Boolean tiAutomaticUpdates(); - - /** - * Gets the tiStatus property: TI Status of the IoT sensor. - * - * @return the tiStatus value. - */ - TiStatus tiStatus(); - - /** - * Gets the tiVersion property: TI Version of the IoT sensor. - * - * @return the tiVersion value. - */ - String tiVersion(); - - /** - * Gets the zone property: Zone of the IoT sensor. - * - * @return the zone value. - */ - String zone(); - - /** - * Gets the sensorType property: Type of sensor. - * - * @return the sensorType value. - */ - SensorType sensorType(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotSensorsModelInner object. - * - * @return the inner object. - */ - IotSensorsModelInner innerModel(); - - /** The entirety of the IotSensorsModel definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { - } - /** The IotSensorsModel definition stages. */ - interface DefinitionStages { - /** The first stage of the IotSensorsModel definition. */ - interface Blank extends WithScope { - } - /** The stage of the IotSensorsModel definition allowing to specify parent resource. */ - interface WithScope { - /** - * Specifies scope. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @return the next definition stage. - */ - WithCreate withExistingScope(String scope); - } - /** - * The stage of the IotSensorsModel 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.WithTiAutomaticUpdates, - DefinitionStages.WithZone, - DefinitionStages.WithSensorType { - /** - * Executes the create request. - * - * @return the created resource. - */ - IotSensorsModel create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - IotSensorsModel create(Context context); - } - /** The stage of the IotSensorsModel definition allowing to specify tiAutomaticUpdates. */ - interface WithTiAutomaticUpdates { - /** - * Specifies the tiAutomaticUpdates property: TI Automatic mode status of the IoT sensor. - * - * @param tiAutomaticUpdates TI Automatic mode status of the IoT sensor. - * @return the next definition stage. - */ - WithCreate withTiAutomaticUpdates(Boolean tiAutomaticUpdates); - } - /** The stage of the IotSensorsModel definition allowing to specify zone. */ - interface WithZone { - /** - * Specifies the zone property: Zone of the IoT sensor. - * - * @param zone Zone of the IoT sensor. - * @return the next definition stage. - */ - WithCreate withZone(String zone); - } - /** The stage of the IotSensorsModel definition allowing to specify sensorType. */ - interface WithSensorType { - /** - * Specifies the sensorType property: Type of sensor. - * - * @param sensorType Type of sensor. - * @return the next definition stage. - */ - WithCreate withSensorType(SensorType sensorType); - } - } - /** - * Begins update for the IotSensorsModel resource. - * - * @return the stage of resource update. - */ - IotSensorsModel.Update update(); - - /** The template for IotSensorsModel update. */ - interface Update extends UpdateStages.WithTiAutomaticUpdates, UpdateStages.WithZone, UpdateStages.WithSensorType { - /** - * Executes the update request. - * - * @return the updated resource. - */ - IotSensorsModel apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - IotSensorsModel apply(Context context); - } - /** The IotSensorsModel update stages. */ - interface UpdateStages { - /** The stage of the IotSensorsModel update allowing to specify tiAutomaticUpdates. */ - interface WithTiAutomaticUpdates { - /** - * Specifies the tiAutomaticUpdates property: TI Automatic mode status of the IoT sensor. - * - * @param tiAutomaticUpdates TI Automatic mode status of the IoT sensor. - * @return the next definition stage. - */ - Update withTiAutomaticUpdates(Boolean tiAutomaticUpdates); - } - /** The stage of the IotSensorsModel update allowing to specify zone. */ - interface WithZone { - /** - * Specifies the zone property: Zone of the IoT sensor. - * - * @param zone Zone of the IoT sensor. - * @return the next definition stage. - */ - Update withZone(String zone); - } - /** The stage of the IotSensorsModel update allowing to specify sensorType. */ - interface WithSensorType { - /** - * Specifies the sensorType property: Type of sensor. - * - * @param sensorType Type of sensor. - * @return the next definition stage. - */ - Update withSensorType(SensorType sensorType); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - IotSensorsModel refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - IotSensorsModel refresh(Context context); - - /** - * Download sensor activation file. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - InputStream downloadActivation(); - - /** - * Download sensor activation file. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - StreamResponse downloadActivationWithResponse(Context context); - - /** - * Download file for reset password of the sensor. - * - * @param body The reset password input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - InputStream downloadResetPassword(ResetPasswordInput body); - - /** - * Download file for reset password of the sensor. - * - * @param body The reset password input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - StreamResponse downloadResetPasswordWithResponse(ResetPasswordInput body, Context context); - - /** - * Trigger threat intelligence package update. - * - * @throws com.azure.core.management.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 triggerTiPackageUpdate(); - - /** - * Trigger threat intelligence package 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 the response. - */ - Response triggerTiPackageUpdateWithResponse(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSites.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSites.java deleted file mode 100644 index e2328a0f13a4d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSites.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (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.IotSitesModelInner; - -/** Resource collection API of IotSites. */ -public interface IotSites { - /** - * List IoT sites. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 IoT sites. - */ - IotSitesList list(String scope); - - /** - * List IoT sites. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 IoT sites. - */ - Response listWithResponse(String scope, Context context); - - /** - * Get IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site. - */ - IotSitesModel get(String scope); - - /** - * Get IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site. - */ - Response getWithResponse(String scope, Context context); - - /** - * Create or update IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSitesModel The IoT sites model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site model. - */ - IotSitesModel createOrUpdate(String scope, IotSitesModelInner iotSitesModel); - - /** - * Create or update IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param iotSitesModel The IoT sites model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT site model. - */ - Response createOrUpdateWithResponse(String scope, IotSitesModelInner iotSitesModel, Context context); - - /** - * Delete IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 scope); - - /** - * Delete IoT site. - * - * @param scope Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - Response deleteWithResponse(String scope, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSitesList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSitesList.java deleted file mode 100644 index f21b8fa269034..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSitesList.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.IotSitesListInner; -import java.util.List; - -/** An immutable client-side representation of IotSitesList. */ -public interface IotSitesList { - /** - * Gets the value property: List data. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotSitesListInner object. - * - * @return the inner object. - */ - IotSitesListInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSitesModel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSitesModel.java deleted file mode 100644 index 395e7a66b7479..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSitesModel.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.resourcemanager.security.fluent.models.IotSitesModelInner; -import java.util.Map; - -/** An immutable client-side representation of IotSitesModel. */ -public interface IotSitesModel { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the displayName property: Display name of the IoT site. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the tags property: Tags of the IoT site. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IotSitesModelInner object. - * - * @return the inner object. - */ - IotSitesModelInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IpAddress.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IpAddress.java deleted file mode 100644 index c784e22160186..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IpAddress.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.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** IP Address information. */ -@Immutable -public final class IpAddress { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IpAddress.class); - - /* - * IPV4 address - */ - @JsonProperty(value = "v4Address", access = JsonProperty.Access.WRITE_ONLY) - private String v4Address; - - /* - * Detection time of the ip address. - */ - @JsonProperty(value = "detectionTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime detectionTime; - - /* - * Subnet Classless Inter-Domain Routing - */ - @JsonProperty(value = "subnetCidr", access = JsonProperty.Access.WRITE_ONLY) - private String subnetCidr; - - /* - * Fully qualified domain name - */ - @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) - private String fqdn; - - /* - * FQDN last lookup time. - */ - @JsonProperty(value = "fqdnLastLookupTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime fqdnLastLookupTime; - - /** - * Get the v4Address property: IPV4 address. - * - * @return the v4Address value. - */ - public String v4Address() { - return this.v4Address; - } - - /** - * Get the detectionTime property: Detection time of the ip address. - * - * @return the detectionTime value. - */ - public OffsetDateTime detectionTime() { - return this.detectionTime; - } - - /** - * Get the subnetCidr property: Subnet Classless Inter-Domain Routing. - * - * @return the subnetCidr value. - */ - public String subnetCidr() { - return this.subnetCidr; - } - - /** - * Get the fqdn property: Fully qualified domain name. - * - * @return the fqdn value. - */ - public String fqdn() { - return this.fqdn; - } - - /** - * Get the fqdnLastLookupTime property: FQDN last lookup time. - * - * @return the fqdnLastLookupTime value. - */ - public OffsetDateTime fqdnLastLookupTime() { - return this.fqdnLastLookupTime; - } - - /** - * 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/JitNetworkAccessPolicy.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicy.java index 9c165a64bb438..46c976546391c 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 @@ -33,6 +33,20 @@ public interface JitNetworkAccessPolicy { */ String type(); + /** + * Gets the kind property: Kind of the resource. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the location property: Location where the resource is stored. + * + * @return the location value. + */ + String location(); + /** * Gets the virtualMachines property: Configurations for Microsoft.Compute/virtualMachines resource type. * @@ -54,20 +68,6 @@ public interface JitNetworkAccessPolicy { */ String provisioningState(); - /** - * Gets the kind property: Kind of the resource. - * - * @return the kind value. - */ - String kind(); - - /** - * Gets the location property: Location where the resource is stored. - * - * @return the location value. - */ - String location(); - /** * Gets the region of the resource. * @@ -129,7 +129,7 @@ interface WithVirtualMachines { * 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. */ - interface WithCreate extends DefinitionStages.WithRequests, DefinitionStages.WithKind { + interface WithCreate extends DefinitionStages.WithKind, DefinitionStages.WithRequests { /** * Executes the create request. * @@ -145,16 +145,6 @@ interface WithCreate extends DefinitionStages.WithRequests, DefinitionStages.Wit */ JitNetworkAccessPolicy create(Context context); } - /** The stage of the JitNetworkAccessPolicy definition allowing to specify requests. */ - interface WithRequests { - /** - * Specifies the requests property: The requests property.. - * - * @param requests The requests property. - * @return the next definition stage. - */ - WithCreate withRequests(List requests); - } /** The stage of the JitNetworkAccessPolicy definition allowing to specify kind. */ interface WithKind { /** @@ -165,6 +155,16 @@ interface WithKind { */ WithCreate withKind(String kind); } + /** The stage of the JitNetworkAccessPolicy definition allowing to specify requests. */ + interface WithRequests { + /** + * Specifies the requests property: The requests property.. + * + * @param requests The requests property. + * @return the next definition stage. + */ + WithCreate withRequests(List requests); + } } /** * Begins update for the JitNetworkAccessPolicy resource. @@ -174,7 +174,7 @@ interface WithKind { JitNetworkAccessPolicy.Update update(); /** The template for JitNetworkAccessPolicy update. */ - interface Update extends UpdateStages.WithVirtualMachines, UpdateStages.WithRequests, UpdateStages.WithKind { + interface Update extends UpdateStages.WithKind, UpdateStages.WithVirtualMachines, UpdateStages.WithRequests { /** * Executes the update request. * @@ -192,6 +192,16 @@ interface Update extends UpdateStages.WithVirtualMachines, UpdateStages.WithRequ } /** The JitNetworkAccessPolicy update stages. */ interface UpdateStages { + /** The stage of the JitNetworkAccessPolicy update allowing to specify kind. */ + interface WithKind { + /** + * Specifies the kind property: Kind of the resource. + * + * @param kind Kind of the resource. + * @return the next definition stage. + */ + Update withKind(String kind); + } /** The stage of the JitNetworkAccessPolicy update allowing to specify virtualMachines. */ interface WithVirtualMachines { /** @@ -213,16 +223,6 @@ interface WithRequests { */ Update withRequests(List requests); } - /** The stage of the JitNetworkAccessPolicy update allowing to specify kind. */ - interface WithKind { - /** - * Specifies the kind property: Kind of the resource. - * - * @param kind Kind of the resource. - * @return the next definition stage. - */ - Update withKind(String kind); - } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPortRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPortRule.java index 37ef46d6e1e96..9b43e6ac7a280 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPortRule.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPortRule.java @@ -25,7 +25,7 @@ public final class JitNetworkAccessPortRule { * The protocol property. */ @JsonProperty(value = "protocol", required = true) - private ProtocolValue protocol; + private Protocol protocol; /* * Mutually exclusive with the "allowedSourceAddressPrefixes" parameter. @@ -73,7 +73,7 @@ public JitNetworkAccessPortRule withNumber(int number) { * * @return the protocol value. */ - public ProtocolValue protocol() { + public Protocol protocol() { return this.protocol; } @@ -83,7 +83,7 @@ public ProtocolValue protocol() { * @param protocol the protocol value to set. * @return the JitNetworkAccessPortRule object itself. */ - public JitNetworkAccessPortRule withProtocol(ProtocolValue protocol) { + public JitNetworkAccessPortRule withProtocol(Protocol protocol) { this.protocol = protocol; return this; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Kind.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Kind.java index 6ffd19d58f039..4feac3222986f 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Kind.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Kind.java @@ -4,47 +4,28 @@ package com.azure.resourcemanager.security.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; -/** Describes an Azure resource with kind. */ -@Fluent -public class Kind { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Kind.class); - - /* - * Kind of the resource - */ - @JsonProperty(value = "kind") - private String kind; - - /** - * Get the kind property: Kind of the resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } +/** Defines values for Kind. */ +public final class Kind extends ExpandableStringEnum { + /** Static value Bundles for Kind. */ + public static final Kind BUNDLES = fromString("Bundles"); /** - * Set the kind property: Kind of the resource. + * Creates or finds a Kind from its string representation. * - * @param kind the kind value to set. - * @return the Kind object itself. + * @param name a name to look for. + * @return the corresponding Kind. */ - public Kind withKind(String kind) { - this.kind = kind; - return this; + @JsonCreator + public static Kind fromString(String name) { + return fromString(name, Kind.class); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { + /** @return known Kind values. */ + public static Collection values() { + return values(Kind.class); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResetPasswordInput.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/KindAutoGenerated.java similarity index 52% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResetPasswordInput.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/KindAutoGenerated.java index f2cab92fffb67..9b35831558a85 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResetPasswordInput.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/KindAutoGenerated.java @@ -9,34 +9,34 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Reset password input. */ +/** Describes an Azure resource with kind. */ @Fluent -public final class ResetPasswordInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResetPasswordInput.class); +public class KindAutoGenerated { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KindAutoGenerated.class); /* - * The appliance id of the sensor. + * Kind of the resource */ - @JsonProperty(value = "applianceId") - private String applianceId; + @JsonProperty(value = "kind") + private String kind; /** - * Get the applianceId property: The appliance id of the sensor. + * Get the kind property: Kind of the resource. * - * @return the applianceId value. + * @return the kind value. */ - public String applianceId() { - return this.applianceId; + public String kind() { + return this.kind; } /** - * Set the applianceId property: The appliance id of the sensor. + * Set the kind property: Kind of the resource. * - * @param applianceId the applianceId value to set. - * @return the ResetPasswordInput object itself. + * @param kind the kind value to set. + * @return the KindAutoGenerated object itself. */ - public ResetPasswordInput withApplianceId(String applianceId) { - this.applianceId = applianceId; + public KindAutoGenerated withKind(String kind) { + this.kind = kind; return this; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/KindValue.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/KindValue.java deleted file mode 100644 index e8b8cda66147e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/KindValue.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for KindValue. */ -public final class KindValue extends ExpandableStringEnum { - /** Static value Bundles for KindValue. */ - public static final KindValue BUNDLES = fromString("Bundles"); - - /** - * Creates or finds a KindValue from its string representation. - * - * @param name a name to look for. - * @return the corresponding KindValue. - */ - @JsonCreator - public static KindValue fromString(String name) { - return fromString(name, KindValue.class); - } - - /** @return known KindValue values. */ - public static Collection values() { - return values(KindValue.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MacAddress.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MacAddress.java deleted file mode 100644 index 037adcaea6028..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MacAddress.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.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** MAC Address information. */ -@Immutable -public final class MacAddress { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MacAddress.class); - - /* - * MAC address - */ - @JsonProperty(value = "address", access = JsonProperty.Access.WRITE_ONLY) - private String address; - - /* - * Detection time of the mac address. - */ - @JsonProperty(value = "detectionTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime detectionTime; - - /* - * Indicates whether this is the primary secondary MAC address of the - * device - */ - @JsonProperty(value = "significance", access = JsonProperty.Access.WRITE_ONLY) - private MacSignificance significance; - - /* - * Indicates whether the relation of the mac to the ip address is certain - * or a guess - */ - @JsonProperty(value = "relationToIpStatus", access = JsonProperty.Access.WRITE_ONLY) - private RelationToIpStatus relationToIpStatus; - - /** - * Get the address property: MAC address. - * - * @return the address value. - */ - public String address() { - return this.address; - } - - /** - * Get the detectionTime property: Detection time of the mac address. - * - * @return the detectionTime value. - */ - public OffsetDateTime detectionTime() { - return this.detectionTime; - } - - /** - * Get the significance property: Indicates whether this is the primary secondary MAC address of the device. - * - * @return the significance value. - */ - public MacSignificance significance() { - return this.significance; - } - - /** - * Get the relationToIpStatus property: Indicates whether the relation of the mac to the ip address is certain or a - * guess. - * - * @return the relationToIpStatus value. - */ - public RelationToIpStatus relationToIpStatus() { - return this.relationToIpStatus; - } - - /** - * 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/MacSignificance.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MacSignificance.java deleted file mode 100644 index 9c3aebd6eb0a6..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MacSignificance.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for MacSignificance. */ -public final class MacSignificance extends ExpandableStringEnum { - /** Static value Primary for MacSignificance. */ - public static final MacSignificance PRIMARY = fromString("Primary"); - - /** Static value Secondary for MacSignificance. */ - public static final MacSignificance SECONDARY = fromString("Secondary"); - - /** - * Creates or finds a MacSignificance from its string representation. - * - * @param name a name to look for. - * @return the corresponding MacSignificance. - */ - @JsonCreator - public static MacSignificance fromString(String name) { - return fromString(name, MacSignificance.class); - } - - /** @return known MacSignificance values. */ - public static Collection values() { - return values(MacSignificance.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementState.java deleted file mode 100644 index eb5b3508b35e3..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementState.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ManagementState. */ -public final class ManagementState extends ExpandableStringEnum { - /** Static value Managed for ManagementState. */ - public static final ManagementState MANAGED = fromString("Managed"); - - /** Static value Unmanaged for ManagementState. */ - public static final ManagementState UNMANAGED = fromString("Unmanaged"); - - /** - * Creates or finds a ManagementState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ManagementState. - */ - @JsonCreator - public static ManagementState fromString(String name) { - return fromString(name, ManagementState.class); - } - - /** @return known ManagementState values. */ - public static Collection values() { - return values(ManagementState.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardingData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardingData.java new file mode 100644 index 0000000000000..aaf2ad806a5d8 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardingData.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.models; + +import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner; + +/** An immutable client-side representation of MdeOnboardingData. */ +public interface MdeOnboardingData { + /** + * 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 onboardingPackageWindows property: The onboarding package used to onboard Windows machines to MDE, coded + * in base64. This can also be used for onboarding using the dedicated VM Extension. + * + * @return the onboardingPackageWindows value. + */ + byte[] onboardingPackageWindows(); + + /** + * Gets the onboardingPackageLinux property: The onboarding package used to onboard Linux machines to MDE, coded in + * base64. This can also be used for onboarding using the dedicated VM Extension. + * + * @return the onboardingPackageLinux value. + */ + byte[] onboardingPackageLinux(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner object. + * + * @return the inner object. + */ + MdeOnboardingDataInner innerModel(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardingDataList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardingDataList.java new file mode 100644 index 0000000000000..63e838ea6d16b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardingDataList.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.MdeOnboardingDataListInner; +import java.util.List; + +/** An immutable client-side representation of MdeOnboardingDataList. */ +public interface MdeOnboardingDataList { + /** + * Gets the value property: List of the resources of the configuration or data needed to onboard the machine to MDE. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataListInner object. + * + * @return the inner object. + */ + MdeOnboardingDataListInner innerModel(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertTypes.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardings.java similarity index 63% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertTypes.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardings.java index a7a8ee28a7d60..4c724e5ec08b6 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotAlertTypes.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardings.java @@ -7,48 +7,45 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of IotAlertTypes. */ -public interface IotAlertTypes { +/** Resource collection API of MdeOnboardings. */ +public interface MdeOnboardings { /** - * List IoT alert types. + * The configuration or data needed to onboard the machine to MDE. * * @throws com.azure.core.management.exception.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 alert types. + * @return list of all MDE onboarding data resources. */ - IotAlertTypeList list(); + MdeOnboardingDataList list(); /** - * List IoT alert types. + * The configuration or data needed to onboard the machine to MDE. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 alert types. + * @return list of all MDE onboarding data resources. */ - Response listWithResponse(Context context); + Response listWithResponse(Context context); /** - * Get IoT alert type. + * The default configuration or data needed to onboard the machine to MDE. * - * @param iotAlertTypeName Name of the alert 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 ioT alert type. + * @return the resource of the configuration or data needed to onboard the machine to MDE. */ - IotAlertType get(String iotAlertTypeName); + MdeOnboardingData get(); /** - * Get IoT alert type. + * The default configuration or data needed to onboard the machine to MDE. * - * @param iotAlertTypeName Name of the alert 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 ioT alert type. + * @return the resource of the configuration or data needed to onboard the machine to MDE. */ - Response getWithResponse(String iotAlertTypeName, Context context); + Response getWithResponse(Context context); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/NetworkInterface.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/NetworkInterface.java deleted file mode 100644 index 6670a53f57fe5..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/NetworkInterface.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (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.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Network interface. */ -@Fluent -public final class NetworkInterface { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterface.class); - - /* - * IP Address information - */ - @JsonProperty(value = "ipAddress") - private IpAddress ipAddress; - - /* - * MAC Address information - */ - @JsonProperty(value = "macAddress") - private MacAddress macAddress; - - /* - * List of device vlans. - */ - @JsonProperty(value = "vlans", access = JsonProperty.Access.WRITE_ONLY) - private List vlans; - - /** - * Get the ipAddress property: IP Address information. - * - * @return the ipAddress value. - */ - public IpAddress ipAddress() { - return this.ipAddress; - } - - /** - * Set the ipAddress property: IP Address information. - * - * @param ipAddress the ipAddress value to set. - * @return the NetworkInterface object itself. - */ - public NetworkInterface withIpAddress(IpAddress ipAddress) { - this.ipAddress = ipAddress; - return this; - } - - /** - * Get the macAddress property: MAC Address information. - * - * @return the macAddress value. - */ - public MacAddress macAddress() { - return this.macAddress; - } - - /** - * Set the macAddress property: MAC Address information. - * - * @param macAddress the macAddress value to set. - * @return the NetworkInterface object itself. - */ - public NetworkInterface withMacAddress(MacAddress macAddress) { - this.macAddress = macAddress; - return this; - } - - /** - * Get the vlans property: List of device vlans. - * - * @return the vlans value. - */ - public List vlans() { - return this.vlans; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ipAddress() != null) { - ipAddress().validate(); - } - if (macAddress() != null) { - macAddress().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OfferingType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OfferingType.java new file mode 100644 index 0000000000000..a55b678576abb --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OfferingType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OfferingType. */ +public final class OfferingType extends ExpandableStringEnum { + /** Static value CspmMonitorAws for OfferingType. */ + public static final OfferingType CSPM_MONITOR_AWS = fromString("CspmMonitorAws"); + + /** Static value DefenderForContainersAws for OfferingType. */ + public static final OfferingType DEFENDER_FOR_CONTAINERS_AWS = fromString("DefenderForContainersAws"); + + /** Static value DefenderForServersAws for OfferingType. */ + public static final OfferingType DEFENDER_FOR_SERVERS_AWS = fromString("DefenderForServersAws"); + + /** + * Creates or finds a OfferingType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OfferingType. + */ + @JsonCreator + public static OfferingType fromString(String name) { + return fromString(name, OfferingType.class); + } + + /** @return known OfferingType values. */ + public static Collection values() { + return values(OfferingType.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseIotSensor.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseIotSensor.java deleted file mode 100644 index 235c298fe0ee0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseIotSensor.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.models; - -import com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorInner; - -/** An immutable client-side representation of OnPremiseIotSensor. */ -public interface OnPremiseIotSensor { - /** - * 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: On-premise IoT sensor properties. - * - * @return the properties value. - */ - Object properties(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorInner object. - * - * @return the inner object. - */ - OnPremiseIotSensorInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseIotSensorsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseIotSensorsList.java deleted file mode 100644 index 4df50b2a05211..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseIotSensorsList.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.OnPremiseIotSensorsListInner; -import java.util.List; - -/** An immutable client-side representation of OnPremiseIotSensorsList. */ -public interface OnPremiseIotSensorsList { - /** - * Gets the value property: List data. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.OnPremiseIotSensorsListInner object. - * - * @return the inner object. - */ - OnPremiseIotSensorsListInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnboardingKind.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnboardingKind.java deleted file mode 100644 index c055259f0cf19..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnboardingKind.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for OnboardingKind. */ -public final class OnboardingKind extends ExpandableStringEnum { - /** Static value Default for OnboardingKind. */ - public static final OnboardingKind DEFAULT = fromString("Default"); - - /** Static value MigratedToAzure for OnboardingKind. */ - public static final OnboardingKind MIGRATED_TO_AZURE = fromString("MigratedToAzure"); - - /** Static value Evaluation for OnboardingKind. */ - public static final OnboardingKind EVALUATION = fromString("Evaluation"); - - /** Static value Purchased for OnboardingKind. */ - public static final OnboardingKind PURCHASED = fromString("Purchased"); - - /** - * Creates or finds a OnboardingKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding OnboardingKind. - */ - @JsonCreator - public static OnboardingKind fromString(String name) { - return fromString(name, OnboardingKind.class); - } - - /** @return known OnboardingKind values. */ - public static Collection values() { - return values(OnboardingKind.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operations.java index 56b27049d7daf..87da4ff4a2793 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operations.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operations.java @@ -14,7 +14,7 @@ public interface Operations { * * @throws com.azure.core.management.exception.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 possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ PagedIterable list(); @@ -25,7 +25,7 @@ public interface Operations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 possible operations for Microsoft. + * @return list of possible operations for Microsoft.Security resource provider. */ PagedIterable list(Context context); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OrganizationMembershipType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OrganizationMembershipType.java new file mode 100644 index 0000000000000..74fd81b96bd76 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OrganizationMembershipType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OrganizationMembershipType. */ +public final class OrganizationMembershipType extends ExpandableStringEnum { + /** Static value Member for OrganizationMembershipType. */ + public static final OrganizationMembershipType MEMBER = fromString("Member"); + + /** Static value Organization for OrganizationMembershipType. */ + public static final OrganizationMembershipType ORGANIZATION = fromString("Organization"); + + /** + * Creates or finds a OrganizationMembershipType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OrganizationMembershipType. + */ + @JsonCreator + public static OrganizationMembershipType fromString(String name) { + return fromString(name, OrganizationMembershipType.class); + } + + /** @return known OrganizationMembershipType values. */ + public static Collection values() { + return values(OrganizationMembershipType.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadInfo.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadInfo.java deleted file mode 100644 index ea84ae157a646..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadInfo.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.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Information on a specific package download. */ -@Immutable -public class PackageDownloadInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PackageDownloadInfo.class); - - /* - * Version number - */ - @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) - private String version; - - /* - * Download link - */ - @JsonProperty(value = "link", access = JsonProperty.Access.WRITE_ONLY) - private String link; - - /* - * Kind of the version - */ - @JsonProperty(value = "versionKind", access = JsonProperty.Access.WRITE_ONLY) - private VersionKind versionKind; - - /** - * Get the version property: Version number. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Get the link property: Download link. - * - * @return the link value. - */ - public String link() { - return this.link; - } - - /** - * Get the versionKind property: Kind of the version. - * - * @return the versionKind value. - */ - public VersionKind versionKind() { - return this.versionKind; - } - - /** - * 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/PackageDownloads.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloads.java deleted file mode 100644 index f74d259320724..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloads.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.models; - -import com.azure.resourcemanager.security.fluent.models.PackageDownloadsInner; -import java.util.List; - -/** An immutable client-side representation of PackageDownloads. */ -public interface PackageDownloads { - /** - * Gets the sensor property: Contains all Sensor binary downloads. - * - * @return the sensor value. - */ - PackageDownloadsSensor sensor(); - - /** - * Gets the centralManager property: All downloads for Central Manager. - * - * @return the centralManager value. - */ - PackageDownloadsCentralManager centralManager(); - - /** - * Gets the threatIntelligence property: All downloads for threat intelligence. - * - * @return the threatIntelligence value. - */ - List threatIntelligence(); - - /** - * Gets the snmp property: SNMP Server file. - * - * @return the snmp value. - */ - List snmp(); - - /** - * Gets the wmiTool property: Used for local configuration export. - * - * @return the wmiTool value. - */ - List wmiTool(); - - /** - * Gets the authorizedDevicesImportTemplate property: Authorized devices import template. - * - * @return the authorizedDevicesImportTemplate value. - */ - List authorizedDevicesImportTemplate(); - - /** - * Gets the deviceInformationUpdateImportTemplate property: Authorized devices import template. - * - * @return the deviceInformationUpdateImportTemplate value. - */ - List deviceInformationUpdateImportTemplate(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.PackageDownloadsInner object. - * - * @return the inner object. - */ - PackageDownloadsInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManager.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManager.java deleted file mode 100644 index 0a86e9478fec6..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManager.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.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** All downloads for Central Manager. */ -@Immutable -public final class PackageDownloadsCentralManager { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PackageDownloadsCentralManager.class); - - /* - * Contains full package downloads - */ - @JsonProperty(value = "full", access = JsonProperty.Access.WRITE_ONLY) - private PackageDownloadsCentralManagerFull full; - - /* - * Central Manager upgrade package downloads (on existing installations) - */ - @JsonProperty(value = "upgrade", access = JsonProperty.Access.WRITE_ONLY) - private List upgrade; - - /** - * Get the full property: Contains full package downloads. - * - * @return the full value. - */ - public PackageDownloadsCentralManagerFull full() { - return this.full; - } - - /** - * Get the upgrade property: Central Manager upgrade package downloads (on existing installations). - * - * @return the upgrade value. - */ - public List upgrade() { - return this.upgrade; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (full() != null) { - full().validate(); - } - if (upgrade() != null) { - upgrade().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManagerFull.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManagerFull.java deleted file mode 100644 index 523de3fdd59d0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManagerFull.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.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Contains full package downloads. */ -@Immutable -public final class PackageDownloadsCentralManagerFull { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PackageDownloadsCentralManagerFull.class); - - /* - * Contains all ISO full versions of the Central Manager - */ - @JsonProperty(value = "iso", access = JsonProperty.Access.WRITE_ONLY) - private List iso; - - /* - * Contains all OVF (virtual machine) full versions of the Central Manager - */ - @JsonProperty(value = "ovf", access = JsonProperty.Access.WRITE_ONLY) - private PackageDownloadsCentralManagerFullOvf ovf; - - /** - * Get the iso property: Contains all ISO full versions of the Central Manager. - * - * @return the iso value. - */ - public List iso() { - return this.iso; - } - - /** - * Get the ovf property: Contains all OVF (virtual machine) full versions of the Central Manager. - * - * @return the ovf value. - */ - public PackageDownloadsCentralManagerFullOvf ovf() { - return this.ovf; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (iso() != null) { - iso().forEach(e -> e.validate()); - } - if (ovf() != null) { - ovf().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManagerFullOvf.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManagerFullOvf.java deleted file mode 100644 index 662451d2b3867..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsCentralManagerFullOvf.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.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Contains all OVF (virtual machine) full versions of the Central Manager. */ -@Immutable -public final class PackageDownloadsCentralManagerFullOvf { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PackageDownloadsCentralManagerFullOvf.class); - - /* - * The Enterprise package type - */ - @JsonProperty(value = "enterprise", access = JsonProperty.Access.WRITE_ONLY) - private List enterprise; - - /* - * The EnterpriseHighAvailability package type - */ - @JsonProperty(value = "enterpriseHighAvailability", access = JsonProperty.Access.WRITE_ONLY) - private List enterpriseHighAvailability; - - /* - * The Medium package type - */ - @JsonProperty(value = "medium", access = JsonProperty.Access.WRITE_ONLY) - private List medium; - - /* - * The MediumHighAvailability package type - */ - @JsonProperty(value = "mediumHighAvailability", access = JsonProperty.Access.WRITE_ONLY) - private List mediumHighAvailability; - - /** - * Get the enterprise property: The Enterprise package type. - * - * @return the enterprise value. - */ - public List enterprise() { - return this.enterprise; - } - - /** - * Get the enterpriseHighAvailability property: The EnterpriseHighAvailability package type. - * - * @return the enterpriseHighAvailability value. - */ - public List enterpriseHighAvailability() { - return this.enterpriseHighAvailability; - } - - /** - * Get the medium property: The Medium package type. - * - * @return the medium value. - */ - public List medium() { - return this.medium; - } - - /** - * Get the mediumHighAvailability property: The MediumHighAvailability package type. - * - * @return the mediumHighAvailability value. - */ - public List mediumHighAvailability() { - return this.mediumHighAvailability; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (enterprise() != null) { - enterprise().forEach(e -> e.validate()); - } - if (enterpriseHighAvailability() != null) { - enterpriseHighAvailability().forEach(e -> e.validate()); - } - if (medium() != null) { - medium().forEach(e -> e.validate()); - } - if (mediumHighAvailability() != null) { - mediumHighAvailability().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensor.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensor.java deleted file mode 100644 index 4e02e43b72a0e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensor.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Contains all Sensor binary downloads. */ -@Fluent -public final class PackageDownloadsSensor { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PackageDownloadsSensor.class); - - /* - * Contains full package downloads - */ - @JsonProperty(value = "full", access = JsonProperty.Access.WRITE_ONLY) - private PackageDownloadsSensorFull full; - - /* - * Sensor upgrade package downloads (on existing installations) - */ - @JsonProperty(value = "upgrade") - private List upgrade; - - /** - * Get the full property: Contains full package downloads. - * - * @return the full value. - */ - public PackageDownloadsSensorFull full() { - return this.full; - } - - /** - * Get the upgrade property: Sensor upgrade package downloads (on existing installations). - * - * @return the upgrade value. - */ - public List upgrade() { - return this.upgrade; - } - - /** - * Set the upgrade property: Sensor upgrade package downloads (on existing installations). - * - * @param upgrade the upgrade value to set. - * @return the PackageDownloadsSensor object itself. - */ - public PackageDownloadsSensor withUpgrade(List upgrade) { - this.upgrade = upgrade; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (full() != null) { - full().validate(); - } - if (upgrade() != null) { - upgrade().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensorFull.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensorFull.java deleted file mode 100644 index 3860b435ea80a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensorFull.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Contains full package downloads. */ -@Fluent -public final class PackageDownloadsSensorFull { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PackageDownloadsSensorFull.class); - - /* - * Contains all ISO full versions for the sensor - */ - @JsonProperty(value = "iso", access = JsonProperty.Access.WRITE_ONLY) - private List iso; - - /* - * Contains all OVF (virtual machine) full versions for the sensor - */ - @JsonProperty(value = "ovf") - private PackageDownloadsSensorFullOvf ovf; - - /** - * Get the iso property: Contains all ISO full versions for the sensor. - * - * @return the iso value. - */ - public List iso() { - return this.iso; - } - - /** - * Get the ovf property: Contains all OVF (virtual machine) full versions for the sensor. - * - * @return the ovf value. - */ - public PackageDownloadsSensorFullOvf ovf() { - return this.ovf; - } - - /** - * Set the ovf property: Contains all OVF (virtual machine) full versions for the sensor. - * - * @param ovf the ovf value to set. - * @return the PackageDownloadsSensorFull object itself. - */ - public PackageDownloadsSensorFull withOvf(PackageDownloadsSensorFullOvf ovf) { - this.ovf = ovf; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (iso() != null) { - iso().forEach(e -> e.validate()); - } - if (ovf() != null) { - ovf().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensorFullOvf.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensorFullOvf.java deleted file mode 100644 index a002194a8de95..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PackageDownloadsSensorFullOvf.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.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Contains all OVF (virtual machine) full versions for the sensor. */ -@Immutable -public final class PackageDownloadsSensorFullOvf { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PackageDownloadsSensorFullOvf.class); - - /* - * Enterprise package type - */ - @JsonProperty(value = "enterprise", access = JsonProperty.Access.WRITE_ONLY) - private List enterprise; - - /* - * Medium package type - */ - @JsonProperty(value = "medium", access = JsonProperty.Access.WRITE_ONLY) - private List medium; - - /* - * Line package type - */ - @JsonProperty(value = "line", access = JsonProperty.Access.WRITE_ONLY) - private List line; - - /** - * Get the enterprise property: Enterprise package type. - * - * @return the enterprise value. - */ - public List enterprise() { - return this.enterprise; - } - - /** - * Get the medium property: Medium package type. - * - * @return the medium value. - */ - public List medium() { - return this.medium; - } - - /** - * Get the line property: Line package type. - * - * @return the line value. - */ - public List line() { - return this.line; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (enterprise() != null) { - enterprise().forEach(e -> e.validate()); - } - if (medium() != null) { - medium().forEach(e -> e.validate()); - } - if (line() != null) { - line().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProgrammingState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProgrammingState.java deleted file mode 100644 index fac05da58c0cf..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProgrammingState.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ProgrammingState. */ -public final class ProgrammingState extends ExpandableStringEnum { - /** Static value ProgrammingDevice for ProgrammingState. */ - public static final ProgrammingState PROGRAMMING_DEVICE = fromString("ProgrammingDevice"); - - /** Static value NotProgrammingDevice for ProgrammingState. */ - public static final ProgrammingState NOT_PROGRAMMING_DEVICE = fromString("NotProgrammingDevice"); - - /** - * Creates or finds a ProgrammingState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProgrammingState. - */ - @JsonCreator - public static ProgrammingState fromString(String name) { - return fromString(name, ProgrammingState.class); - } - - /** @return known ProgrammingState values. */ - public static Collection values() { - return values(ProgrammingState.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Protocol.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Protocol.java index 497e6a32c476b..73479667a1f8a 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Protocol.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Protocol.java @@ -4,62 +4,34 @@ package com.azure.resourcemanager.security.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; -/** Protocol data. */ -@Fluent -public final class Protocol { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Protocol.class); +/** Defines values for Protocol. */ +public final class Protocol extends ExpandableStringEnum { + /** Static value TCP for Protocol. */ + public static final Protocol TCP = fromString("TCP"); - /* - * Protocol name - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * list of protocol identifiers. - */ - @JsonProperty(value = "identifiers") - private String identifiers; + /** Static value UDP for Protocol. */ + public static final Protocol UDP = fromString("UDP"); - /** - * Get the name property: Protocol name. - * - * @return the name value. - */ - public String name() { - return this.name; - } + /** Static value * for Protocol. */ + public static final Protocol ASTERISK = fromString("*"); /** - * Get the identifiers property: list of protocol identifiers. + * Creates or finds a Protocol from its string representation. * - * @return the identifiers value. + * @param name a name to look for. + * @return the corresponding Protocol. */ - public String identifiers() { - return this.identifiers; + @JsonCreator + public static Protocol fromString(String name) { + return fromString(name, Protocol.class); } - /** - * Set the identifiers property: list of protocol identifiers. - * - * @param identifiers the identifiers value to set. - * @return the Protocol object itself. - */ - public Protocol withIdentifiers(String identifiers) { - this.identifiers = identifiers; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { + /** @return known Protocol values. */ + public static Collection values() { + return values(Protocol.class); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProtocolValue.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProtocolValue.java deleted file mode 100644 index 2aa321e30d7fd..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProtocolValue.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ProtocolValue. */ -public final class ProtocolValue extends ExpandableStringEnum { - /** Static value TCP for ProtocolValue. */ - public static final ProtocolValue TCP = fromString("TCP"); - - /** Static value UDP for ProtocolValue. */ - public static final ProtocolValue UDP = fromString("UDP"); - - /** Static value * for ProtocolValue. */ - public static final ProtocolValue ASTERISK = fromString("*"); - - /** - * Creates or finds a ProtocolValue from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProtocolValue. - */ - @JsonCreator - public static ProtocolValue fromString(String name) { - return fromString(name, ProtocolValue.class); - } - - /** @return known ProtocolValue values. */ - public static Collection values() { - return values(ProtocolValue.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PurdueLevel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PurdueLevel.java deleted file mode 100644 index 5a076100d3a30..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PurdueLevel.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PurdueLevel. */ -public final class PurdueLevel extends ExpandableStringEnum { - /** Static value ProcessControl for PurdueLevel. */ - public static final PurdueLevel PROCESS_CONTROL = fromString("ProcessControl"); - - /** Static value Supervisory for PurdueLevel. */ - public static final PurdueLevel SUPERVISORY = fromString("Supervisory"); - - /** Static value Enterprise for PurdueLevel. */ - public static final PurdueLevel ENTERPRISE = fromString("Enterprise"); - - /** - * Creates or finds a PurdueLevel from its string representation. - * - * @param name a name to look for. - * @return the corresponding PurdueLevel. - */ - @JsonCreator - public static PurdueLevel fromString(String name) { - return fromString(name, PurdueLevel.class); - } - - /** @return known PurdueLevel values. */ - public static Collection values() { - return values(PurdueLevel.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationSeverity.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationSeverity.java deleted file mode 100644 index fb8f347708037..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationSeverity.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for RecommendationSeverity. */ -public final class RecommendationSeverity extends ExpandableStringEnum { - /** Static value Unknown for RecommendationSeverity. */ - public static final RecommendationSeverity UNKNOWN = fromString("Unknown"); - - /** Static value NotApplicable for RecommendationSeverity. */ - public static final RecommendationSeverity NOT_APPLICABLE = fromString("NotApplicable"); - - /** Static value Healthy for RecommendationSeverity. */ - public static final RecommendationSeverity HEALTHY = fromString("Healthy"); - - /** Static value OffByPolicy for RecommendationSeverity. */ - public static final RecommendationSeverity OFF_BY_POLICY = fromString("OffByPolicy"); - - /** Static value Low for RecommendationSeverity. */ - public static final RecommendationSeverity LOW = fromString("Low"); - - /** Static value Medium for RecommendationSeverity. */ - public static final RecommendationSeverity MEDIUM = fromString("Medium"); - - /** Static value High for RecommendationSeverity. */ - public static final RecommendationSeverity HIGH = fromString("High"); - - /** - * Creates or finds a RecommendationSeverity from its string representation. - * - * @param name a name to look for. - * @return the corresponding RecommendationSeverity. - */ - @JsonCreator - public static RecommendationSeverity fromString(String name) { - return fromString(name, RecommendationSeverity.class); - } - - /** @return known RecommendationSeverity values. */ - public static Collection values() { - return values(RecommendationSeverity.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RelationToIpStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RelationToIpStatus.java deleted file mode 100644 index 947a32eabacd1..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RelationToIpStatus.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for RelationToIpStatus. */ -public final class RelationToIpStatus extends ExpandableStringEnum { - /** Static value Guess for RelationToIpStatus. */ - public static final RelationToIpStatus GUESS = fromString("Guess"); - - /** Static value Certain for RelationToIpStatus. */ - public static final RelationToIpStatus CERTAIN = fromString("Certain"); - - /** - * Creates or finds a RelationToIpStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding RelationToIpStatus. - */ - @JsonCreator - public static RelationToIpStatus fromString(String name) { - return fromString(name, RelationToIpStatus.class); - } - - /** @return known RelationToIpStatus values. */ - public static Collection values() { - return values(RelationToIpStatus.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RulesResultsInput.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RulesResultsInput.java index d147f9e7e6bb2..2781a213080ba 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RulesResultsInput.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RulesResultsInput.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -27,6 +28,7 @@ public final class RulesResultsInput { * Leave this field empty it LatestScan == true. */ @JsonProperty(value = "results") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map>> results; /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanningFunctionality.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanningFunctionality.java deleted file mode 100644 index ffbca2bb17501..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanningFunctionality.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ScanningFunctionality. */ -public final class ScanningFunctionality extends ExpandableStringEnum { - /** Static value ScannerDevice for ScanningFunctionality. */ - public static final ScanningFunctionality SCANNER_DEVICE = fromString("ScannerDevice"); - - /** Static value NotScannerDevice for ScanningFunctionality. */ - public static final ScanningFunctionality NOT_SCANNER_DEVICE = fromString("NotScannerDevice"); - - /** - * Creates or finds a ScanningFunctionality from its string representation. - * - * @param name a name to look for. - * @return the corresponding ScanningFunctionality. - */ - @JsonCreator - public static ScanningFunctionality fromString(String name) { - return fromString(name, ScanningFunctionality.class); - } - - /** @return known ScanningFunctionality values. */ - public static Collection values() { - return values(ScanningFunctionality.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlScoreDetails.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlScoreDetails.java new file mode 100644 index 0000000000000..3ef440e79b3c1 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlScoreDetails.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.resourcemanager.security.fluent.models.SecureScoreControlScoreDetailsInner; + +/** An immutable client-side representation of SecureScoreControlScoreDetails. */ +public interface SecureScoreControlScoreDetails { + /** + * Gets the displayName property: User friendly display name of the control. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the healthyResourceCount property: Number of healthy resources in the control. + * + * @return the healthyResourceCount value. + */ + Integer healthyResourceCount(); + + /** + * Gets the unhealthyResourceCount property: Number of unhealthy resources in the control. + * + * @return the unhealthyResourceCount value. + */ + Integer unhealthyResourceCount(); + + /** + * Gets the notApplicableResourceCount property: Number of not applicable resources in the control. + * + * @return the notApplicableResourceCount value. + */ + Integer notApplicableResourceCount(); + + /** + * Gets the weight property: The relative weight for this specific control in each of your subscriptions. Used when + * calculating an aggregated score for this control across all of your subscriptions. + * + * @return the weight value. + */ + Long weight(); + + /** + * Gets the definition property: Information about the security control. + * + * @return the definition value. + */ + SecureScoreControlDefinitionItem definition(); + + /** + * Gets the max property: Maximum score available. + * + * @return the max value. + */ + Integer max(); + + /** + * Gets the current property: Current score. + * + * @return the current value. + */ + Double current(); + + /** + * Gets the percentage property: Ratio of the current score divided by the maximum. Rounded to 4 digits after the + * decimal point. + * + * @return the percentage value. + */ + Double percentage(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.SecureScoreControlScoreDetailsInner object. + * + * @return the inner object. + */ + SecureScoreControlScoreDetailsInner innerModel(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessment.java index eb53f1d472c58..c5839aede63d4 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessment.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessment.java @@ -4,277 +4,176 @@ package com.azure.resourcemanager.security.models; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentInner; +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataProperties; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** An immutable client-side representation of SecurityAssessment. */ -public interface SecurityAssessment { +/** Security assessment on a resource. */ +@Fluent +public final class SecurityAssessment extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessment.class); + + /* + * Describes properties of an assessment. + */ + @JsonProperty(value = "properties") + private SecurityAssessmentProperties innerProperties; + /** - * Gets the id property: Fully qualified resource Id for the resource. + * Get the innerProperties property: Describes properties of an assessment. * - * @return the id value. + * @return the innerProperties value. */ - String id(); + private SecurityAssessmentProperties innerProperties() { + return this.innerProperties; + } /** - * Gets the name property: The name of the resource. + * Get the status property: The result of the assessment. * - * @return the name value. + * @return the status value. */ - String name(); + public AssessmentStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } /** - * Gets the type property: The type of the resource. + * Set the status property: The result of the assessment. * - * @return the type value. + * @param status the status value to set. + * @return the SecurityAssessment object itself. */ - String type(); + public SecurityAssessment withStatus(AssessmentStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentProperties(); + } + this.innerProperties().withStatus(status); + return this; + } /** - * Gets the resourceDetails property: Details of the resource that was assessed. + * Get the resourceDetails property: Details of the resource that was assessed. * * @return the resourceDetails value. */ - ResourceDetails resourceDetails(); + public ResourceDetails resourceDetails() { + return this.innerProperties() == null ? null : this.innerProperties().resourceDetails(); + } /** - * Gets the displayName property: User friendly display name of the assessment. + * Set the resourceDetails property: Details of the resource that was assessed. * - * @return the displayName value. + * @param resourceDetails the resourceDetails value to set. + * @return the SecurityAssessment object itself. */ - String displayName(); + public SecurityAssessment withResourceDetails(ResourceDetails resourceDetails) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentProperties(); + } + this.innerProperties().withResourceDetails(resourceDetails); + return this; + } /** - * Gets the status property: The result of the assessment. + * Get the displayName property: User friendly display name of the assessment. * - * @return the status value. + * @return the displayName value. */ - AssessmentStatus status(); + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } /** - * Gets the additionalData property: Additional data regarding the assessment. + * Get the additionalData property: Additional data regarding the assessment. * * @return the additionalData value. */ - Map additionalData(); + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } /** - * Gets the links property: Links relevant to the assessment. + * Set the additionalData property: Additional data regarding the assessment. * - * @return the links value. + * @param additionalData the additionalData value to set. + * @return the SecurityAssessment object itself. */ - AssessmentLinks links(); + public SecurityAssessment withAdditionalData(Map additionalData) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentProperties(); + } + this.innerProperties().withAdditionalData(additionalData); + return this; + } /** - * Gets the metadata property: Describes properties of an assessment metadata. + * Get the links property: Links relevant to the assessment. * - * @return the metadata value. + * @return the links value. */ - SecurityAssessmentMetadataProperties metadata(); + public AssessmentLinks links() { + return this.innerProperties() == null ? null : this.innerProperties().links(); + } /** - * Gets the partnersData property: Data regarding 3rd party partner integration. + * Get the metadata property: Describes properties of an assessment metadata. * - * @return the partnersData value. + * @return the metadata value. */ - SecurityAssessmentPartnerData partnersData(); + public SecurityAssessmentMetadataProperties metadata() { + return this.innerProperties() == null ? null : this.innerProperties().metadata(); + } /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.SecurityAssessmentInner object. + * Set the metadata property: Describes properties of an assessment metadata. * - * @return the inner object. + * @param metadata the metadata value to set. + * @return the SecurityAssessment object itself. */ - SecurityAssessmentInner innerModel(); - - /** The entirety of the SecurityAssessment definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { - } - /** The SecurityAssessment definition stages. */ - interface DefinitionStages { - /** The first stage of the SecurityAssessment definition. */ - interface Blank extends WithScope { - } - /** The stage of the SecurityAssessment 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 SecurityAssessment 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.WithResourceDetails, - DefinitionStages.WithStatus, - DefinitionStages.WithAdditionalData, - DefinitionStages.WithMetadata, - DefinitionStages.WithPartnersData { - /** - * Executes the create request. - * - * @return the created resource. - */ - SecurityAssessment create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - SecurityAssessment create(Context context); - } - /** The stage of the SecurityAssessment definition allowing to specify resourceDetails. */ - interface WithResourceDetails { - /** - * Specifies the resourceDetails property: Details of the resource that was assessed. - * - * @param resourceDetails Details of the resource that was assessed. - * @return the next definition stage. - */ - WithCreate withResourceDetails(ResourceDetails resourceDetails); - } - /** The stage of the SecurityAssessment definition allowing to specify status. */ - interface WithStatus { - /** - * Specifies the status property: The result of the assessment. - * - * @param status The result of the assessment. - * @return the next definition stage. - */ - WithCreate withStatus(AssessmentStatus status); - } - /** The stage of the SecurityAssessment definition allowing to specify additionalData. */ - interface WithAdditionalData { - /** - * Specifies the additionalData property: Additional data regarding the assessment. - * - * @param additionalData Additional data regarding the assessment. - * @return the next definition stage. - */ - WithCreate withAdditionalData(Map additionalData); - } - /** The stage of the SecurityAssessment definition allowing to specify metadata. */ - interface WithMetadata { - /** - * Specifies the metadata property: Describes properties of an assessment metadata.. - * - * @param metadata Describes properties of an assessment metadata. - * @return the next definition stage. - */ - WithCreate withMetadata(SecurityAssessmentMetadataProperties metadata); - } - /** The stage of the SecurityAssessment definition allowing to specify partnersData. */ - interface WithPartnersData { - /** - * Specifies the partnersData property: Data regarding 3rd party partner integration. - * - * @param partnersData Data regarding 3rd party partner integration. - * @return the next definition stage. - */ - WithCreate withPartnersData(SecurityAssessmentPartnerData partnersData); + public SecurityAssessment withMetadata(SecurityAssessmentMetadataProperties metadata) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentProperties(); } + this.innerProperties().withMetadata(metadata); + return this; } + /** - * Begins update for the SecurityAssessment resource. + * Get the partnersData property: Data regarding 3rd party partner integration. * - * @return the stage of resource update. + * @return the partnersData value. */ - SecurityAssessment.Update update(); - - /** The template for SecurityAssessment update. */ - interface Update - extends UpdateStages.WithResourceDetails, - UpdateStages.WithStatus, - UpdateStages.WithAdditionalData, - UpdateStages.WithMetadata, - UpdateStages.WithPartnersData { - /** - * Executes the update request. - * - * @return the updated resource. - */ - SecurityAssessment apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - SecurityAssessment apply(Context context); - } - /** The SecurityAssessment update stages. */ - interface UpdateStages { - /** The stage of the SecurityAssessment update allowing to specify resourceDetails. */ - interface WithResourceDetails { - /** - * Specifies the resourceDetails property: Details of the resource that was assessed. - * - * @param resourceDetails Details of the resource that was assessed. - * @return the next definition stage. - */ - Update withResourceDetails(ResourceDetails resourceDetails); - } - /** The stage of the SecurityAssessment update allowing to specify status. */ - interface WithStatus { - /** - * Specifies the status property: The result of the assessment. - * - * @param status The result of the assessment. - * @return the next definition stage. - */ - Update withStatus(AssessmentStatus status); - } - /** The stage of the SecurityAssessment update allowing to specify additionalData. */ - interface WithAdditionalData { - /** - * Specifies the additionalData property: Additional data regarding the assessment. - * - * @param additionalData Additional data regarding the assessment. - * @return the next definition stage. - */ - Update withAdditionalData(Map additionalData); - } - /** The stage of the SecurityAssessment update allowing to specify metadata. */ - interface WithMetadata { - /** - * Specifies the metadata property: Describes properties of an assessment metadata.. - * - * @param metadata Describes properties of an assessment metadata. - * @return the next definition stage. - */ - Update withMetadata(SecurityAssessmentMetadataProperties metadata); - } - /** The stage of the SecurityAssessment update allowing to specify partnersData. */ - interface WithPartnersData { - /** - * Specifies the partnersData property: Data regarding 3rd party partner integration. - * - * @param partnersData Data regarding 3rd party partner integration. - * @return the next definition stage. - */ - Update withPartnersData(SecurityAssessmentPartnerData partnersData); - } + public SecurityAssessmentPartnerData partnersData() { + return this.innerProperties() == null ? null : this.innerProperties().partnersData(); } + /** - * Refreshes the resource to sync with Azure. + * Set the partnersData property: Data regarding 3rd party partner integration. * - * @return the refreshed resource. + * @param partnersData the partnersData value to set. + * @return the SecurityAssessment object itself. */ - SecurityAssessment refresh(); + public SecurityAssessment withPartnersData(SecurityAssessmentPartnerData partnersData) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAssessmentProperties(); + } + this.innerProperties().withPartnersData(partnersData); + return this; + } /** - * Refreshes the resource to sync with Azure. + * Validates the instance. * - * @param context The context to associate with this operation. - * @return the refreshed resource. + * @throws IllegalArgumentException thrown if the instance is not valid. */ - SecurityAssessment refresh(Context context); + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentList.java index 3894c68149328..f1a4ed0be5e00 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentList.java @@ -6,7 +6,7 @@ import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentInner; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -20,7 +20,7 @@ public final class SecurityAssessmentList { * Collection of security assessments in this page */ @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; + private List value; /* * The URI to fetch the next page. @@ -33,7 +33,7 @@ public final class SecurityAssessmentList { * * @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/SecurityAssessmentMetadataPropertiesResponsePublishDates.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataPropertiesResponsePublishDates.java new file mode 100644 index 0000000000000..7b588da7dc5a7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataPropertiesResponsePublishDates.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SecurityAssessmentMetadataPropertiesResponsePublishDates model. */ +@Fluent +public final class SecurityAssessmentMetadataPropertiesResponsePublishDates { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(SecurityAssessmentMetadataPropertiesResponsePublishDates.class); + + /* + * The GA property. + */ + @JsonProperty(value = "GA") + private String ga; + + /* + * The public property. + */ + @JsonProperty(value = "public", required = true) + private String publicProperty; + + /** + * Get the ga property: The GA property. + * + * @return the ga value. + */ + public String ga() { + return this.ga; + } + + /** + * Set the ga property: The GA property. + * + * @param ga the ga value to set. + * @return the SecurityAssessmentMetadataPropertiesResponsePublishDates object itself. + */ + public SecurityAssessmentMetadataPropertiesResponsePublishDates withGa(String ga) { + this.ga = ga; + return this; + } + + /** + * Get the publicProperty property: The public property. + * + * @return the publicProperty value. + */ + public String publicProperty() { + return this.publicProperty; + } + + /** + * Set the publicProperty property: The public property. + * + * @param publicProperty the publicProperty value to set. + * @return the SecurityAssessmentMetadataPropertiesResponsePublishDates object itself. + */ + public SecurityAssessmentMetadataPropertiesResponsePublishDates withPublicProperty(String publicProperty) { + this.publicProperty = publicProperty; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicProperty() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publicProperty in model" + + " SecurityAssessmentMetadataPropertiesResponsePublishDates")); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadata.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponse.java similarity index 64% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadata.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponse.java index c16b0303f1076..51d514a7ddf3c 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadata.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponse.java @@ -5,11 +5,11 @@ package com.azure.resourcemanager.security.models; import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataInner; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner; import java.util.List; -/** An immutable client-side representation of SecurityAssessmentMetadata. */ -public interface SecurityAssessmentMetadata { +/** An immutable client-side representation of SecurityAssessmentMetadataResponse. */ +public interface SecurityAssessmentMetadataResponse { /** * Gets the id property: Fully qualified resource Id for the resource. * @@ -31,6 +31,34 @@ public interface SecurityAssessmentMetadata { */ String type(); + /** + * Gets the publishDates property: The publishDates property. + * + * @return the publishDates value. + */ + SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates(); + + /** + * Gets the plannedDeprecationDate property: The plannedDeprecationDate property. + * + * @return the plannedDeprecationDate value. + */ + String plannedDeprecationDate(); + + /** + * Gets the tactics property: The tactics property. + * + * @return the tactics value. + */ + List tactics(); + + /** + * Gets the techniques property: The techniques property. + * + * @return the techniques value. + */ + List techniques(); + /** * Gets the displayName property: User friendly display name of the assessment. * @@ -119,26 +147,30 @@ public interface SecurityAssessmentMetadata { SecurityAssessmentMetadataPartnerData partnerData(); /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataInner object. + * Gets the inner com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner object. * * @return the inner object. */ - SecurityAssessmentMetadataInner innerModel(); + SecurityAssessmentMetadataResponseInner innerModel(); - /** The entirety of the SecurityAssessmentMetadata definition. */ + /** The entirety of the SecurityAssessmentMetadataResponse definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { } - /** The SecurityAssessmentMetadata definition stages. */ + /** The SecurityAssessmentMetadataResponse definition stages. */ interface DefinitionStages { - /** The first stage of the SecurityAssessmentMetadata definition. */ + /** The first stage of the SecurityAssessmentMetadataResponse definition. */ interface Blank extends WithCreate { } /** - * The stage of the SecurityAssessmentMetadata 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. + * 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. */ interface WithCreate - extends DefinitionStages.WithDisplayName, + extends DefinitionStages.WithPublishDates, + DefinitionStages.WithPlannedDeprecationDate, + DefinitionStages.WithTactics, + DefinitionStages.WithTechniques, + DefinitionStages.WithDisplayName, DefinitionStages.WithDescription, DefinitionStages.WithRemediationDescription, DefinitionStages.WithCategories, @@ -154,7 +186,7 @@ interface WithCreate * * @return the created resource. */ - SecurityAssessmentMetadata create(); + SecurityAssessmentMetadataResponse create(); /** * Executes the create request. @@ -162,9 +194,51 @@ interface WithCreate * @param context The context to associate with this operation. * @return the created resource. */ - SecurityAssessmentMetadata create(Context context); + SecurityAssessmentMetadataResponse create(Context context); + } + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify publishDates. */ + interface WithPublishDates { + /** + * Specifies the publishDates property: The publishDates property.. + * + * @param publishDates The publishDates property. + * @return the next definition stage. + */ + WithCreate withPublishDates(SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates); + } + /** + * The stage of the SecurityAssessmentMetadataResponse definition allowing to specify plannedDeprecationDate. + */ + interface WithPlannedDeprecationDate { + /** + * Specifies the plannedDeprecationDate property: The plannedDeprecationDate property.. + * + * @param plannedDeprecationDate The plannedDeprecationDate property. + * @return the next definition stage. + */ + WithCreate withPlannedDeprecationDate(String plannedDeprecationDate); + } + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify tactics. */ + interface WithTactics { + /** + * Specifies the tactics property: The tactics property.. + * + * @param tactics The tactics property. + * @return the next definition stage. + */ + WithCreate withTactics(List tactics); + } + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify techniques. */ + interface WithTechniques { + /** + * Specifies the techniques property: The techniques property.. + * + * @param techniques The techniques property. + * @return the next definition stage. + */ + WithCreate withTechniques(List techniques); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify displayName. */ + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify displayName. */ interface WithDisplayName { /** * Specifies the displayName property: User friendly display name of the assessment. @@ -174,7 +248,7 @@ interface WithDisplayName { */ WithCreate withDisplayName(String displayName); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify description. */ + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify description. */ interface WithDescription { /** * Specifies the description property: Human readable description of the assessment. @@ -184,7 +258,9 @@ interface WithDescription { */ WithCreate withDescription(String description); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify remediationDescription. */ + /** + * The stage of the SecurityAssessmentMetadataResponse definition allowing to specify remediationDescription. + */ interface WithRemediationDescription { /** * Specifies the remediationDescription property: Human readable description of what you should do to @@ -196,7 +272,7 @@ interface WithRemediationDescription { */ WithCreate withRemediationDescription(String remediationDescription); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify categories. */ + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify categories. */ interface WithCategories { /** * Specifies the categories property: The categories property.. @@ -206,7 +282,7 @@ interface WithCategories { */ WithCreate withCategories(List categories); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify severity. */ + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify severity. */ interface WithSeverity { /** * Specifies the severity property: The severity level of the assessment. @@ -216,7 +292,7 @@ interface WithSeverity { */ WithCreate withSeverity(Severity severity); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify userImpact. */ + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify userImpact. */ interface WithUserImpact { /** * Specifies the userImpact property: The user impact of the assessment. @@ -226,7 +302,7 @@ interface WithUserImpact { */ WithCreate withUserImpact(UserImpact userImpact); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify implementationEffort. */ + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify implementationEffort. */ interface WithImplementationEffort { /** * Specifies the implementationEffort property: The implementation effort required to remediate this @@ -237,7 +313,7 @@ interface WithImplementationEffort { */ WithCreate withImplementationEffort(ImplementationEffort implementationEffort); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify threats. */ + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify threats. */ interface WithThreats { /** * Specifies the threats property: The threats property.. @@ -247,7 +323,7 @@ interface WithThreats { */ WithCreate withThreats(List threats); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify preview. */ + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify preview. */ interface WithPreview { /** * Specifies the preview property: True if this assessment is in preview release status. @@ -257,7 +333,7 @@ interface WithPreview { */ WithCreate withPreview(Boolean preview); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify assessmentType. */ + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify assessmentType. */ interface WithAssessmentType { /** * Specifies the assessmentType property: BuiltIn if the assessment based on built-in Azure Policy @@ -269,7 +345,7 @@ interface WithAssessmentType { */ WithCreate withAssessmentType(AssessmentType assessmentType); } - /** The stage of the SecurityAssessmentMetadata definition allowing to specify partnerData. */ + /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify partnerData. */ interface WithPartnerData { /** * Specifies the partnerData property: Describes the partner that created the assessment. @@ -285,7 +361,7 @@ interface WithPartnerData { * * @return the refreshed resource. */ - SecurityAssessmentMetadata refresh(); + SecurityAssessmentMetadataResponse refresh(); /** * Refreshes the resource to sync with Azure. @@ -293,5 +369,5 @@ interface WithPartnerData { * @param context The context to associate with this operation. * @return the refreshed resource. */ - SecurityAssessmentMetadata refresh(Context context); + SecurityAssessmentMetadataResponse refresh(Context context); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponseList.java similarity index 84% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataList.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponseList.java index a38f0c3aff366..b187348ea1e5f 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponseList.java @@ -6,21 +6,21 @@ import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataInner; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** List of security assessment metadata. */ @Immutable -public final class SecurityAssessmentMetadataList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessmentMetadataList.class); +public final class SecurityAssessmentMetadataResponseList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessmentMetadataResponseList.class); /* * The value property. */ @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; + private List value; /* * The URI to fetch the next page. @@ -33,7 +33,7 @@ public final class SecurityAssessmentMetadataList { * * @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/fluent/models/SecurityAssessmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPropertiesBase.java similarity index 61% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentInner.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPropertiesBase.java index c053d6cb76b97..e904b4e76a9a8 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPropertiesBase.java @@ -2,67 +2,56 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security.fluent.models; +package com.azure.resourcemanager.security.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.AssessmentLinks; -import com.azure.resourcemanager.security.models.AssessmentStatus; -import com.azure.resourcemanager.security.models.ResourceDetails; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataProperties; -import com.azure.resourcemanager.security.models.SecurityAssessmentPartnerData; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataProperties; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** Security assessment on a resource. */ -@JsonFlatten +/** Describes properties of an assessment. */ @Fluent -public class SecurityAssessmentInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessmentInner.class); +public class SecurityAssessmentPropertiesBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAssessmentPropertiesBase.class); /* * Details of the resource that was assessed */ - @JsonProperty(value = "properties.resourceDetails") + @JsonProperty(value = "resourceDetails", required = true) private ResourceDetails resourceDetails; /* * User friendly display name of the assessment */ - @JsonProperty(value = "properties.displayName", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) private String displayName; - /* - * The result of the assessment - */ - @JsonProperty(value = "properties.status") - private AssessmentStatus status; - /* * Additional data regarding the assessment */ - @JsonProperty(value = "properties.additionalData") + @JsonProperty(value = "additionalData") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map additionalData; /* * Links relevant to the assessment */ - @JsonProperty(value = "properties.links", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "links", access = JsonProperty.Access.WRITE_ONLY) private AssessmentLinks links; /* * Describes properties of an assessment metadata. */ - @JsonProperty(value = "properties.metadata") + @JsonProperty(value = "metadata") private SecurityAssessmentMetadataProperties metadata; /* * Data regarding 3rd party partner integration */ - @JsonProperty(value = "properties.partnersData") + @JsonProperty(value = "partnersData") private SecurityAssessmentPartnerData partnersData; /** @@ -78,9 +67,9 @@ public ResourceDetails resourceDetails() { * Set the resourceDetails property: Details of the resource that was assessed. * * @param resourceDetails the resourceDetails value to set. - * @return the SecurityAssessmentInner object itself. + * @return the SecurityAssessmentPropertiesBase object itself. */ - public SecurityAssessmentInner withResourceDetails(ResourceDetails resourceDetails) { + public SecurityAssessmentPropertiesBase withResourceDetails(ResourceDetails resourceDetails) { this.resourceDetails = resourceDetails; return this; } @@ -94,26 +83,6 @@ public String displayName() { return this.displayName; } - /** - * Get the status property: The result of the assessment. - * - * @return the status value. - */ - public AssessmentStatus status() { - return this.status; - } - - /** - * Set the status property: The result of the assessment. - * - * @param status the status value to set. - * @return the SecurityAssessmentInner object itself. - */ - public SecurityAssessmentInner withStatus(AssessmentStatus status) { - this.status = status; - return this; - } - /** * Get the additionalData property: Additional data regarding the assessment. * @@ -127,9 +96,9 @@ public Map additionalData() { * Set the additionalData property: Additional data regarding the assessment. * * @param additionalData the additionalData value to set. - * @return the SecurityAssessmentInner object itself. + * @return the SecurityAssessmentPropertiesBase object itself. */ - public SecurityAssessmentInner withAdditionalData(Map additionalData) { + public SecurityAssessmentPropertiesBase withAdditionalData(Map additionalData) { this.additionalData = additionalData; return this; } @@ -156,9 +125,9 @@ public SecurityAssessmentMetadataProperties metadata() { * Set the metadata property: Describes properties of an assessment metadata. * * @param metadata the metadata value to set. - * @return the SecurityAssessmentInner object itself. + * @return the SecurityAssessmentPropertiesBase object itself. */ - public SecurityAssessmentInner withMetadata(SecurityAssessmentMetadataProperties metadata) { + public SecurityAssessmentPropertiesBase withMetadata(SecurityAssessmentMetadataProperties metadata) { this.metadata = metadata; return this; } @@ -176,9 +145,9 @@ public SecurityAssessmentPartnerData partnersData() { * Set the partnersData property: Data regarding 3rd party partner integration. * * @param partnersData the partnersData value to set. - * @return the SecurityAssessmentInner object itself. + * @return the SecurityAssessmentPropertiesBase object itself. */ - public SecurityAssessmentInner withPartnersData(SecurityAssessmentPartnerData partnersData) { + public SecurityAssessmentPropertiesBase withPartnersData(SecurityAssessmentPartnerData partnersData) { this.partnersData = partnersData; return this; } @@ -189,12 +158,14 @@ public SecurityAssessmentInner withPartnersData(SecurityAssessmentPartnerData pa * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (resourceDetails() != null) { + if (resourceDetails() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resourceDetails in model SecurityAssessmentPropertiesBase")); + } else { resourceDetails().validate(); } - if (status() != null) { - status().validate(); - } if (links() != null) { links().validate(); } 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 new file mode 100644 index 0000000000000..36403c276ed88 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentResponse.java @@ -0,0 +1,281 @@ +// Copyright (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.SecurityAssessmentMetadataProperties; +import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner; +import java.util.Map; + +/** An immutable client-side representation of SecurityAssessmentResponse. */ +public interface SecurityAssessmentResponse { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the status property: The result of the assessment. + * + * @return the status value. + */ + AssessmentStatusResponse status(); + + /** + * Gets the resourceDetails property: Details of the resource that was assessed. + * + * @return the resourceDetails value. + */ + ResourceDetails resourceDetails(); + + /** + * Gets the displayName property: User friendly display name of the assessment. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the additionalData property: Additional data regarding the assessment. + * + * @return the additionalData value. + */ + Map additionalData(); + + /** + * Gets the links property: Links relevant to the assessment. + * + * @return the links value. + */ + AssessmentLinks links(); + + /** + * Gets the metadata property: Describes properties of an assessment metadata. + * + * @return the metadata value. + */ + SecurityAssessmentMetadataProperties metadata(); + + /** + * Gets the partnersData property: Data regarding 3rd party partner integration. + * + * @return the partnersData value. + */ + SecurityAssessmentPartnerData partnersData(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner object. + * + * @return the inner object. + */ + SecurityAssessmentResponseInner innerModel(); + + /** 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 { + /** + * Specifies resourceId. + * + * @param resourceId The identifier of the resource. + * @return the next definition stage. + */ + 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. + */ + interface WithCreate + extends DefinitionStages.WithStatus, + DefinitionStages.WithResourceDetails, + DefinitionStages.WithAdditionalData, + DefinitionStages.WithMetadata, + DefinitionStages.WithPartnersData { + /** + * Executes the create request. + * + * @return the created resource. + */ + SecurityAssessmentResponse create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SecurityAssessmentResponse create(Context context); + } + /** The stage of the SecurityAssessmentResponse definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: The result of the assessment. + * + * @param status The result of the assessment. + * @return the next definition stage. + */ + WithCreate withStatus(AssessmentStatus status); + } + /** The stage of the SecurityAssessmentResponse definition allowing to specify resourceDetails. */ + interface WithResourceDetails { + /** + * Specifies the resourceDetails property: Details of the resource that was assessed. + * + * @param resourceDetails Details of the resource that was assessed. + * @return the next definition stage. + */ + WithCreate withResourceDetails(ResourceDetails resourceDetails); + } + /** The stage of the SecurityAssessmentResponse definition allowing to specify additionalData. */ + interface WithAdditionalData { + /** + * Specifies the additionalData property: Additional data regarding the assessment. + * + * @param additionalData Additional data regarding the assessment. + * @return the next definition stage. + */ + WithCreate withAdditionalData(Map additionalData); + } + /** The stage of the SecurityAssessmentResponse definition allowing to specify metadata. */ + interface WithMetadata { + /** + * Specifies the metadata property: Describes properties of an assessment metadata.. + * + * @param metadata Describes properties of an assessment metadata. + * @return the next definition stage. + */ + WithCreate withMetadata(SecurityAssessmentMetadataProperties metadata); + } + /** The stage of the SecurityAssessmentResponse definition allowing to specify partnersData. */ + interface WithPartnersData { + /** + * Specifies the partnersData property: Data regarding 3rd party partner integration. + * + * @param partnersData Data regarding 3rd party partner integration. + * @return the next definition stage. + */ + WithCreate withPartnersData(SecurityAssessmentPartnerData partnersData); + } + } + /** + * Begins update for the SecurityAssessmentResponse resource. + * + * @return the stage of resource update. + */ + SecurityAssessmentResponse.Update update(); + + /** The template for SecurityAssessmentResponse update. */ + interface Update + extends UpdateStages.WithStatus, + UpdateStages.WithResourceDetails, + UpdateStages.WithAdditionalData, + UpdateStages.WithMetadata, + UpdateStages.WithPartnersData { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SecurityAssessmentResponse apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SecurityAssessmentResponse apply(Context context); + } + /** The SecurityAssessmentResponse update stages. */ + interface UpdateStages { + /** The stage of the SecurityAssessmentResponse update allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: The result of the assessment. + * + * @param status The result of the assessment. + * @return the next definition stage. + */ + Update withStatus(AssessmentStatus status); + } + /** The stage of the SecurityAssessmentResponse update allowing to specify resourceDetails. */ + interface WithResourceDetails { + /** + * Specifies the resourceDetails property: Details of the resource that was assessed. + * + * @param resourceDetails Details of the resource that was assessed. + * @return the next definition stage. + */ + Update withResourceDetails(ResourceDetails resourceDetails); + } + /** The stage of the SecurityAssessmentResponse update allowing to specify additionalData. */ + interface WithAdditionalData { + /** + * Specifies the additionalData property: Additional data regarding the assessment. + * + * @param additionalData Additional data regarding the assessment. + * @return the next definition stage. + */ + Update withAdditionalData(Map additionalData); + } + /** The stage of the SecurityAssessmentResponse update allowing to specify metadata. */ + interface WithMetadata { + /** + * Specifies the metadata property: Describes properties of an assessment metadata.. + * + * @param metadata Describes properties of an assessment metadata. + * @return the next definition stage. + */ + Update withMetadata(SecurityAssessmentMetadataProperties metadata); + } + /** The stage of the SecurityAssessmentResponse update allowing to specify partnersData. */ + interface WithPartnersData { + /** + * Specifies the partnersData property: Data regarding 3rd party partner integration. + * + * @param partnersData Data regarding 3rd party partner integration. + * @return the next definition stage. + */ + Update withPartnersData(SecurityAssessmentPartnerData partnersData); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SecurityAssessmentResponse refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SecurityAssessmentResponse refresh(Context context); +} 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 new file mode 100644 index 0000000000000..4b882892daf81 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnector.java @@ -0,0 +1,322 @@ +// Copyright (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.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of SecurityConnector. */ +public interface SecurityConnector { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of AWS connector). + * + * @return the hierarchyIdentifier value. + */ + String hierarchyIdentifier(); + + /** + * Gets the cloudName property: The multi cloud resource's cloud name. + * + * @return the cloudName value. + */ + CloudName cloudName(); + + /** + * Gets the offerings property: A collection of offerings for the security connector. + * + * @return the offerings value. + */ + List offerings(); + + /** + * Gets the organizationalData property: The multi cloud account's organizational data. + * + * @return the organizationalData value. + */ + SecurityConnectorPropertiesOrganizationalData organizationalData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner object. + * + * @return the inner object. + */ + SecurityConnectorInner innerModel(); + + /** The entirety of the SecurityConnector definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + 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 { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the SecurityConnector definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @return the next definition stage. + */ + 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. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithHierarchyIdentifier, + DefinitionStages.WithCloudName, + DefinitionStages.WithOfferings, + DefinitionStages.WithOrganizationalData { + /** + * Executes the create request. + * + * @return the created resource. + */ + SecurityConnector create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SecurityConnector create(Context context); + } + /** The stage of the SecurityConnector definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the SecurityConnector definition allowing to specify hierarchyIdentifier. */ + interface WithHierarchyIdentifier { + /** + * Specifies the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of + * AWS connector).. + * + * @param hierarchyIdentifier The multi cloud resource identifier (account id in case of AWS connector). + * @return the next definition stage. + */ + WithCreate withHierarchyIdentifier(String hierarchyIdentifier); + } + /** The stage of the SecurityConnector definition allowing to specify cloudName. */ + interface WithCloudName { + /** + * Specifies the cloudName property: The multi cloud resource's cloud name.. + * + * @param cloudName The multi cloud resource's cloud name. + * @return the next definition stage. + */ + WithCreate withCloudName(CloudName cloudName); + } + /** The stage of the SecurityConnector definition allowing to specify offerings. */ + interface WithOfferings { + /** + * Specifies the offerings property: A collection of offerings for the security connector.. + * + * @param offerings A collection of offerings for the security connector. + * @return the next definition stage. + */ + WithCreate withOfferings(List offerings); + } + /** The stage of the SecurityConnector definition allowing to specify organizationalData. */ + interface WithOrganizationalData { + /** + * Specifies the organizationalData property: The multi cloud account's organizational data. + * + * @param organizationalData The multi cloud account's organizational data. + * @return the next definition stage. + */ + WithCreate withOrganizationalData(SecurityConnectorPropertiesOrganizationalData organizationalData); + } + } + /** + * Begins update for the SecurityConnector resource. + * + * @return the stage of resource update. + */ + SecurityConnector.Update update(); + + /** The template for SecurityConnector update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithHierarchyIdentifier, + UpdateStages.WithCloudName, + UpdateStages.WithOfferings, + UpdateStages.WithOrganizationalData { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SecurityConnector apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SecurityConnector apply(Context context); + } + /** The SecurityConnector update stages. */ + interface UpdateStages { + /** The stage of the SecurityConnector update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the SecurityConnector update allowing to specify hierarchyIdentifier. */ + interface WithHierarchyIdentifier { + /** + * Specifies the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of + * AWS connector).. + * + * @param hierarchyIdentifier The multi cloud resource identifier (account id in case of AWS connector). + * @return the next definition stage. + */ + Update withHierarchyIdentifier(String hierarchyIdentifier); + } + /** The stage of the SecurityConnector update allowing to specify cloudName. */ + interface WithCloudName { + /** + * Specifies the cloudName property: The multi cloud resource's cloud name.. + * + * @param cloudName The multi cloud resource's cloud name. + * @return the next definition stage. + */ + Update withCloudName(CloudName cloudName); + } + /** The stage of the SecurityConnector update allowing to specify offerings. */ + interface WithOfferings { + /** + * Specifies the offerings property: A collection of offerings for the security connector.. + * + * @param offerings A collection of offerings for the security connector. + * @return the next definition stage. + */ + Update withOfferings(List offerings); + } + /** The stage of the SecurityConnector update allowing to specify organizationalData. */ + interface WithOrganizationalData { + /** + * Specifies the organizationalData property: The multi cloud account's organizational data. + * + * @param organizationalData The multi cloud account's organizational data. + * @return the next definition stage. + */ + Update withOrganizationalData(SecurityConnectorPropertiesOrganizationalData organizationalData); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SecurityConnector refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SecurityConnector refresh(Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorPropertiesOrganizationalData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorPropertiesOrganizationalData.java new file mode 100644 index 0000000000000..515c4ab3ae9a2 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorPropertiesOrganizationalData.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The multi cloud account's organizational data. */ +@Fluent +public final class SecurityConnectorPropertiesOrganizationalData { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(SecurityConnectorPropertiesOrganizationalData.class); + + /* + * The multi cloud account's membership type in the organization + */ + @JsonProperty(value = "organizationMembershipType") + private OrganizationMembershipType organizationMembershipType; + + /* + * If the multi cloud account is not of membership type organization, this + * will be the ID of the account's parent + */ + @JsonProperty(value = "parentHierarchyId") + private String parentHierarchyId; + + /* + * If the multi cloud account is of membership type organization, this will + * be the name of the onboarding stackset + */ + @JsonProperty(value = "stacksetName") + private String stacksetName; + + /* + * If the multi cloud account is of membership type organization, list of + * accounts excluded from offering + */ + @JsonProperty(value = "excludedAccountIds") + private List excludedAccountIds; + + /** + * Get the organizationMembershipType property: The multi cloud account's membership type in the organization. + * + * @return the organizationMembershipType value. + */ + public OrganizationMembershipType organizationMembershipType() { + return this.organizationMembershipType; + } + + /** + * Set the organizationMembershipType property: The multi cloud account's membership type in the organization. + * + * @param organizationMembershipType the organizationMembershipType value to set. + * @return the SecurityConnectorPropertiesOrganizationalData object itself. + */ + public SecurityConnectorPropertiesOrganizationalData withOrganizationMembershipType( + OrganizationMembershipType organizationMembershipType) { + this.organizationMembershipType = organizationMembershipType; + return this; + } + + /** + * Get the parentHierarchyId property: If the multi cloud account is not of membership type organization, this will + * be the ID of the account's parent. + * + * @return the parentHierarchyId value. + */ + public String parentHierarchyId() { + return this.parentHierarchyId; + } + + /** + * Set the parentHierarchyId property: If the multi cloud account is not of membership type organization, this will + * be the ID of the account's parent. + * + * @param parentHierarchyId the parentHierarchyId value to set. + * @return the SecurityConnectorPropertiesOrganizationalData object itself. + */ + public SecurityConnectorPropertiesOrganizationalData withParentHierarchyId(String parentHierarchyId) { + this.parentHierarchyId = parentHierarchyId; + return this; + } + + /** + * Get the stacksetName property: If the multi cloud account is of membership type organization, this will be the + * name of the onboarding stackset. + * + * @return the stacksetName value. + */ + public String stacksetName() { + return this.stacksetName; + } + + /** + * Set the stacksetName property: If the multi cloud account is of membership type organization, this will be the + * name of the onboarding stackset. + * + * @param stacksetName the stacksetName value to set. + * @return the SecurityConnectorPropertiesOrganizationalData object itself. + */ + public SecurityConnectorPropertiesOrganizationalData withStacksetName(String stacksetName) { + this.stacksetName = stacksetName; + return this; + } + + /** + * Get the excludedAccountIds property: If the multi cloud account is of membership type organization, list of + * accounts excluded from offering. + * + * @return the excludedAccountIds value. + */ + public List excludedAccountIds() { + return this.excludedAccountIds; + } + + /** + * Set the excludedAccountIds property: If the multi cloud account is of membership type organization, list of + * accounts excluded from offering. + * + * @param excludedAccountIds the excludedAccountIds value to set. + * @return the SecurityConnectorPropertiesOrganizationalData object itself. + */ + public SecurityConnectorPropertiesOrganizationalData withExcludedAccountIds(List excludedAccountIds) { + this.excludedAccountIds = excludedAccountIds; + 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/OnPremiseIotSensors.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectors.java similarity index 52% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseIotSensors.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectors.java index faa8fa3c2ee1c..cbad6d001bef6 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseIotSensors.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectors.java @@ -4,147 +4,165 @@ package com.azure.resourcemanager.security.models; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.StreamResponse; import com.azure.core.util.Context; -import java.io.InputStream; -/** Resource collection API of OnPremiseIotSensors. */ -public interface OnPremiseIotSensors { +/** Resource collection API of SecurityConnectors. */ +public interface SecurityConnectors { /** - * List on-premise IoT sensors. + * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to + * get the next page of security connectors for the specified 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 on-premise IoT sensors. + * @return list of security connectors response. */ - OnPremiseIotSensorsList list(); + PagedIterable list(); /** - * List on-premise IoT sensors. + * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to + * get the next page of security connectors for the specified 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 on-premise IoT sensors. + * @return list of security connectors response. */ - Response listWithResponse(Context context); + PagedIterable list(Context context); /** - * Get on-premise IoT sensor. + * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to + * get the next page of security connectors for the specified resource group. * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. + * @param resourceGroupName The name of the resource group within the user's subscription. 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 on-premise IoT sensor. + * @return list of security connectors response. */ - OnPremiseIotSensor get(String onPremiseIotSensorName); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Get on-premise IoT sensor. + * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to + * get the next page of security connectors for the specified resource group. * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. + * @param resourceGroupName The name of the resource group within the user's subscription. 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 on-premise IoT sensor. + * @return list of security connectors response. */ - Response getWithResponse(String onPremiseIotSensorName, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Create or update on-premise IoT sensor. + * Retrieves details of a specific security connector. * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. + * @param resourceGroupName The name of the resource group within the user's subscription. 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 on-premise IoT sensor. + * @return the security connector resource. */ - OnPremiseIotSensor createOrUpdate(String onPremiseIotSensorName); + SecurityConnector getByResourceGroup(String resourceGroupName, String securityConnectorName); /** - * Create or update on-premise IoT sensor. + * Retrieves details of a specific security connector. * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. + * @param resourceGroupName The name of the resource group within the user's subscription. 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 on-premise IoT sensor. + * @return the security connector resource. */ - Response createOrUpdateWithResponse(String onPremiseIotSensorName, Context context); + Response getByResourceGroupWithResponse( + String resourceGroupName, String securityConnectorName, Context context); /** - * Delete on-premise IoT sensor. + * Deletes a security connector. * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. + * @param resourceGroupName The name of the resource group within the user's subscription. 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 delete(String onPremiseIotSensorName); + void deleteByResourceGroup(String resourceGroupName, String securityConnectorName); /** - * Delete on-premise IoT sensor. + * Deletes a security connector. * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. + * @param resourceGroupName The name of the resource group within the user's subscription. 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 response. */ - Response deleteWithResponse(String onPremiseIotSensorName, Context context); + Response deleteWithResponse(String resourceGroupName, String securityConnectorName, Context context); /** - * Download sensor activation file. + * Retrieves details of a specific security connector. * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. + * @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 response. + * @return the security connector resource. */ - InputStream downloadActivation(String onPremiseIotSensorName); + SecurityConnector getById(String id); /** - * Download sensor activation file. + * Retrieves details of a specific security connector. * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. + * @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 response. + * @return the security connector resource. */ - StreamResponse downloadActivationWithResponse(String onPremiseIotSensorName, Context context); + Response getByIdWithResponse(String id, Context context); /** - * Download file for reset password of the sensor. + * Deletes a security connector. * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param body Input for reset password. + * @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 response. */ - InputStream downloadResetPassword(String onPremiseIotSensorName, ResetPasswordInput body); + void deleteById(String id); /** - * Download file for reset password of the sensor. + * Deletes a security connector. * - * @param onPremiseIotSensorName Name of the on-premise IoT sensor. - * @param body Input for reset password. + * @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 response. */ - StreamResponse downloadResetPasswordWithResponse( - String onPremiseIotSensorName, ResetPasswordInput body, Context context); + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SecurityConnector resource. + * + * @param name resource name. + * @return the first stage of the new SecurityConnector definition. + */ + SecurityConnector.DefinitionStages.Blank define(String name); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorsList.java similarity index 63% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceList.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorsList.java index 24fd4db7ce11e..fe6da46759962 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorsList.java @@ -6,51 +6,50 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.DeviceInner; +import com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of Devices. */ +/** List of security connectors response. */ @Fluent -public final class DeviceList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeviceList.class); +public final class SecurityConnectorsList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityConnectorsList.class); /* - * List of devices + * The list of security connectors under the given scope. */ @JsonProperty(value = "value", required = true) - private List value; + private List value; /* - * When there are too many devices for one page, use this URI to fetch the - * next page. + * The URI to fetch the next page. */ @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** - * Get the value property: List of devices. + * Get the value property: The list of security connectors under the given scope. * * @return the value value. */ - public List value() { + public List value() { return this.value; } /** - * Set the value property: List of devices. + * Set the value property: The list of security connectors under the given scope. * * @param value the value value to set. - * @return the DeviceList object itself. + * @return the SecurityConnectorsList object itself. */ - public DeviceList withValue(List value) { + public SecurityConnectorsList withValue(List value) { this.value = value; return this; } /** - * Get the nextLink property: When there are too many devices for one page, use this URI to fetch the next page. + * Get the nextLink property: The URI to fetch the next page. * * @return the nextLink value. */ @@ -67,7 +66,7 @@ public void validate() { if (value() == null) { throw logger .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model DeviceList")); + new IllegalArgumentException("Missing required property value in model SecurityConnectorsList")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolution.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolution.java index 59c6c677f679b..01825c3be26b1 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolution.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolution.java @@ -29,6 +29,13 @@ public interface SecuritySolution { */ String type(); + /** + * Gets the location property: Location where the resource is stored. + * + * @return the location value. + */ + String location(); + /** * Gets the securityFamily property: The security family of the security solution. * @@ -57,13 +64,6 @@ public interface SecuritySolution { */ String protectionStatus(); - /** - * Gets the location property: Location where the resource is stored. - * - * @return the location value. - */ - String location(); - /** * Gets the inner com.azure.resourcemanager.security.fluent.models.SecuritySolutionInner object. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionsReferenceData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionsReferenceData.java index a3e4ced14832e..4531708f1001a 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionsReferenceData.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionsReferenceData.java @@ -5,65 +5,46 @@ package com.azure.resourcemanager.security.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.fluent.models.SecuritySolutionsReferenceDataProperties; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The SecuritySolutionsReferenceData model. */ -@JsonFlatten @Fluent -public class SecuritySolutionsReferenceData extends ProxyResource { +public final class SecuritySolutionsReferenceData extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(SecuritySolutionsReferenceData.class); /* - * The security family of the security solution + * The properties property. */ - @JsonProperty(value = "properties.securityFamily", required = true) - private SecurityFamily securityFamily; + @JsonProperty(value = "properties", required = true) + private SecuritySolutionsReferenceDataProperties innerProperties = new SecuritySolutionsReferenceDataProperties(); /* - * The security solutions' vendor name - */ - @JsonProperty(value = "properties.alertVendorName", required = true) - private String alertVendorName; - - /* - * The security solutions' package info url - */ - @JsonProperty(value = "properties.packageInfoUrl", required = true) - private String packageInfoUrl; - - /* - * The security solutions' product name - */ - @JsonProperty(value = "properties.productName", required = true) - private String productName; - - /* - * The security solutions' publisher - */ - @JsonProperty(value = "properties.publisher", required = true) - private String publisher; - - /* - * The security solutions' publisher display name + * Location where the resource is stored */ - @JsonProperty(value = "properties.publisherDisplayName", required = true) - private String publisherDisplayName; + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; - /* - * The security solutions' template + /** + * Get the innerProperties property: The properties property. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.template", required = true) - private String template; + private SecuritySolutionsReferenceDataProperties innerProperties() { + return this.innerProperties; + } - /* - * Location where the resource is stored + /** + * Get the location property: Location where the resource is stored. + * + * @return the location value. */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; + public String location() { + return this.location; + } /** * Get the securityFamily property: The security family of the security solution. @@ -71,7 +52,7 @@ public class SecuritySolutionsReferenceData extends ProxyResource { * @return the securityFamily value. */ public SecurityFamily securityFamily() { - return this.securityFamily; + return this.innerProperties() == null ? null : this.innerProperties().securityFamily(); } /** @@ -81,7 +62,10 @@ public SecurityFamily securityFamily() { * @return the SecuritySolutionsReferenceData object itself. */ public SecuritySolutionsReferenceData withSecurityFamily(SecurityFamily securityFamily) { - this.securityFamily = securityFamily; + if (this.innerProperties() == null) { + this.innerProperties = new SecuritySolutionsReferenceDataProperties(); + } + this.innerProperties().withSecurityFamily(securityFamily); return this; } @@ -91,7 +75,7 @@ public SecuritySolutionsReferenceData withSecurityFamily(SecurityFamily security * @return the alertVendorName value. */ public String alertVendorName() { - return this.alertVendorName; + return this.innerProperties() == null ? null : this.innerProperties().alertVendorName(); } /** @@ -101,7 +85,10 @@ public String alertVendorName() { * @return the SecuritySolutionsReferenceData object itself. */ public SecuritySolutionsReferenceData withAlertVendorName(String alertVendorName) { - this.alertVendorName = alertVendorName; + if (this.innerProperties() == null) { + this.innerProperties = new SecuritySolutionsReferenceDataProperties(); + } + this.innerProperties().withAlertVendorName(alertVendorName); return this; } @@ -111,7 +98,7 @@ public SecuritySolutionsReferenceData withAlertVendorName(String alertVendorName * @return the packageInfoUrl value. */ public String packageInfoUrl() { - return this.packageInfoUrl; + return this.innerProperties() == null ? null : this.innerProperties().packageInfoUrl(); } /** @@ -121,7 +108,10 @@ public String packageInfoUrl() { * @return the SecuritySolutionsReferenceData object itself. */ public SecuritySolutionsReferenceData withPackageInfoUrl(String packageInfoUrl) { - this.packageInfoUrl = packageInfoUrl; + if (this.innerProperties() == null) { + this.innerProperties = new SecuritySolutionsReferenceDataProperties(); + } + this.innerProperties().withPackageInfoUrl(packageInfoUrl); return this; } @@ -131,7 +121,7 @@ public SecuritySolutionsReferenceData withPackageInfoUrl(String packageInfoUrl) * @return the productName value. */ public String productName() { - return this.productName; + return this.innerProperties() == null ? null : this.innerProperties().productName(); } /** @@ -141,7 +131,10 @@ public String productName() { * @return the SecuritySolutionsReferenceData object itself. */ public SecuritySolutionsReferenceData withProductName(String productName) { - this.productName = productName; + if (this.innerProperties() == null) { + this.innerProperties = new SecuritySolutionsReferenceDataProperties(); + } + this.innerProperties().withProductName(productName); return this; } @@ -151,7 +144,7 @@ public SecuritySolutionsReferenceData withProductName(String productName) { * @return the publisher value. */ public String publisher() { - return this.publisher; + return this.innerProperties() == null ? null : this.innerProperties().publisher(); } /** @@ -161,7 +154,10 @@ public String publisher() { * @return the SecuritySolutionsReferenceData object itself. */ public SecuritySolutionsReferenceData withPublisher(String publisher) { - this.publisher = publisher; + if (this.innerProperties() == null) { + this.innerProperties = new SecuritySolutionsReferenceDataProperties(); + } + this.innerProperties().withPublisher(publisher); return this; } @@ -171,7 +167,7 @@ public SecuritySolutionsReferenceData withPublisher(String publisher) { * @return the publisherDisplayName value. */ public String publisherDisplayName() { - return this.publisherDisplayName; + return this.innerProperties() == null ? null : this.innerProperties().publisherDisplayName(); } /** @@ -181,7 +177,10 @@ public String publisherDisplayName() { * @return the SecuritySolutionsReferenceData object itself. */ public SecuritySolutionsReferenceData withPublisherDisplayName(String publisherDisplayName) { - this.publisherDisplayName = publisherDisplayName; + if (this.innerProperties() == null) { + this.innerProperties = new SecuritySolutionsReferenceDataProperties(); + } + this.innerProperties().withPublisherDisplayName(publisherDisplayName); return this; } @@ -191,7 +190,7 @@ public SecuritySolutionsReferenceData withPublisherDisplayName(String publisherD * @return the template value. */ public String template() { - return this.template; + return this.innerProperties() == null ? null : this.innerProperties().template(); } /** @@ -201,66 +200,26 @@ public String template() { * @return the SecuritySolutionsReferenceData object itself. */ public SecuritySolutionsReferenceData withTemplate(String template) { - this.template = template; + if (this.innerProperties() == null) { + this.innerProperties = new SecuritySolutionsReferenceDataProperties(); + } + this.innerProperties().withTemplate(template); return this; } - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (securityFamily() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property securityFamily in model SecuritySolutionsReferenceData")); - } - if (alertVendorName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property alertVendorName in model SecuritySolutionsReferenceData")); - } - if (packageInfoUrl() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property packageInfoUrl in model SecuritySolutionsReferenceData")); - } - if (productName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property productName in model SecuritySolutionsReferenceData")); - } - if (publisher() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property publisher in model SecuritySolutionsReferenceData")); - } - if (publisherDisplayName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property publisherDisplayName in model SecuritySolutionsReferenceData")); - } - if (template() == null) { + if (innerProperties() == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - "Missing required property template in model SecuritySolutionsReferenceData")); + "Missing required property innerProperties in model SecuritySolutionsReferenceData")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Sensor.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Sensor.java deleted file mode 100644 index 466b9593cf6a5..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Sensor.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.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Sensor data. */ -@Immutable -public final class Sensor { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Sensor.class); - - /* - * Sensor name - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Zone Name. - */ - @JsonProperty(value = "zone", access = JsonProperty.Access.WRITE_ONLY) - private String zone; - - /** - * Get the name property: Sensor name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the zone property: Zone Name. - * - * @return the zone value. - */ - public String zone() { - return this.zone; - } - - /** - * 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/SensorStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensorStatus.java deleted file mode 100644 index bfddff37d516d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensorStatus.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SensorStatus. */ -public final class SensorStatus extends ExpandableStringEnum { - /** Static value Ok for SensorStatus. */ - public static final SensorStatus OK = fromString("Ok"); - - /** Static value Disconnected for SensorStatus. */ - public static final SensorStatus DISCONNECTED = fromString("Disconnected"); - - /** Static value Unavailable for SensorStatus. */ - public static final SensorStatus UNAVAILABLE = fromString("Unavailable"); - - /** - * Creates or finds a SensorStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding SensorStatus. - */ - @JsonCreator - public static SensorStatus fromString(String name) { - return fromString(name, SensorStatus.class); - } - - /** @return known SensorStatus values. */ - public static Collection values() { - return values(SensorStatus.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensorType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensorType.java deleted file mode 100644 index b500d0c1bd7bd..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensorType.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SensorType. */ -public final class SensorType extends ExpandableStringEnum { - /** Static value Ot for SensorType. */ - public static final SensorType OT = fromString("Ot"); - - /** Static value Enterprise for SensorType. */ - public static final SensorType ENTERPRISE = fromString("Enterprise"); - - /** - * Creates or finds a SensorType from its string representation. - * - * @param name a name to look for. - * @return the corresponding SensorType. - */ - @JsonCreator - public static SensorType fromString(String name) { - return fromString(name, SensorType.class); - } - - /** @return known SensorType values. */ - public static Collection values() { - return values(SensorType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityProperties.java index 8ff2556b12839..d2d1eaf1ba990 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityProperties.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -32,6 +33,7 @@ public final class ServerVulnerabilityProperties extends AdditionalData { * Dictionary from cvss version to cvss details object */ @JsonProperty(value = "cvss", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map cvss; /* diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingsSettingName.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingsSettingName.java index 4660a0cb49d9f..fa367d46a61a7 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingsSettingName.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingsSettingName.java @@ -16,6 +16,10 @@ public final class SettingsSettingName extends ExpandableStringEnum { + /** Static value High for SeverityEnum. */ + public static final SeverityEnum HIGH = fromString("High"); + + /** Static value Medium for SeverityEnum. */ + public static final SeverityEnum MEDIUM = fromString("Medium"); + + /** Static value Low for SeverityEnum. */ + public static final SeverityEnum LOW = fromString("Low"); + + /** + * Creates or finds a SeverityEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding SeverityEnum. + */ + @JsonCreator + public static SeverityEnum fromString(String name) { + return fromString(name, SeverityEnum.class); + } + + /** @return known SeverityEnum values. */ + public static Collection values() { + return values(SeverityEnum.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Site.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Site.java deleted file mode 100644 index 6d4491aa7c59b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Site.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.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Site data. */ -@Immutable -public final class Site { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Site.class); - - /* - * Site display name - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /** - * Get the displayName property: Site display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SupportedCloudEnum.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SupportedCloudEnum.java new file mode 100644 index 0000000000000..8fe5dba765e9f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SupportedCloudEnum.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SupportedCloudEnum. */ +public final class SupportedCloudEnum extends ExpandableStringEnum { + /** Static value AWS for SupportedCloudEnum. */ + public static final SupportedCloudEnum AWS = fromString("AWS"); + + /** + * Creates or finds a SupportedCloudEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding SupportedCloudEnum. + */ + @JsonCreator + public static SupportedCloudEnum fromString(String name) { + return fromString(name, SupportedCloudEnum.class); + } + + /** @return known SupportedCloudEnum values. */ + public static Collection values() { + return values(SupportedCloudEnum.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tactics.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tactics.java new file mode 100644 index 0000000000000..41d0654fa3a48 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tactics.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Tactics. */ +public final class Tactics extends ExpandableStringEnum { + /** Static value Reconnaissance for Tactics. */ + public static final Tactics RECONNAISSANCE = fromString("Reconnaissance"); + + /** Static value Resource Development for Tactics. */ + public static final Tactics RESOURCE_DEVELOPMENT = fromString("Resource Development"); + + /** Static value Initial Access for Tactics. */ + public static final Tactics INITIAL_ACCESS = fromString("Initial Access"); + + /** Static value Execution for Tactics. */ + public static final Tactics EXECUTION = fromString("Execution"); + + /** Static value Persistence for Tactics. */ + public static final Tactics PERSISTENCE = fromString("Persistence"); + + /** Static value Privilege Escalation for Tactics. */ + public static final Tactics PRIVILEGE_ESCALATION = fromString("Privilege Escalation"); + + /** Static value Defense Evasion for Tactics. */ + public static final Tactics DEFENSE_EVASION = fromString("Defense Evasion"); + + /** Static value Credential Access for Tactics. */ + public static final Tactics CREDENTIAL_ACCESS = fromString("Credential Access"); + + /** Static value Discovery for Tactics. */ + public static final Tactics DISCOVERY = fromString("Discovery"); + + /** Static value Lateral Movement for Tactics. */ + public static final Tactics LATERAL_MOVEMENT = fromString("Lateral Movement"); + + /** Static value Collection for Tactics. */ + public static final Tactics COLLECTION = fromString("Collection"); + + /** Static value Command and Control for Tactics. */ + public static final Tactics COMMAND_AND_CONTROL = fromString("Command and Control"); + + /** Static value Exfiltration for Tactics. */ + public static final Tactics EXFILTRATION = fromString("Exfiltration"); + + /** Static value Impact for Tactics. */ + public static final Tactics IMPACT = fromString("Impact"); + + /** + * Creates or finds a Tactics from its string representation. + * + * @param name a name to look for. + * @return the corresponding Tactics. + */ + @JsonCreator + public static Tactics fromString(String name) { + return fromString(name, Tactics.class); + } + + /** @return known Tactics values. */ + public static Collection values() { + return values(Tactics.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tags.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tags.java index a9c96a8649d3f..498ad6e3ebf7b 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tags.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tags.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -19,6 +20,7 @@ public class Tags { * A list of key value pairs that describe the resource. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TagsResource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TagsResource.java index e9d9dedf0fe32..eabc7a645a52e 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TagsResource.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TagsResource.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -19,6 +20,7 @@ public class TagsResource { * Resource tags */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Techniques.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Techniques.java new file mode 100644 index 0000000000000..840872cd8e0a7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Techniques.java @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Techniques. */ +public final class Techniques extends ExpandableStringEnum { + /** Static value Abuse Elevation Control Mechanism for Techniques. */ + public static final Techniques ABUSE_ELEVATION_CONTROL_MECHANISM = fromString("Abuse Elevation Control Mechanism"); + + /** Static value Access Token Manipulation for Techniques. */ + public static final Techniques ACCESS_TOKEN_MANIPULATION = fromString("Access Token Manipulation"); + + /** Static value Account Discovery for Techniques. */ + public static final Techniques ACCOUNT_DISCOVERY = fromString("Account Discovery"); + + /** Static value Account Manipulation for Techniques. */ + public static final Techniques ACCOUNT_MANIPULATION = fromString("Account Manipulation"); + + /** Static value Active Scanning for Techniques. */ + public static final Techniques ACTIVE_SCANNING = fromString("Active Scanning"); + + /** Static value Application Layer Protocol for Techniques. */ + public static final Techniques APPLICATION_LAYER_PROTOCOL = fromString("Application Layer Protocol"); + + /** Static value Audio Capture for Techniques. */ + public static final Techniques AUDIO_CAPTURE = fromString("Audio Capture"); + + /** Static value Boot or Logon Autostart Execution for Techniques. */ + public static final Techniques BOOT_OR_LOGON_AUTOSTART_EXECUTION = fromString("Boot or Logon Autostart Execution"); + + /** Static value Boot or Logon Initialization Scripts for Techniques. */ + public static final Techniques BOOT_OR_LOGON_INITIALIZATION_SCRIPTS = + fromString("Boot or Logon Initialization Scripts"); + + /** Static value Brute Force for Techniques. */ + public static final Techniques BRUTE_FORCE = fromString("Brute Force"); + + /** Static value Cloud Infrastructure Discovery for Techniques. */ + public static final Techniques CLOUD_INFRASTRUCTURE_DISCOVERY = fromString("Cloud Infrastructure Discovery"); + + /** Static value Cloud Service Dashboard for Techniques. */ + public static final Techniques CLOUD_SERVICE_DASHBOARD = fromString("Cloud Service Dashboard"); + + /** Static value Cloud Service Discovery for Techniques. */ + public static final Techniques CLOUD_SERVICE_DISCOVERY = fromString("Cloud Service Discovery"); + + /** Static value Command and Scripting Interpreter for Techniques. */ + public static final Techniques COMMAND_AND_SCRIPTING_INTERPRETER = fromString("Command and Scripting Interpreter"); + + /** Static value Compromise Client Software Binary for Techniques. */ + public static final Techniques COMPROMISE_CLIENT_SOFTWARE_BINARY = fromString("Compromise Client Software Binary"); + + /** Static value Compromise Infrastructure for Techniques. */ + public static final Techniques COMPROMISE_INFRASTRUCTURE = fromString("Compromise Infrastructure"); + + /** Static value Container and Resource Discovery for Techniques. */ + public static final Techniques CONTAINER_AND_RESOURCE_DISCOVERY = fromString("Container and Resource Discovery"); + + /** Static value Create Account for Techniques. */ + public static final Techniques CREATE_ACCOUNT = fromString("Create Account"); + + /** Static value Create or Modify System Process for Techniques. */ + public static final Techniques CREATE_OR_MODIFY_SYSTEM_PROCESS = fromString("Create or Modify System Process"); + + /** Static value Credentials from Password Stores for Techniques. */ + public static final Techniques CREDENTIALS_FROM_PASSWORD_STORES = fromString("Credentials from Password Stores"); + + /** Static value Data Destruction for Techniques. */ + public static final Techniques DATA_DESTRUCTION = fromString("Data Destruction"); + + /** Static value Data Encrypted for Impact for Techniques. */ + public static final Techniques DATA_ENCRYPTED_FOR_IMPACT = fromString("Data Encrypted for Impact"); + + /** Static value Data from Cloud Storage Object for Techniques. */ + public static final Techniques DATA_FROM_CLOUD_STORAGE_OBJECT = fromString("Data from Cloud Storage Object"); + + /** Static value Data from Configuration Repository for Techniques. */ + public static final Techniques DATA_FROM_CONFIGURATION_REPOSITORY = + fromString("Data from Configuration Repository"); + + /** Static value Data from Information Repositories for Techniques. */ + public static final Techniques DATA_FROM_INFORMATION_REPOSITORIES = + fromString("Data from Information Repositories"); + + /** Static value Data from Local System for Techniques. */ + public static final Techniques DATA_FROM_LOCAL_SYSTEM = fromString("Data from Local System"); + + /** Static value Data Manipulation for Techniques. */ + public static final Techniques DATA_MANIPULATION = fromString("Data Manipulation"); + + /** Static value Data Staged for Techniques. */ + public static final Techniques DATA_STAGED = fromString("Data Staged"); + + /** Static value Defacement for Techniques. */ + public static final Techniques DEFACEMENT = fromString("Defacement"); + + /** Static value Deobfuscate/Decode Files or Information for Techniques. */ + public static final Techniques DEOBFUSCATE_DECODE_FILES_OR_INFORMATION = + fromString("Deobfuscate/Decode Files or Information"); + + /** Static value Disk Wipe for Techniques. */ + public static final Techniques DISK_WIPE = fromString("Disk Wipe"); + + /** Static value Domain Trust Discovery for Techniques. */ + public static final Techniques DOMAIN_TRUST_DISCOVERY = fromString("Domain Trust Discovery"); + + /** Static value Drive-by Compromise for Techniques. */ + public static final Techniques DRIVE_BY_COMPROMISE = fromString("Drive-by Compromise"); + + /** Static value Dynamic Resolution for Techniques. */ + public static final Techniques DYNAMIC_RESOLUTION = fromString("Dynamic Resolution"); + + /** Static value Endpoint Denial of Service for Techniques. */ + public static final Techniques ENDPOINT_DENIAL_OF_SERVICE = fromString("Endpoint Denial of Service"); + + /** Static value Event Triggered Execution for Techniques. */ + public static final Techniques EVENT_TRIGGERED_EXECUTION = fromString("Event Triggered Execution"); + + /** Static value Exfiltration Over Alternative Protocol for Techniques. */ + public static final Techniques EXFILTRATION_OVER_ALTERNATIVE_PROTOCOL = + fromString("Exfiltration Over Alternative Protocol"); + + /** Static value Exploit Public-Facing Application for Techniques. */ + public static final Techniques EXPLOIT_PUBLIC_FACING_APPLICATION = fromString("Exploit Public-Facing Application"); + + /** Static value Exploitation for Client Execution for Techniques. */ + public static final Techniques EXPLOITATION_FOR_CLIENT_EXECUTION = fromString("Exploitation for Client Execution"); + + /** Static value Exploitation for Credential Access for Techniques. */ + public static final Techniques EXPLOITATION_FOR_CREDENTIAL_ACCESS = + fromString("Exploitation for Credential Access"); + + /** Static value Exploitation for Defense Evasion for Techniques. */ + public static final Techniques EXPLOITATION_FOR_DEFENSE_EVASION = fromString("Exploitation for Defense Evasion"); + + /** Static value Exploitation for Privilege Escalation for Techniques. */ + public static final Techniques EXPLOITATION_FOR_PRIVILEGE_ESCALATION = + fromString("Exploitation for Privilege Escalation"); + + /** Static value Exploitation of Remote Services for Techniques. */ + public static final Techniques EXPLOITATION_OF_REMOTE_SERVICES = fromString("Exploitation of Remote Services"); + + /** Static value External Remote Services for Techniques. */ + public static final Techniques EXTERNAL_REMOTE_SERVICES = fromString("External Remote Services"); + + /** Static value Fallback Channels for Techniques. */ + public static final Techniques FALLBACK_CHANNELS = fromString("Fallback Channels"); + + /** Static value File and Directory Discovery for Techniques. */ + public static final Techniques FILE_AND_DIRECTORY_DISCOVERY = fromString("File and Directory Discovery"); + + /** Static value Gather Victim Network Information for Techniques. */ + public static final Techniques GATHER_VICTIM_NETWORK_INFORMATION = fromString("Gather Victim Network Information"); + + /** Static value Hide Artifacts for Techniques. */ + public static final Techniques HIDE_ARTIFACTS = fromString("Hide Artifacts"); + + /** Static value Hijack Execution Flow for Techniques. */ + public static final Techniques HIJACK_EXECUTION_FLOW = fromString("Hijack Execution Flow"); + + /** Static value Impair Defenses for Techniques. */ + public static final Techniques IMPAIR_DEFENSES = fromString("Impair Defenses"); + + /** Static value Implant Container Image for Techniques. */ + public static final Techniques IMPLANT_CONTAINER_IMAGE = fromString("Implant Container Image"); + + /** Static value Indicator Removal on Host for Techniques. */ + public static final Techniques INDICATOR_REMOVAL_ON_HOST = fromString("Indicator Removal on Host"); + + /** Static value Indirect Command Execution for Techniques. */ + public static final Techniques INDIRECT_COMMAND_EXECUTION = fromString("Indirect Command Execution"); + + /** Static value Ingress Tool Transfer for Techniques. */ + public static final Techniques INGRESS_TOOL_TRANSFER = fromString("Ingress Tool Transfer"); + + /** Static value Input Capture for Techniques. */ + public static final Techniques INPUT_CAPTURE = fromString("Input Capture"); + + /** Static value Inter-Process Communication for Techniques. */ + public static final Techniques INTER_PROCESS_COMMUNICATION = fromString("Inter-Process Communication"); + + /** Static value Lateral Tool Transfer for Techniques. */ + public static final Techniques LATERAL_TOOL_TRANSFER = fromString("Lateral Tool Transfer"); + + /** Static value Man-in-the-Middle for Techniques. */ + public static final Techniques MAN_IN_THE_MIDDLE = fromString("Man-in-the-Middle"); + + /** Static value Masquerading for Techniques. */ + public static final Techniques MASQUERADING = fromString("Masquerading"); + + /** Static value Modify Authentication Process for Techniques. */ + public static final Techniques MODIFY_AUTHENTICATION_PROCESS = fromString("Modify Authentication Process"); + + /** Static value Modify Registry for Techniques. */ + public static final Techniques MODIFY_REGISTRY = fromString("Modify Registry"); + + /** Static value Network Denial of Service for Techniques. */ + public static final Techniques NETWORK_DENIAL_OF_SERVICE = fromString("Network Denial of Service"); + + /** Static value Network Service Scanning for Techniques. */ + public static final Techniques NETWORK_SERVICE_SCANNING = fromString("Network Service Scanning"); + + /** Static value Network Sniffing for Techniques. */ + public static final Techniques NETWORK_SNIFFING = fromString("Network Sniffing"); + + /** Static value Non-Application Layer Protocol for Techniques. */ + public static final Techniques NON_APPLICATION_LAYER_PROTOCOL = fromString("Non-Application Layer Protocol"); + + /** Static value Non-Standard Port for Techniques. */ + public static final Techniques NON_STANDARD_PORT = fromString("Non-Standard Port"); + + /** Static value Obtain Capabilities for Techniques. */ + public static final Techniques OBTAIN_CAPABILITIES = fromString("Obtain Capabilities"); + + /** Static value Obfuscated Files or Information for Techniques. */ + public static final Techniques OBFUSCATED_FILES_OR_INFORMATION = fromString("Obfuscated Files or Information"); + + /** Static value Office Application Startup for Techniques. */ + public static final Techniques OFFICE_APPLICATION_STARTUP = fromString("Office Application Startup"); + + /** Static value OS Credential Dumping for Techniques. */ + public static final Techniques OS_CREDENTIAL_DUMPING = fromString("OS Credential Dumping"); + + /** Static value Permission Groups Discovery for Techniques. */ + public static final Techniques PERMISSION_GROUPS_DISCOVERY = fromString("Permission Groups Discovery"); + + /** Static value Phishing for Techniques. */ + public static final Techniques PHISHING = fromString("Phishing"); + + /** Static value Pre-OS Boot for Techniques. */ + public static final Techniques PRE_OS_BOOT = fromString("Pre-OS Boot"); + + /** Static value Process Discovery for Techniques. */ + public static final Techniques PROCESS_DISCOVERY = fromString("Process Discovery"); + + /** Static value Process Injection for Techniques. */ + public static final Techniques PROCESS_INJECTION = fromString("Process Injection"); + + /** Static value Protocol Tunneling for Techniques. */ + public static final Techniques PROTOCOL_TUNNELING = fromString("Protocol Tunneling"); + + /** Static value Proxy for Techniques. */ + public static final Techniques PROXY = fromString("Proxy"); + + /** Static value Query Registry for Techniques. */ + public static final Techniques QUERY_REGISTRY = fromString("Query Registry"); + + /** Static value Remote Access Software for Techniques. */ + public static final Techniques REMOTE_ACCESS_SOFTWARE = fromString("Remote Access Software"); + + /** Static value Remote Service Session Hijacking for Techniques. */ + public static final Techniques REMOTE_SERVICE_SESSION_HIJACKING = fromString("Remote Service Session Hijacking"); + + /** Static value Remote Services for Techniques. */ + public static final Techniques REMOTE_SERVICES = fromString("Remote Services"); + + /** Static value Remote System Discovery for Techniques. */ + public static final Techniques REMOTE_SYSTEM_DISCOVERY = fromString("Remote System Discovery"); + + /** Static value Resource Hijacking for Techniques. */ + public static final Techniques RESOURCE_HIJACKING = fromString("Resource Hijacking"); + + /** Static value Scheduled Task/Job for Techniques. */ + public static final Techniques SCHEDULED_TASK_JOB = fromString("Scheduled Task/Job"); + + /** Static value Screen Capture for Techniques. */ + public static final Techniques SCREEN_CAPTURE = fromString("Screen Capture"); + + /** Static value Search Victim-Owned Websites for Techniques. */ + public static final Techniques SEARCH_VICTIM_OWNED_WEBSITES = fromString("Search Victim-Owned Websites"); + + /** Static value Server Software Component for Techniques. */ + public static final Techniques SERVER_SOFTWARE_COMPONENT = fromString("Server Software Component"); + + /** Static value Service Stop for Techniques. */ + public static final Techniques SERVICE_STOP = fromString("Service Stop"); + + /** Static value Signed Binary Proxy Execution for Techniques. */ + public static final Techniques SIGNED_BINARY_PROXY_EXECUTION = fromString("Signed Binary Proxy Execution"); + + /** Static value Software Deployment Tools for Techniques. */ + public static final Techniques SOFTWARE_DEPLOYMENT_TOOLS = fromString("Software Deployment Tools"); + + /** Static value SQL Stored Procedures for Techniques. */ + public static final Techniques SQL_STORED_PROCEDURES = fromString("SQL Stored Procedures"); + + /** Static value Steal or Forge Kerberos Tickets for Techniques. */ + public static final Techniques STEAL_OR_FORGE_KERBEROS_TICKETS = fromString("Steal or Forge Kerberos Tickets"); + + /** Static value Subvert Trust Controls for Techniques. */ + public static final Techniques SUBVERT_TRUST_CONTROLS = fromString("Subvert Trust Controls"); + + /** Static value Supply Chain Compromise for Techniques. */ + public static final Techniques SUPPLY_CHAIN_COMPROMISE = fromString("Supply Chain Compromise"); + + /** Static value System Information Discovery for Techniques. */ + public static final Techniques SYSTEM_INFORMATION_DISCOVERY = fromString("System Information Discovery"); + + /** Static value Taint Shared Content for Techniques. */ + public static final Techniques TAINT_SHARED_CONTENT = fromString("Taint Shared Content"); + + /** Static value Traffic Signaling for Techniques. */ + public static final Techniques TRAFFIC_SIGNALING = fromString("Traffic Signaling"); + + /** Static value Transfer Data to Cloud Account for Techniques. */ + public static final Techniques TRANSFER_DATA_TO_CLOUD_ACCOUNT = fromString("Transfer Data to Cloud Account"); + + /** Static value Trusted Relationship for Techniques. */ + public static final Techniques TRUSTED_RELATIONSHIP = fromString("Trusted Relationship"); + + /** Static value Unsecured Credentials for Techniques. */ + public static final Techniques UNSECURED_CREDENTIALS = fromString("Unsecured Credentials"); + + /** Static value User Execution for Techniques. */ + public static final Techniques USER_EXECUTION = fromString("User Execution"); + + /** Static value Valid Accounts for Techniques. */ + public static final Techniques VALID_ACCOUNTS = fromString("Valid Accounts"); + + /** Static value Windows Management Instrumentation for Techniques. */ + public static final Techniques WINDOWS_MANAGEMENT_INSTRUMENTATION = + fromString("Windows Management Instrumentation"); + + /** Static value File and Directory Permissions Modification for Techniques. */ + public static final Techniques FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION = + fromString("File and Directory Permissions Modification"); + + /** + * Creates or finds a Techniques from its string representation. + * + * @param name a name to look for. + * @return the corresponding Techniques. + */ + @JsonCreator + public static Techniques fromString(String name) { + return fromString(name, Techniques.class); + } + + /** @return known Techniques values. */ + public static Collection values() { + return values(Techniques.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TiStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TiStatus.java deleted file mode 100644 index 0d32231488780..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TiStatus.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for TiStatus. */ -public final class TiStatus extends ExpandableStringEnum { - /** Static value Ok for TiStatus. */ - public static final TiStatus OK = fromString("Ok"); - - /** Static value Failed for TiStatus. */ - public static final TiStatus FAILED = fromString("Failed"); - - /** Static value InProgress for TiStatus. */ - public static final TiStatus IN_PROGRESS = fromString("InProgress"); - - /** Static value UpdateAvailable for TiStatus. */ - public static final TiStatus UPDATE_AVAILABLE = fromString("UpdateAvailable"); - - /** - * Creates or finds a TiStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding TiStatus. - */ - @JsonCreator - public static TiStatus fromString(String name) { - return fromString(name, TiStatus.class); - } - - /** @return known TiStatus values. */ - public static Collection values() { - return values(TiStatus.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologyResource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologyResource.java index 0621d4ce55ddf..f742653cb9852 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologyResource.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologyResource.java @@ -31,6 +31,13 @@ public interface TopologyResource { */ String type(); + /** + * Gets the location property: Location where the resource is stored. + * + * @return the location value. + */ + String location(); + /** * Gets the calculatedDateTime property: The UTC time on which the topology was calculated. * @@ -45,13 +52,6 @@ public interface TopologyResource { */ List topologyResources(); - /** - * Gets the location property: Location where the resource is stored. - * - * @return the location value. - */ - String location(); - /** * Gets the inner com.azure.resourcemanager.security.fluent.models.TopologyResourceInner object. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TrackedResource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TrackedResource.java index 4d48619621c0d..25f7bb80f8131 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TrackedResource.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TrackedResource.java @@ -8,6 +8,7 @@ import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -39,6 +40,7 @@ public final class TrackedResource extends ProxyResource { * A list of key value pairs that describe the resource. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpdateIotSecuritySolutionData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpdateIotSecuritySolutionData.java index 5000ac37c6344..af5d535fe36b6 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpdateIotSecuritySolutionData.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpdateIotSecuritySolutionData.java @@ -5,30 +5,39 @@ package com.azure.resourcemanager.security.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.fluent.models.UpdateIoTSecuritySolutionProperties; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; /** The UpdateIotSecuritySolutionData model. */ -@JsonFlatten @Fluent -public class UpdateIotSecuritySolutionData extends TagsResource { +public final class UpdateIotSecuritySolutionData extends TagsResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateIotSecuritySolutionData.class); /* - * Properties of the IoT Security solution's user defined resources. + * Security Solution data */ - @JsonProperty(value = "properties.userDefinedResources") - private UserDefinedResourcesProperties userDefinedResources; + @JsonProperty(value = "properties") + private UpdateIoTSecuritySolutionProperties innerProperties; - /* - * List of the configuration status for each recommendation type. + /** + * Get the innerProperties property: Security Solution data. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.recommendationsConfiguration") - private List recommendationsConfiguration; + private UpdateIoTSecuritySolutionProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public UpdateIotSecuritySolutionData withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the userDefinedResources property: Properties of the IoT Security solution's user defined resources. @@ -36,7 +45,7 @@ public class UpdateIotSecuritySolutionData extends TagsResource { * @return the userDefinedResources value. */ public UserDefinedResourcesProperties userDefinedResources() { - return this.userDefinedResources; + return this.innerProperties() == null ? null : this.innerProperties().userDefinedResources(); } /** @@ -46,7 +55,10 @@ public UserDefinedResourcesProperties userDefinedResources() { * @return the UpdateIotSecuritySolutionData object itself. */ public UpdateIotSecuritySolutionData withUserDefinedResources(UserDefinedResourcesProperties userDefinedResources) { - this.userDefinedResources = userDefinedResources; + if (this.innerProperties() == null) { + this.innerProperties = new UpdateIoTSecuritySolutionProperties(); + } + this.innerProperties().withUserDefinedResources(userDefinedResources); return this; } @@ -56,7 +68,7 @@ public UpdateIotSecuritySolutionData withUserDefinedResources(UserDefinedResourc * @return the recommendationsConfiguration value. */ public List recommendationsConfiguration() { - return this.recommendationsConfiguration; + return this.innerProperties() == null ? null : this.innerProperties().recommendationsConfiguration(); } /** @@ -67,14 +79,10 @@ public List recommendationsConfiguration( */ public UpdateIotSecuritySolutionData withRecommendationsConfiguration( List recommendationsConfiguration) { - this.recommendationsConfiguration = recommendationsConfiguration; - return this; - } - - /** {@inheritDoc} */ - @Override - public UpdateIotSecuritySolutionData withTags(Map tags) { - super.withTags(tags); + if (this.innerProperties() == null) { + this.innerProperties = new UpdateIoTSecuritySolutionProperties(); + } + this.innerProperties().withRecommendationsConfiguration(recommendationsConfiguration); return this; } @@ -86,11 +94,8 @@ public UpdateIotSecuritySolutionData withTags(Map tags) { @Override public void validate() { super.validate(); - if (userDefinedResources() != null) { - userDefinedResources().validate(); - } - if (recommendationsConfiguration() != null) { - recommendationsConfiguration().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpgradePackageDownloadInfo.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpgradePackageDownloadInfo.java deleted file mode 100644 index db2cd7bf0f18b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpgradePackageDownloadInfo.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.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Information on a specific package upgrade download. */ -@Immutable -public final class UpgradePackageDownloadInfo extends PackageDownloadInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UpgradePackageDownloadInfo.class); - - /* - * Minimum base version for upgrade - */ - @JsonProperty(value = "fromVersion", access = JsonProperty.Access.WRITE_ONLY) - private String fromVersion; - - /** - * Get the fromVersion property: Minimum base version for upgrade. - * - * @return the fromVersion value. - */ - public String fromVersion() { - return this.fromVersion; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VersionKind.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VersionKind.java deleted file mode 100644 index d367dff7a6284..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VersionKind.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VersionKind. */ -public final class VersionKind extends ExpandableStringEnum { - /** Static value Latest for VersionKind. */ - public static final VersionKind LATEST = fromString("Latest"); - - /** Static value Previous for VersionKind. */ - public static final VersionKind PREVIOUS = fromString("Previous"); - - /** Static value Preview for VersionKind. */ - public static final VersionKind PREVIEW = fromString("Preview"); - - /** - * Creates or finds a VersionKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding VersionKind. - */ - @JsonCreator - public static VersionKind fromString(String name) { - return fromString(name, VersionKind.class); - } - - /** @return known VersionKind values. */ - public static Collection values() { - return values(VersionKind.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsDeleteSamples.java deleted file mode 100644 index 6435ef904f05b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsDeleteSamples.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; - -import com.azure.core.util.Context; - -/** Samples for AdaptiveApplicationControls Delete. */ -public final class AdaptiveApplicationControlsDeleteSamples { - /** - * Sample code: Delete an application control machine group. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteAnApplicationControlMachineGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.adaptiveApplicationControls().deleteWithResponse("centralus", "GROUP1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsGetSamples.java deleted file mode 100644 index e62f4c3525725..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for AdaptiveApplicationControls Get. */ -public final class AdaptiveApplicationControlsGetSamples { - /** - * Sample code: Gets a configured application control VM/server group. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getsAConfiguredApplicationControlVMServerGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.adaptiveApplicationControls().getWithResponse("centralus", "ERELGROUP1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListByResourceGroupSamples.java deleted file mode 100644 index f17ef87594186..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListByResourceGroupSamples.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; - -import com.azure.core.util.Context; - -/** Samples for Alerts ListByResourceGroup. */ -public final class AlertsListByResourceGroupSamples { - /** - * Sample code: Get security alerts on a resource group. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityAlertsOnAResourceGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.alerts().listByResourceGroup("myRg1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListSamples.java deleted file mode 100644 index f2bfab347cfcc..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for Alerts List. */ -public final class AlertsListSamples { - /** - * Sample code: Get security alerts on a subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityAlertsOnASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.alerts().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesDeleteSamples.java deleted file mode 100644 index b04c72b507123..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesDeleteSamples.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; - -import com.azure.core.util.Context; - -/** Samples for AlertsSuppressionRules Delete. */ -public final class AlertsSuppressionRulesDeleteSamples { - /** - * Sample code: Delete suppression rule data for a subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteSuppressionRuleDataForASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.alertsSuppressionRules().deleteWithResponse("dismissIpAnomalyAlerts", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesGetSamples.java deleted file mode 100644 index bce501954a7a1..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for AlertsSuppressionRules Get. */ -public final class AlertsSuppressionRulesGetSamples { - /** - * Sample code: Get suppression alert rule for subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSuppressionAlertRuleForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.alertsSuppressionRules().getWithResponse("dismissIpAnomalyAlerts", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesListSamples.java deleted file mode 100644 index d105b5ebea0b7..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for AlertsSuppressionRules List. */ -public final class AlertsSuppressionRulesListSamples { - /** - * Sample code: Get suppression rules for subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSuppressionRulesForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.alertsSuppressionRules().list(null, Context.NONE); - } - - /** - * Sample code: Get suppression alert rule for subscription, filtered by AlertType. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSuppressionAlertRuleForSubscriptionFilteredByAlertType( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.alertsSuppressionRules().list("IpAnomaly", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesUpdateSamples.java deleted file mode 100644 index d28b4c4013a69..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSuppressionRulesUpdateSamples.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; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -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; - -/** Samples for AlertsSuppressionRules Update. */ -public final class AlertsSuppressionRulesUpdateSamples { - /** - * Sample code: Update or create suppression rule for subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void updateOrCreateSuppressionRuleForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .alertsSuppressionRules() - .updateWithResponse( - "dismissIpAnomalyAlerts", - new AlertsSuppressionRuleInner() - .withAlertType("IpAnomaly") - .withExpirationDateUtc(OffsetDateTime.parse("2019-12-01T19:50:47.083633Z")) - .withReason("FalsePositive") - .withState(RuleState.ENABLED) - .withComment("Test VM") - .withSuppressionAlertsScope( - new SuppressionAlertsScope() - .withAllOf( - Arrays - .asList( - new ScopeElement().withField("entities.ip.address"), - new ScopeElement().withField("entities.process.commandline")))), - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsListSamples.java deleted file mode 100644 index f0b9d5c953738..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for Assessments List. */ -public final class AssessmentsListSamples { - /** - * Sample code: List security assessments. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listSecurityAssessments(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.assessments().list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataGetSamples.java deleted file mode 100644 index 88ca93e16d660..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for AssessmentsMetadata Get. */ -public final class AssessmentsMetadataGetSamples { - /** - * Sample code: Get security assessment metadata. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityAssessmentMetadata( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.assessmentsMetadatas().getWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataListSamples.java deleted file mode 100644 index d585b083bc2f0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for AssessmentsMetadata List. */ -public final class AssessmentsMetadataListSamples { - /** - * Sample code: List security assessment metadata. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listSecurityAssessmentMetadata( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.assessmentsMetadatas().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsGetSamples.java deleted file mode 100644 index ddd48fe7eeb02..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for AutoProvisioningSettings Get. */ -public final class AutoProvisioningSettingsGetSamples { - /** - * Sample code: Get an auto provisioning setting for subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getAnAutoProvisioningSettingForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.autoProvisioningSettings().getWithResponse("default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsDeleteSamples.java deleted file mode 100644 index d585a60e00681..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsDeleteSamples.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; - -import com.azure.core.util.Context; - -/** Samples for Automations Delete. */ -public final class AutomationsDeleteSamples { - /** - * Sample code: Delete a security automation. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteASecurityAutomation(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.automations().deleteWithResponse("myRg", "myAutomationName", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsGetByResourceGroupSamples.java deleted file mode 100644 index 99afedcd551ca..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsGetByResourceGroupSamples.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; - -import com.azure.core.util.Context; - -/** Samples for Automations GetByResourceGroup. */ -public final class AutomationsGetByResourceGroupSamples { - /** - * Sample code: Retrieve a security automation. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void retrieveASecurityAutomation(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .automations() - .getByResourceGroupWithResponse("exampleResourceGroup", "exampleAutomation", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ComplianceResultsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ComplianceResultsListSamples.java deleted file mode 100644 index 8651c5df1f207..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ComplianceResultsListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for ComplianceResults List. */ -public final class ComplianceResultsListSamples { - /** - * Sample code: Get compliance results on subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getComplianceResultsOnSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.complianceResults().list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/CompliancesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/CompliancesListSamples.java deleted file mode 100644 index 11bb2ab6ac874..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/CompliancesListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for Compliances List. */ -public final class CompliancesListSamples { - /** - * Sample code: Get security compliance data over time. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityComplianceDataOverTime( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.compliances().list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsGetSamples.java deleted file mode 100644 index 3e917841ce233..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for Connectors Get. */ -public final class ConnectorsGetSamples { - /** - * Sample code: Details of a specific cloud account connector. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void detailsOfASpecificCloudAccountConnector( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.connectors().getWithResponse("aws_dev1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceGetSamples.java deleted file mode 100644 index 2e2dc5bde3837..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for Device Get. */ -public final class DeviceGetSamples { - /** - * Sample code: Get Device. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getDevice(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .devices() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Devices/iotHubs/myHub", - "myDevice", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DevicesForHubListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DevicesForHubListSamples.java deleted file mode 100644 index fc582ed600ac6..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DevicesForHubListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for DevicesForHub List. */ -public final class DevicesForHubListSamples { - /** - * Sample code: Get Devices. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getDevices(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .devicesForHubs() - .list( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Devices/iotHubs/myHub", - null, - null, - null, - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DevicesForSubscriptionListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DevicesForSubscriptionListSamples.java deleted file mode 100644 index f8187d948e4bf..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DevicesForSubscriptionListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for DevicesForSubscription List. */ -public final class DevicesForSubscriptionListSamples { - /** - * Sample code: Get Devices. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getDevices(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.devicesForSubscriptions().list(null, null, null, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsGetSamples.java deleted file mode 100644 index 72a730fbc66cc..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for DiscoveredSecuritySolutions Get. */ -public final class DiscoveredSecuritySolutionsGetSamples { - /** - * Sample code: Get discovered security solution from a security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getDiscoveredSecuritySolutionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.discoveredSecuritySolutions().getWithResponse("myRg2", "centralus", "paloalto7", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsListSamples.java deleted file mode 100644 index 28db6da649565..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for DiscoveredSecuritySolutions List. */ -public final class DiscoveredSecuritySolutionsListSamples { - /** - * Sample code: Get discovered security solutions. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getDiscoveredSecuritySolutions( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.discoveredSecuritySolutions().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsCreateSamples.java deleted file mode 100644 index cd2dc021468db..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsCreateSamples.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security; - -/** Samples for IngestionSettings Create. */ -public final class IngestionSettingsCreateSamples { - /** - * Sample code: Create an ingestion setting for subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createAnIngestionSettingForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.ingestionSettings().define("default").create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsGetSamples.java deleted file mode 100644 index 45cc1459f570a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IngestionSettings Get. */ -public final class IngestionSettingsGetSamples { - /** - * Sample code: Get a ingestion setting on subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getAIngestionSettingOnSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.ingestionSettings().getWithResponse("default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListSamples.java deleted file mode 100644 index b1f9e16177071..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IngestionSettings List. */ -public final class IngestionSettingsListSamples { - /** - * Sample code: Get ingestion settings on subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIngestionSettingsOnSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.ingestionSettings().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertTypesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertTypesGetSamples.java deleted file mode 100644 index 24879ed4aed69..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertTypesGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotAlertTypes Get. */ -public final class IotAlertTypesGetSamples { - /** - * Sample code: Get IoT Alert Type. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIoTAlertType(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotAlertTypes().getWithResponse("IoT_PrivilegedContainer", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertTypesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertTypesListSamples.java deleted file mode 100644 index e61b455e14b6a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertTypesListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotAlertTypes List. */ -public final class IotAlertTypesListSamples { - /** - * Sample code: Get IoT Alert Types. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIoTAlertTypes(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotAlertTypes().listWithResponse(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertsGetSamples.java deleted file mode 100644 index 60f2c4c170b64..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertsGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotAlerts Get. */ -public final class IotAlertsGetSamples { - /** - * Sample code: Get IoT Alert. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIoTAlert(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotAlerts() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myGroup/providers/Microsoft.Devices/IotHubs/myIotHub", - "903e76ff-17eb-4bac-ac8a-2bc31ab68fd8", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertsListSamples.java deleted file mode 100644 index 1f67f3a03cbcc..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotAlertsListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotAlerts List. */ -public final class IotAlertsListSamples { - /** - * Sample code: List IoT Alerts. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listIoTAlerts(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotAlerts() - .list( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myGroup/providers/Microsoft.Devices/IotHubs/myIotHub", - "2020-05-12T06:32:25Z", - "2020-05-14T06:32:25Z", - "IoT_PrivilegedContainer", - null, - "device-1", - 1, - null, - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsCreateOrUpdateSamples.java deleted file mode 100644 index 153eaa5c6cf54..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsCreateOrUpdateSamples.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; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IotDefenderSettingsModelInner; -import com.azure.resourcemanager.security.models.OnboardingKind; -import java.util.Arrays; - -/** Samples for IotDefenderSettings CreateOrUpdate. */ -public final class IotDefenderSettingsCreateOrUpdateSamples { - /** - * Sample code: Create or update IoT Defender settings. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createOrUpdateIoTDefenderSettings( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotDefenderSettings() - .createOrUpdateWithResponse( - new IotDefenderSettingsModelInner() - .withDeviceQuota(2000) - .withSentinelWorkspaceResourceIds( - Arrays - .asList( - "/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1")) - .withOnboardingKind(OnboardingKind.DEFAULT), - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsDeleteSamples.java deleted file mode 100644 index 81925420fcbb5..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsDeleteSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotDefenderSettings Delete. */ -public final class IotDefenderSettingsDeleteSamples { - /** - * Sample code: Delete IoT Defender settings. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteIoTDefenderSettings(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotDefenderSettings().deleteWithResponse(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsDownloadManagerActivationSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsDownloadManagerActivationSamples.java deleted file mode 100644 index 23e4e40e92e48..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsDownloadManagerActivationSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotDefenderSettings DownloadManagerActivation. */ -public final class IotDefenderSettingsDownloadManagerActivationSamples { - /** - * Sample code: Download quota data of the subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void downloadQuotaDataOfTheSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotDefenderSettings().downloadManagerActivationWithResponse(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsGetSamples.java deleted file mode 100644 index c3627e773e032..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotDefenderSettings Get. */ -public final class IotDefenderSettingsGetSamples { - /** - * Sample code: Get IoT Defender settings. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIoTDefenderSettings(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotDefenderSettings().getWithResponse(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsListSamples.java deleted file mode 100644 index 11890b702fb2f..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotDefenderSettings List. */ -public final class IotDefenderSettingsListSamples { - /** - * Sample code: List IoT Defender settings. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listIoTDefenderSettings(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotDefenderSettings().listWithResponse(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsPackageDownloadsSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsPackageDownloadsSamples.java deleted file mode 100644 index 1529def74d7b8..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotDefenderSettingsPackageDownloadsSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotDefenderSettings PackageDownloads. */ -public final class IotDefenderSettingsPackageDownloadsSamples { - /** - * Sample code: Package downloads. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void packageDownloads(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotDefenderSettings().packageDownloadsWithResponse(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationTypesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationTypesGetSamples.java deleted file mode 100644 index 4b79a23a57154..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationTypesGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotRecommendationTypes Get. */ -public final class IotRecommendationTypesGetSamples { - /** - * Sample code: Get IoT Recommendation Type. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIoTRecommendationType(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotRecommendationTypes().getWithResponse("IoT_VulnerableTLSCipherSuite", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationTypesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationTypesListSamples.java deleted file mode 100644 index 22b48bdfb08aa..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationTypesListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotRecommendationTypes List. */ -public final class IotRecommendationTypesListSamples { - /** - * Sample code: Get IoT Recommendation Types. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIoTRecommendationTypes(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotRecommendationTypes().listWithResponse(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationsGetSamples.java deleted file mode 100644 index f263bb6a4f441..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationsGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotRecommendations Get. */ -public final class IotRecommendationsGetSamples { - /** - * Sample code: Get IoT Recommendation. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIoTRecommendation(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotRecommendations() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myGroup/providers/Microsoft.Devices/IotHubs/myIotHub", - "903e76ff-17eb-4bac-ac8a-2bc31ab68fd8", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationsListSamples.java deleted file mode 100644 index dbce2d71a170c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotRecommendationsListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotRecommendations List. */ -public final class IotRecommendationsListSamples { - /** - * Sample code: Get IoT Recommendations. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIoTRecommendations(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotRecommendations() - .list( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myGroup/providers/Microsoft.Devices/IotHubs/myIotHub", - "IoT_Baseline", - "device-1", - 1, - null, - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionAnalyticsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionAnalyticsGetSamples.java deleted file mode 100644 index 4642868787e05..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionAnalyticsGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotSecuritySolutionAnalytics Get. */ -public final class IotSecuritySolutionAnalyticsGetSamples { - /** - * Sample code: Get Security Solution Analytics. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecuritySolutionAnalytics( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotSecuritySolutionAnalytics().getWithResponse("MyGroup", "default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionAnalyticsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionAnalyticsListSamples.java deleted file mode 100644 index cec08a427ba09..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionAnalyticsListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotSecuritySolutionAnalytics List. */ -public final class IotSecuritySolutionAnalyticsListSamples { - /** - * Sample code: Get Security Solution Analytics. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecuritySolutionAnalytics( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotSecuritySolutionAnalytics().listWithResponse("MyGroup", "default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsCreateOrUpdateSamples.java deleted file mode 100644 index 682b79417f82d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsCreateOrUpdateSamples.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; - -import com.azure.resourcemanager.security.models.SensorType; - -/** Samples for IotSensors CreateOrUpdate. */ -public final class IotSensorsCreateOrUpdateSamples { - /** - * Sample code: Create or update IoT sensor. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createOrUpdateIoTSensor(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSensors() - .define("mySensor") - .withExistingScope( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub") - .withTiAutomaticUpdates(true) - .withZone("Zone Name") - .withSensorType(SensorType.OT) - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDeleteSamples.java deleted file mode 100644 index 6f7544ae3927d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDeleteSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotSensors Delete. */ -public final class IotSensorsDeleteSamples { - /** - * Sample code: Delete IoT sensor. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteIoTSensor(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSensors() - .deleteWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", - "mySensor", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDownloadActivationSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDownloadActivationSamples.java deleted file mode 100644 index cb4a2d3485ed8..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDownloadActivationSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotSensors DownloadActivation. */ -public final class IotSensorsDownloadActivationSamples { - /** - * Sample code: Download activation file. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void downloadActivationFile(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSensors() - .downloadActivationWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", - "mySensor", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDownloadResetPasswordSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDownloadResetPasswordSamples.java deleted file mode 100644 index 9391e038d43ea..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsDownloadResetPasswordSamples.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; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.ResetPasswordInput; - -/** Samples for IotSensors DownloadResetPassword. */ -public final class IotSensorsDownloadResetPasswordSamples { - /** - * Sample code: Download file for reset password of the sensor. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void downloadFileForResetPasswordOfTheSensor( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSensors() - .downloadResetPasswordWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", - "mySensor", - new ResetPasswordInput().withApplianceId("3214-528AV23-D121-D3-E1"), - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsGetSamples.java deleted file mode 100644 index 10f599c4f2626..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotSensors Get. */ -public final class IotSensorsGetSamples { - /** - * Sample code: Get IoT sensor. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIoTSensor(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSensors() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", - "mySensor", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsListSamples.java deleted file mode 100644 index 278adafdf475a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotSensors List. */ -public final class IotSensorsListSamples { - /** - * Sample code: List IoT sensors. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listIoTSensors(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSensors() - .listWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsTriggerTiPackageUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsTriggerTiPackageUpdateSamples.java deleted file mode 100644 index 99992f345ee1d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSensorsTriggerTiPackageUpdateSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotSensors TriggerTiPackageUpdate. */ -public final class IotSensorsTriggerTiPackageUpdateSamples { - /** - * Sample code: Trigger threat intelligence package update. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void triggerThreatIntelligencePackageUpdate( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSensors() - .triggerTiPackageUpdateWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", - "mySensor", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesCreateOrUpdateSamples.java deleted file mode 100644 index 3893e87887cc3..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesCreateOrUpdateSamples.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; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IotSitesModelInner; -import java.util.HashMap; -import java.util.Map; - -/** Samples for IotSites CreateOrUpdate. */ -public final class IotSitesCreateOrUpdateSamples { - /** - * Sample code: Create or update IoT site. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createOrUpdateIoTSite(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSites() - .createOrUpdateWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", - new IotSitesModelInner() - .withDisplayName("IoT site name") - .withTags(mapOf("key1", "value1", "key2", "value2")), - Context.NONE); - } - - @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/samples/java/com/azure/resourcemanager/security/IotSitesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesDeleteSamples.java deleted file mode 100644 index 2d78d9d27514e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesDeleteSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotSites Delete. */ -public final class IotSitesDeleteSamples { - /** - * Sample code: Delete IoT site. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteIoTSite(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSites() - .deleteWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesGetSamples.java deleted file mode 100644 index 59ac6f43a72db..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotSites Get. */ -public final class IotSitesGetSamples { - /** - * Sample code: Get IoT site. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getIoTSite(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSites() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesListSamples.java deleted file mode 100644 index a354baf95fb65..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSitesListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for IotSites List. */ -public final class IotSitesListSamples { - /** - * Sample code: List IoT sites. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listIoTSites(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSites() - .listWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/iotSites", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesDeleteSamples.java deleted file mode 100644 index ac94ddbc96594..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesDeleteSamples.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; - -import com.azure.core.util.Context; - -/** Samples for JitNetworkAccessPolicies Delete. */ -public final class JitNetworkAccessPoliciesDeleteSamples { - /** - * Sample code: Delete a JIT network access policy. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteAJITNetworkAccessPolicy( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.jitNetworkAccessPolicies().deleteWithResponse("myRg1", "westeurope", "default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesGetSamples.java deleted file mode 100644 index ce7349262ca74..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for JitNetworkAccessPolicies Get. */ -public final class JitNetworkAccessPoliciesGetSamples { - /** - * Sample code: Get JIT network access policy. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.jitNetworkAccessPolicies().getWithResponse("myRg1", "westeurope", "default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsCreateOrUpdateSamples.java deleted file mode 100644 index a692138b096df..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsCreateOrUpdateSamples.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; - -import com.azure.core.util.Context; - -/** Samples for OnPremiseIotSensors CreateOrUpdate. */ -public final class OnPremiseIotSensorsCreateOrUpdateSamples { - /** - * Sample code: Create or update on-premise IoT sensor. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void createOrUpdateOnPremiseIoTSensor( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.onPremiseIotSensors().createOrUpdateWithResponse("mySensor", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDeleteSamples.java deleted file mode 100644 index 4c5e7fe5f4179..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDeleteSamples.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; - -import com.azure.core.util.Context; - -/** Samples for OnPremiseIotSensors Delete. */ -public final class OnPremiseIotSensorsDeleteSamples { - /** - * Sample code: Delete on-premise IoT sensor. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void deleteOnPremiseIoTSensor(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.onPremiseIotSensors().deleteWithResponse("mySensor", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDownloadActivationSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDownloadActivationSamples.java deleted file mode 100644 index e6ae685eb165a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDownloadActivationSamples.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; - -import com.azure.core.util.Context; - -/** Samples for OnPremiseIotSensors DownloadActivation. */ -public final class OnPremiseIotSensorsDownloadActivationSamples { - /** - * Sample code: Download activation file. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void downloadActivationFile(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.onPremiseIotSensors().downloadActivationWithResponse("mySensor", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDownloadResetPasswordSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDownloadResetPasswordSamples.java deleted file mode 100644 index 7d1fa3b3f8a83..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsDownloadResetPasswordSamples.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; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.ResetPasswordInput; - -/** Samples for OnPremiseIotSensors DownloadResetPassword. */ -public final class OnPremiseIotSensorsDownloadResetPasswordSamples { - /** - * Sample code: Download file for reset password of the sensor. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void downloadFileForResetPasswordOfTheSensor( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .onPremiseIotSensors() - .downloadResetPasswordWithResponse( - "mySensor", new ResetPasswordInput().withApplianceId("3214-528AV23-D121-D3-E1"), Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsGetSamples.java deleted file mode 100644 index 7552e6bf529c9..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for OnPremiseIotSensors Get. */ -public final class OnPremiseIotSensorsGetSamples { - /** - * Sample code: Get on-premise IoT sensor. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getOnPremiseIoTSensor(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.onPremiseIotSensors().getWithResponse("mySensor", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsListSamples.java deleted file mode 100644 index 327e18c41bdf0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/OnPremiseIotSensorsListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for OnPremiseIotSensors List. */ -public final class OnPremiseIotSensorsListSamples { - /** - * Sample code: List on-premise IoT sensors. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listOnPremiseIoTSensors(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.onPremiseIotSensors().listWithResponse(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlDefinitionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlDefinitionsListSamples.java deleted file mode 100644 index 5d5f79bad2d06..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlDefinitionsListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for SecureScoreControlDefinitions List. */ -public final class SecureScoreControlDefinitionsListSamples { - /** - * Sample code: List security controls definition. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listSecurityControlsDefinition( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.secureScoreControlDefinitions().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlsListBySecureScoreSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlsListBySecureScoreSamples.java deleted file mode 100644 index 92b5ede6edea1..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlsListBySecureScoreSamples.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; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.ExpandControlsEnum; - -/** Samples for SecureScoreControls ListBySecureScore. */ -public final class SecureScoreControlsListBySecureScoreSamples { - /** - * Sample code: Get security controls and their current score for the specified initiative with the expand - * parameter. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiativeWithTheExpandParameter( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .secureScoreControls() - .listBySecureScore("ascScore", ExpandControlsEnum.DEFINITION, Context.NONE); - } - - /** - * Sample code: Get security controls and their current score for the specified initiative. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiative( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.secureScoreControls().listBySecureScore("ascScore", null, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsGetSamples.java deleted file mode 100644 index 9d98c0995eb7b..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for SecurityContacts Get. */ -public final class SecurityContactsGetSamples { - /** - * Sample code: Get security contact data minimal. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityContactDataMinimal( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.securityContacts().getWithResponse("default2", Context.NONE); - } - - /** - * Sample code: Get security contact data full. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityContactDataFull(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.securityContacts().getWithResponse("default1", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsListSamples.java deleted file mode 100644 index 85e587a4b6985..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for SecurityContacts List. */ -public final class SecurityContactsListSamples { - /** - * Sample code: Update security contact data minimal. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void updateSecurityContactDataMinimal( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.securityContacts().list(Context.NONE); - } - - /** - * Sample code: Update security contact data full. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void updateSecurityContactDataFull( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.securityContacts().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsUpdateSamples.java deleted file mode 100644 index b4835ab9df5e7..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsUpdateSamples.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; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.AlertNotifications; -import com.azure.resourcemanager.security.models.SecurityContact; - -/** Samples for SecurityContacts Update. */ -public final class SecurityContactsUpdateSamples { - /** - * Sample code: Update security contact data minimal. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void updateSecurityContactDataMinimal( - com.azure.resourcemanager.security.SecurityManager securityManager) { - SecurityContact resource = - securityManager.securityContacts().getWithResponse("default2", Context.NONE).getValue(); - resource.update().withAlertNotifications(AlertNotifications.ON).apply(); - } - - /** - * Sample code: Update security contact data full. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void updateSecurityContactDataFull( - com.azure.resourcemanager.security.SecurityManager securityManager) { - SecurityContact resource = securityManager.securityContacts().getWithResponse("john", Context.NONE).getValue(); - resource.update().withPhone("(214)275-4038").withAlertNotifications(AlertNotifications.ON).apply(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsGetSamples.java deleted file mode 100644 index 596a9e2a93ef1..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for SecuritySolutions Get. */ -public final class SecuritySolutionsGetSamples { - /** - * Sample code: Get a security solution from a security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getASecuritySolutionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.securitySolutions().getWithResponse("myRg2", "centralus", "paloalto7", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsReferenceDataListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsReferenceDataListByHomeRegionSamples.java deleted file mode 100644 index 571a17b958837..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsReferenceDataListByHomeRegionSamples.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; - -import com.azure.core.util.Context; - -/** Samples for SecuritySolutionsReferenceData ListByHomeRegion. */ -public final class SecuritySolutionsReferenceDataListByHomeRegionSamples { - /** - * Sample code: Get security solutions from a security data location. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecuritySolutionsFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.securitySolutionsReferenceDatas().listByHomeRegionWithResponse("westcentralus", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsListAllSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsListAllSamples.java deleted file mode 100644 index 5ba4c82882694..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsListAllSamples.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; - -import com.azure.core.util.Context; - -/** Samples for SubAssessments ListAll. */ -public final class SubAssessmentsListAllSamples { - /** - * Sample code: List security sub-assessments. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void listSecuritySubAssessments(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.subAssessments().listAll("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListSamples.java deleted file mode 100644 index 0738f549721aa..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for Tasks List. */ -public final class TasksListSamples { - /** - * Sample code: Get security recommendations tasks. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getSecurityRecommendationsTasks( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.tasks().list(null, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyGetSamples.java deleted file mode 100644 index 1df814b85263e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for Topology Get. */ -public final class TopologyGetSamples { - /** - * Sample code: Get topology. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getTopology(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.topologies().getWithResponse("myservers", "centralus", "vnets", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsGetSamples.java deleted file mode 100644 index 45f39f7d9df69..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsGetSamples.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; - -import com.azure.core.util.Context; - -/** Samples for WorkspaceSettings Get. */ -public final class WorkspaceSettingsGetSamples { - /** - * Sample code: Get a workspace setting on subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getAWorkspaceSettingOnSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.workspaceSettings().getWithResponse("default", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsListSamples.java deleted file mode 100644 index 50f641d10f02f..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsListSamples.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; - -import com.azure.core.util.Context; - -/** Samples for WorkspaceSettings List. */ -public final class WorkspaceSettingsListSamples { - /** - * Sample code: Get workspace settings on subscription. - * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ - public static void getWorkspaceSettingsOnSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.workspaceSettings().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsDeleteSamples.java new file mode 100644 index 0000000000000..75d06aefb48e0 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for AdaptiveApplicationControls Delete. */ +public final class AdaptiveApplicationControlsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/DeleteAdaptiveApplicationControls_example.json + */ + /** + * Sample code: Delete an application control machine group. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteAnApplicationControlMachineGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.adaptiveApplicationControls().deleteWithResponse("centralus", "GROUP1", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsGetSamples.java new file mode 100644 index 0000000000000..2548b745ba18b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for AdaptiveApplicationControls Get. */ +public final class AdaptiveApplicationControlsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/GetAdaptiveApplicationControlsGroup_example.json + */ + /** + * Sample code: Gets a configured application control VM/server group. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsAConfiguredApplicationControlVMServerGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.adaptiveApplicationControls().getWithResponse("centralus", "ERELGROUP1", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsListSamples.java similarity index 52% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsListSamples.java index e1d992dcbe28c..6f0682f726abb 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsListSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for AdaptiveApplicationControls List. */ public final class AdaptiveApplicationControlsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/GetAdaptiveApplicationControlsSubscription_example.json + */ /** * Sample code: Gets a list of application control groups of machines for the subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getsAListOfApplicationControlGroupsOfMachinesForTheSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.adaptiveApplicationControls().listWithResponse(true, false, Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.adaptiveApplicationControls().listWithResponse(true, false, Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsPutSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsPutSamples.java similarity index 93% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsPutSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsPutSamples.java index 472b6f6fa9898..81d96bb3dcc25 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveApplicationControlsPutSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsPutSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.AdaptiveApplicationControlGroup; @@ -21,19 +21,18 @@ /** Samples for AdaptiveApplicationControls Put. */ public final class AdaptiveApplicationControlsPutSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/PutAdaptiveApplicationControls_example.json + */ /** * Sample code: Update an application control machine group by adding a new application. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void updateAnApplicationControlMachineGroupByAddingANewApplication( - com.azure.resourcemanager.security.SecurityManager securityManager) { + com.azure.resourcemanager.security.SecurityManager manager) { AdaptiveApplicationControlGroup resource = - securityManager - .adaptiveApplicationControls() - .getWithResponse("centralus", "ERELGROUP1", Context.NONE) - .getValue(); + manager.adaptiveApplicationControls().getWithResponse("centralus", "ERELGROUP1", Context.NONE).getValue(); resource .update() .withEnforcementMode(EnforcementMode.AUDIT) diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsEnforceSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsEnforceSamples.java similarity index 86% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsEnforceSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsEnforceSamples.java index 9011173cba00e..cd4112b4a13be 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsEnforceSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsEnforceSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.AdaptiveNetworkHardeningEnforceRequest; @@ -13,15 +13,17 @@ /** Samples for AdaptiveNetworkHardenings Enforce. */ public final class AdaptiveNetworkHardeningsEnforceSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/EnforceAdaptiveNetworkHardeningRules_example.json + */ /** * Sample code: Enforces the given rules on the NSG(s) listed in the request. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void enforcesTheGivenRulesOnTheNSGSListedInTheRequest( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .adaptiveNetworkHardenings() .enforce( "rg1", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsGetSamples.java similarity index 61% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsGetSamples.java index 0d1e20e815706..c4b72d5960273 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsGetSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for AdaptiveNetworkHardenings Get. */ public final class AdaptiveNetworkHardeningsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/GetAdaptiveNetworkHardening_example.json + */ /** * Sample code: Get a single Adaptive Network Hardening resource. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getASingleAdaptiveNetworkHardeningResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .adaptiveNetworkHardenings() .getWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", "default", Context.NONE); } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsListByExtendedResourceSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListByExtendedResourceSamples.java similarity index 62% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsListByExtendedResourceSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListByExtendedResourceSamples.java index 6743e63ee6ba5..fecd6e07dc2ab 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdaptiveNetworkHardeningsListByExtendedResourceSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListByExtendedResourceSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for AdaptiveNetworkHardenings ListByExtendedResource. */ public final class AdaptiveNetworkHardeningsListByExtendedResourceSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/ListByExtendedResourceAdaptiveNetworkHardenings_example.json + */ /** * Sample code: List Adaptive Network Hardenings resources of an extended resource. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void listAdaptiveNetworkHardeningsResourcesOfAnExtendedResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .adaptiveNetworkHardenings() .listByExtendedResource("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdvancedThreatProtectionCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionCreateSamples.java similarity index 67% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdvancedThreatProtectionCreateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionCreateSamples.java index 0bc3582019c47..887a4ffcae152 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdvancedThreatProtectionCreateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionCreateSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; /** Samples for AdvancedThreatProtection Create. */ public final class AdvancedThreatProtectionCreateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/PutAdvancedThreatProtectionSettings_example.json + */ /** * Sample code: Creates or updates the Advanced Threat Protection settings on a specified resource. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void createsOrUpdatesTheAdvancedThreatProtectionSettingsOnASpecifiedResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .advancedThreatProtections() .define() .withExistingResourceId( diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdvancedThreatProtectionGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionGetSamples.java similarity index 66% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdvancedThreatProtectionGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionGetSamples.java index d5ebfab412dcd..06e287187a1d2 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AdvancedThreatProtectionGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionGetSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for AdvancedThreatProtection Get. */ public final class AdvancedThreatProtectionGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/GetAdvancedThreatProtectionSettings_example.json + */ /** * Sample code: Gets the Advanced Threat Protection settings for the specified resource. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getsTheAdvancedThreatProtectionSettingsForTheSpecifiedResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .advancedThreatProtections() .getWithResponse( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsGetResourceGroupLevelSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetResourceGroupLevelSamples.java similarity index 64% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsGetResourceGroupLevelSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetResourceGroupLevelSamples.java index a4d8715366246..b023e34bfe339 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsGetResourceGroupLevelSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetResourceGroupLevelSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Alerts GetResourceGroupLevel. */ public final class AlertsGetResourceGroupLevelSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/GetAlertResourceGroupLocation_example.json + */ /** * Sample code: Get security alert on a resource group from a security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getSecurityAlertOnAResourceGroupFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .alerts() .getResourceGroupLevelWithResponse( "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", "myRg1", Context.NONE); diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsGetSubscriptionLevelSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetSubscriptionLevelSamples.java similarity index 64% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsGetSubscriptionLevelSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetSubscriptionLevelSamples.java index e6dca7c21ae29..ab7526f520237 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsGetSubscriptionLevelSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetSubscriptionLevelSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Alerts GetSubscriptionLevel. */ public final class AlertsGetSubscriptionLevelSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/GetAlertSubscriptionLocation_example.json + */ /** * Sample code: Get security alert on a subscription from a security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getSecurityAlertOnASubscriptionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .alerts() .getSubscriptionLevelWithResponse( "westeurope", "2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA", Context.NONE); diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..5e04fd0590f7d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Alerts ListByResourceGroup. */ +public final class AlertsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/GetAlertsResourceGroup_example.json + */ + /** + * Sample code: Get security alerts on a resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityAlertsOnAResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts().listByResourceGroup("myRg1", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListResourceGroupLevelByRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListResourceGroupLevelByRegionSamples.java similarity index 53% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListResourceGroupLevelByRegionSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListResourceGroupLevelByRegionSamples.java index 4299958e9ee54..75ab771d56e85 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListResourceGroupLevelByRegionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListResourceGroupLevelByRegionSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Alerts ListResourceGroupLevelByRegion. */ public final class AlertsListResourceGroupLevelByRegionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/GetAlertsResourceGroupLocation_example.json + */ /** * Sample code: Get security alerts on a resource group from a security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getSecurityAlertsOnAResourceGroupFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.alerts().listResourceGroupLevelByRegion("westeurope", "myRg1", Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts().listResourceGroupLevelByRegion("westeurope", "myRg1", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSamples.java new file mode 100644 index 0000000000000..cdd7877e4a4a6 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Alerts List. */ +public final class AlertsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/GetAlertsSubscription_example.json + */ + /** + * Sample code: Get security alerts on a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityAlertsOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts().list(Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListSubscriptionLevelByRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSubscriptionLevelByRegionSamples.java similarity index 54% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListSubscriptionLevelByRegionSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSubscriptionLevelByRegionSamples.java index da603a3f38299..04c5e7672a039 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsListSubscriptionLevelByRegionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSubscriptionLevelByRegionSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Alerts ListSubscriptionLevelByRegion. */ public final class AlertsListSubscriptionLevelByRegionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/GetAlertsSubscriptionsLocation_example.json + */ /** * Sample code: Get security alerts on a subscription from a security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getSecurityAlertsOnASubscriptionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.alerts().listSubscriptionLevelByRegion("westeurope", Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts().listSubscriptionLevelByRegion("westeurope", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSimulateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSimulateSamples.java similarity index 81% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSimulateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSimulateSamples.java index e8871599cf37d..40683cc134bbb 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsSimulateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSimulateSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.AlertSimulatorBundlesRequestProperties; @@ -12,15 +12,17 @@ /** Samples for Alerts Simulate. */ public final class AlertsSimulateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/SimulateAlerts_example.json + */ /** * Sample code: Simulate security alerts on a subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void simulateSecurityAlertsOnASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .alerts() .simulate( "centralus", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesDeleteSamples.java new file mode 100644 index 0000000000000..60048a128b184 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for AlertsSuppressionRules Delete. */ +public final class AlertsSuppressionRulesDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/DeleteAlertsSuppressionRule_example.json + */ + /** + * Sample code: Delete suppression rule data for a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteSuppressionRuleDataForASubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alertsSuppressionRules().deleteWithResponse("dismissIpAnomalyAlerts", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesGetSamples.java new file mode 100644 index 0000000000000..e6f52de5e4398 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for AlertsSuppressionRules Get. */ +public final class AlertsSuppressionRulesGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRule_example.json + */ + /** + * Sample code: Get suppression alert rule for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSuppressionAlertRuleForSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alertsSuppressionRules().getWithResponse("dismissIpAnomalyAlerts", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListSamples.java new file mode 100644 index 0000000000000..ecdedac4572d8 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListSamples.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.core.util.Context; + +/** Samples for AlertsSuppressionRules List. */ +public final class AlertsSuppressionRulesListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRules_example.json + */ + /** + * Sample code: Get suppression rules for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSuppressionRulesForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.alertsSuppressionRules().list(null, Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRulesWithAlertType_example.json + */ + /** + * Sample code: Get suppression alert rule for subscription, filtered by AlertType. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSuppressionAlertRuleForSubscriptionFilteredByAlertType( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alertsSuppressionRules().list("IpAnomaly", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..166a570d48a94 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateSamples.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; +import com.azure.resourcemanager.security.models.RuleState; +import com.azure.resourcemanager.security.models.ScopeElement; +import com.azure.resourcemanager.security.models.SuppressionAlertsScope; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AlertsSuppressionRules Update. */ +public final class AlertsSuppressionRulesUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/PutAlertsSuppressionRule_example.json + */ + /** + * Sample code: Update or create suppression rule for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateOrCreateSuppressionRuleForSubscription( + com.azure.resourcemanager.security.SecurityManager manager) throws IOException { + manager + .alertsSuppressionRules() + .updateWithResponse( + "dismissIpAnomalyAlerts", + new AlertsSuppressionRuleInner() + .withAlertType("IpAnomaly") + .withExpirationDateUtc(OffsetDateTime.parse("2019-12-01T19:50:47.083633Z")) + .withReason("FalsePositive") + .withState(RuleState.ENABLED) + .withComment("Test VM") + .withSuppressionAlertsScope( + new SuppressionAlertsScope() + .withAllOf( + Arrays + .asList( + new ScopeElement() + .withField("entities.ip.address") + .withAdditionalProperties( + mapOf( + "in", + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "[\"104.215.95.187\",\"52.164.206.56\"]", + Object.class, + SerializerEncoding.JSON))), + new ScopeElement() + .withField("entities.process.commandline") + .withAdditionalProperties(mapOf("contains", "POWERSHELL.EXE"))))), + Context.NONE); + } + + @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/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToActivateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToActivateSamples.java similarity index 66% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToActivateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToActivateSamples.java index c93454266a09c..50cb298c3d399 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToActivateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToActivateSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Alerts UpdateResourceGroupLevelStateToActivate. */ public final class AlertsUpdateResourceGroupLevelStateToActivateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_example.json + */ /** * Sample code: Update security alert state on a resource group from a security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .alerts() .updateResourceGroupLevelStateToActivateWithResponse( "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", "myRg2", Context.NONE); diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToDismissSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToDismissSamples.java similarity index 66% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToDismissSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToDismissSamples.java index 9480ea6334c67..2a774760edc6d 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToDismissSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToDismissSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Alerts UpdateResourceGroupLevelStateToDismiss. */ public final class AlertsUpdateResourceGroupLevelStateToDismissSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_example.json + */ /** * Sample code: Update security alert state on a resource group from a security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .alerts() .updateResourceGroupLevelStateToDismissWithResponse( "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", "myRg2", Context.NONE); diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToResolveSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToResolveSamples.java similarity index 66% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToResolveSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToResolveSamples.java index 979eacb0e4eaf..38beb114c9c11 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateResourceGroupLevelStateToResolveSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToResolveSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Alerts UpdateResourceGroupLevelStateToResolve. */ public final class AlertsUpdateResourceGroupLevelStateToResolveSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_resolve_example.json + */ /** * Sample code: Update security alert state on a resource group from a security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .alerts() .updateResourceGroupLevelStateToResolveWithResponse( "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", "myRg2", Context.NONE); diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToActivateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToActivateSamples.java similarity index 66% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToActivateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToActivateSamples.java index 1c79383ea6de8..8e4e84803845c 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToActivateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToActivateSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Alerts UpdateSubscriptionLevelStateToActivate. */ public final class AlertsUpdateSubscriptionLevelStateToActivateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_example.json + */ /** * Sample code: Update security alert state on a subscription from a security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .alerts() .updateSubscriptionLevelStateToActivateWithResponse( "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", Context.NONE); diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToDismissSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToDismissSamples.java similarity index 66% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToDismissSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToDismissSamples.java index 063a15d276145..16f0cab0e590e 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToDismissSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToDismissSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Alerts UpdateSubscriptionLevelStateToDismiss. */ public final class AlertsUpdateSubscriptionLevelStateToDismissSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_example.json + */ /** * Sample code: Update security alert state on a subscription from a security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .alerts() .updateSubscriptionLevelStateToDismissWithResponse( "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", Context.NONE); diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToResolveSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToResolveSamples.java similarity index 65% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToResolveSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToResolveSamples.java index 301b29f467de8..a8c9410e25e2c 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AlertsUpdateSubscriptionLevelStateToResolveSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToResolveSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Alerts UpdateSubscriptionLevelStateToResolve. */ public final class AlertsUpdateSubscriptionLevelStateToResolveSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_resolve_example.json + */ /** * Sample code: Update security alert state on a subscription from a security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .alerts() .updateSubscriptionLevelStateToResolveWithResponse( "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", Context.NONE); diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsGetSamples.java similarity index 64% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsGetSamples.java index 8e5ceeae6b07f..b10b261522014 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsGetSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.ConnectionType; /** Samples for AllowedConnections Get. */ public final class AllowedConnectionsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnections_example.json + */ /** * Sample code: Get allowed connections. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getAllowedConnections(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void getAllowedConnections(com.azure.resourcemanager.security.SecurityManager manager) { + manager .allowedConnections() .getWithResponse("myResourceGroup", "centralus", ConnectionType.INTERNAL, Context.NONE); } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListByHomeRegionSamples.java similarity index 53% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsListByHomeRegionSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListByHomeRegionSamples.java index f8fdee135aef6..bbd75213fa549 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsListByHomeRegionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListByHomeRegionSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for AllowedConnections ListByHomeRegion. */ public final class AllowedConnectionsListByHomeRegionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnectionsSubscriptionLocation_example.json + */ /** * Sample code: Get allowed connections on a subscription from security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getAllowedConnectionsOnASubscriptionFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.allowedConnections().listByHomeRegion("centralus", Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.allowedConnections().listByHomeRegion("centralus", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListSamples.java similarity index 50% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListSamples.java index d3301223298ae..2bda8c34c7c01 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AllowedConnectionsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for AllowedConnections List. */ public final class AllowedConnectionsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnectionsSubscription_example.json + */ /** * Sample code: Get allowed connections on a subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getAllowedConnectionsOnASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.allowedConnections().list(Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.allowedConnections().list(Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsCreateOrUpdateSamples.java similarity index 74% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsCreateOrUpdateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsCreateOrUpdateSamples.java index 71325ee1b9751..8902de2fa7f1c 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsCreateOrUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsCreateOrUpdateSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.resourcemanager.security.models.AssessmentStatus; import com.azure.resourcemanager.security.models.AssessmentStatusCode; @@ -10,21 +10,23 @@ /** Samples for Assessments CreateOrUpdate. */ public final class AssessmentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/PutAssessment_example.json + */ /** * Sample code: Create security recommendation task on a resource. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void createSecurityRecommendationTaskOnAResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .assessments() .define("8bb8be0a-6010-4789-812f-e4d661c4ed0e") .withExistingResourceId( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2") - .withResourceDetails(new AzureResourceDetails()) .withStatus(new AssessmentStatus().withCode(AssessmentStatusCode.HEALTHY)) + .withResourceDetails(new AzureResourceDetails()) .create(); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsDeleteSamples.java similarity index 67% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsDeleteSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsDeleteSamples.java index c95270597fe83..4b71001e37c8a 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsDeleteSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Assessments Delete. */ public final class AssessmentsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/DeleteAssessment_example.json + */ /** * Sample code: Delete a security recommendation task on a resource. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void deleteASecurityRecommendationTaskOnAResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .assessments() .deleteWithResponse( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsGetSamples.java similarity index 67% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsGetSamples.java index c64fb805494d9..488d0df6e4995 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsGetSamples.java @@ -2,22 +2,24 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.ExpandEnum; /** Samples for Assessments Get. */ public final class AssessmentsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/GetAssessmentWithExpand_example.json + */ /** * Sample code: Get security recommendation task from security data location with expand parameter. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getSecurityRecommendationTaskFromSecurityDataLocationWithExpandParameter( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .assessments() .getWithResponse( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", @@ -26,15 +28,17 @@ public static void getSecurityRecommendationTaskFromSecurityDataLocationWithExpa Context.NONE); } + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/GetAssessment_example.json + */ /** * Sample code: Get security recommendation task from security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getSecurityRecommendationTaskFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .assessments() .getWithResponse( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsListSamples.java new file mode 100644 index 0000000000000..2f5ba8c60f8c9 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Assessments List. */ +public final class AssessmentsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/ListAssessments_example.json + */ + /** + * Sample code: List security assessments. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecurityAssessments(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessments().list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataCreateInSubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataCreateInSubscriptionSamples.java similarity index 84% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataCreateInSubscriptionSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataCreateInSubscriptionSamples.java index 8c2e3722177dd..92c27d05bdb64 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataCreateInSubscriptionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataCreateInSubscriptionSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.resourcemanager.security.models.AssessmentType; import com.azure.resourcemanager.security.models.Categories; @@ -14,15 +14,17 @@ /** Samples for AssessmentsMetadata CreateInSubscription. */ public final class AssessmentsMetadataCreateInSubscriptionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/CreateAssessmentsMetadata_subscription_example.json + */ /** * Sample code: Create security assessment metadata for subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void createSecurityAssessmentMetadataForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .assessmentsMetadatas() .define("ca039e75-a276-4175-aebc-bcd41e4b14b7") .withDisplayName("Install endpoint protection solution on virtual machine scale sets") diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataDeleteInSubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataDeleteInSubscriptionSamples.java similarity index 61% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataDeleteInSubscriptionSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataDeleteInSubscriptionSamples.java index f67e791be4332..4ff6c8c563b8b 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataDeleteInSubscriptionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataDeleteInSubscriptionSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for AssessmentsMetadata DeleteInSubscription. */ public final class AssessmentsMetadataDeleteInSubscriptionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/DeleteAssessmentsMetadata_subscription_example.json + */ /** * Sample code: Delete a security assessment metadata for subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void deleteASecurityAssessmentMetadataForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .assessmentsMetadatas() .deleteInSubscriptionWithResponse("ca039e75-a276-4175-aebc-bcd41e4b14b7", Context.NONE); } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataGetInSubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetInSubscriptionSamples.java similarity index 61% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataGetInSubscriptionSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetInSubscriptionSamples.java index 513b3070de02e..96a76d72463a4 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataGetInSubscriptionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetInSubscriptionSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for AssessmentsMetadata GetInSubscription. */ public final class AssessmentsMetadataGetInSubscriptionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/GetAssessmentsMetadata_subscription_example.json + */ /** * Sample code: Get security assessment metadata for subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getSecurityAssessmentMetadataForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .assessmentsMetadatas() .getInSubscriptionWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", Context.NONE); } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetSamples.java new file mode 100644 index 0000000000000..a60a33657bbf5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for AssessmentsMetadata Get. */ +public final class AssessmentsMetadataGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json + */ + /** + * Sample code: Get security assessment metadata. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityAssessmentMetadata(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessmentsMetadatas().getWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataListBySubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListBySubscriptionSamples.java similarity index 52% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataListBySubscriptionSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListBySubscriptionSamples.java index d7d669ee7a166..516213e0e7e23 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AssessmentsMetadataListBySubscriptionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListBySubscriptionSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for AssessmentsMetadata ListBySubscription. */ public final class AssessmentsMetadataListBySubscriptionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/ListAssessmentsMetadata_subscription_example.json + */ /** * Sample code: List security assessment metadata for subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void listSecurityAssessmentMetadataForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.assessmentsMetadatas().listBySubscription(Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessmentsMetadatas().listBySubscription(Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListSamples.java new file mode 100644 index 0000000000000..50d946d45a062 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for AssessmentsMetadata List. */ +public final class AssessmentsMetadataListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json + */ + /** + * Sample code: List security assessment metadata. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecurityAssessmentMetadata(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessmentsMetadatas().list(Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsCreateSamples.java similarity index 50% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsCreateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsCreateSamples.java index 92ce0509faf48..3be32ccad5fcb 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsCreateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsCreateSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.resourcemanager.security.models.AutoProvision; /** Samples for AutoProvisioningSettings Create. */ public final class AutoProvisioningSettingsCreateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/CreateAutoProvisioningSettingsSubscription_example.json + */ /** * Sample code: Create auto provisioning settings for subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void createAutoProvisioningSettingsForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.autoProvisioningSettings().define("default").withAutoProvision(AutoProvision.ON).create(); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.autoProvisioningSettings().define("default").withAutoProvision(AutoProvision.ON).create(); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsGetSamples.java new file mode 100644 index 0000000000000..3d26e6c9be8f7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for AutoProvisioningSettings Get. */ +public final class AutoProvisioningSettingsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/GetAutoProvisioningSettingSubscription_example.json + */ + /** + * Sample code: Get an auto provisioning setting for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAnAutoProvisioningSettingForSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.autoProvisioningSettings().getWithResponse("default", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsListSamples.java similarity index 50% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsListSamples.java index b3c1dca86f1b9..d4d0c2342adf4 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutoProvisioningSettingsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsListSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for AutoProvisioningSettings List. */ public final class AutoProvisioningSettingsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/GetAutoProvisioningSettingsSubscription_example.json + */ /** * Sample code: Get auto provisioning settings for subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getAutoProvisioningSettingsForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.autoProvisioningSettings().list(Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.autoProvisioningSettings().list(Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateSamples.java similarity index 87% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsCreateOrUpdateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateSamples.java index 83c4006099e91..7d93c45686371 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsCreateOrUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.resourcemanager.security.models.AutomationActionLogicApp; import com.azure.resourcemanager.security.models.AutomationRuleSet; @@ -18,15 +18,17 @@ /** Samples for Automations CreateOrUpdate. */ public final class AutomationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutAutomationAllAssessments_example.json + */ /** * Sample code: Create or update a security automation for all assessments (including all severities). * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void createOrUpdateASecurityAutomationForAllAssessmentsIncludingAllSeverities( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .automations() .define("exampleAutomation") .withRegion("Central US") @@ -57,15 +59,16 @@ public static void createOrUpdateASecurityAutomationForAllAssessmentsIncludingAl .create(); } + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutDisableAutomation_example.json + */ /** * Sample code: Disable or enable a security automation. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void disableOrEnableASecurityAutomation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void disableOrEnableASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { + manager .automations() .define("exampleAutomation") .withRegion("Central US") @@ -112,23 +115,25 @@ public static void disableOrEnableASecurityAutomation( .create(); } + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutAutomationHighSeverityAssessments_example.json + */ /** * Sample code: Create or update a security automation for all high severity assessments. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void createOrUpdateASecurityAutomationForAllHighSeverityAssessments( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .automations() .define("exampleAutomation") .withRegion("Central US") .withExistingResourceGroup("exampleResourceGroup") .withTags(mapOf()) .withDescription( - "An example of a security automation that triggers one LogicApp resource (myTest1) on any high" - + " severity security assessment") + "An example of a security automation that triggers one LogicApp resource (myTest1) on any high severity" + + " security assessment") .withIsEnabled(true) .withScopes( Arrays diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsDeleteSamples.java new file mode 100644 index 0000000000000..1ab752b15b239 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Automations Delete. */ +public final class AutomationsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/DeleteAutomation_example.json + */ + /** + * Sample code: Delete a security automation. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.automations().deleteWithResponse("myRg", "myAutomationName", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..cf9d5671476dd --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Automations GetByResourceGroup. */ +public final class AutomationsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationResourceGroup_example.json + */ + /** + * Sample code: Retrieve a security automation. + * + * @param manager Entry point to SecurityManager. + */ + public static void retrieveASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.automations().getByResourceGroupWithResponse("exampleResourceGroup", "exampleAutomation", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListByResourceGroupSamples.java similarity index 51% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsListByResourceGroupSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListByResourceGroupSamples.java index 6c915da44fc3b..e01250d097525 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsListByResourceGroupSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListByResourceGroupSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Automations ListByResourceGroup. */ public final class AutomationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationsResourceGroup_example.json + */ /** * Sample code: List all security automations of a specified resource group. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void listAllSecurityAutomationsOfASpecifiedResourceGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.automations().listByResourceGroup("exampleResourceGroup", Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.automations().listByResourceGroup("exampleResourceGroup", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListSamples.java similarity index 52% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListSamples.java index f6c94c83785cf..b08458f15aec3 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Automations List. */ public final class AutomationsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationsSubscription_example.json + */ /** * Sample code: List all security automations of a specified subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void listAllSecurityAutomationsOfASpecifiedSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.automations().list(Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.automations().list(Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsValidateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsValidateSamples.java similarity index 92% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsValidateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsValidateSamples.java index e0f22b8ea6e3b..290addda4826a 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/AutomationsValidateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsValidateSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.security.fluent.models.AutomationInner; @@ -20,15 +20,17 @@ /** Samples for Automations Validate. */ public final class AutomationsValidateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/ValidateAutomation_example.json + */ /** * Sample code: Validate the security automation model before create or update. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void validateTheSecurityAutomationModelBeforeCreateOrUpdate( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .automations() .validateWithResponse( "exampleResourceGroup", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ComplianceResultsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsGetSamples.java similarity index 56% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ComplianceResultsGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsGetSamples.java index 8e71d2c666e33..bf64e0c5d0cf7 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ComplianceResultsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsGetSamples.java @@ -2,21 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** 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 securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getComplianceResultsOnSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void getComplianceResultsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager .complianceResults() .getWithResponse( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "DesignateMoreThanOneOwner", Context.NONE); diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsListSamples.java new file mode 100644 index 0000000000000..17788b0153229 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsListSamples.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; + +import com.azure.core.util.Context; + +/** 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", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/CompliancesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesGetSamples.java similarity index 54% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/CompliancesGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesGetSamples.java index 01a4b15de0c44..783e52d8a90f0 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/CompliancesGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesGetSamples.java @@ -2,21 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** 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 securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getSecurityComplianceDataForADay( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void getSecurityComplianceDataForADay(com.azure.resourcemanager.security.SecurityManager manager) { + manager .compliances() .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "2018-01-01Z", Context.NONE); } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesListSamples.java new file mode 100644 index 0000000000000..08b7fa294f581 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesListSamples.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; + +import com.azure.core.util.Context; + +/** 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", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsCreateOrUpdateSamples.java similarity index 86% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsCreateOrUpdateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsCreateOrUpdateSamples.java index 6ab5decade7b4..88665074156cc 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsCreateOrUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsCreateOrUpdateSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.resourcemanager.security.models.AutoProvision; import com.azure.resourcemanager.security.models.AwAssumeRoleAuthenticationDetailsProperties; @@ -14,15 +14,17 @@ /** 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 securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void gcpCredentialsCreateACloudAccountConnectorForASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .connectors() .define("gcp_dev") .withHybridComputeSettings(new HybridComputeSettingsProperties().withAutoProvision(AutoProvision.OFF)) @@ -71,15 +73,17 @@ public static void gcpCredentialsCreateACloudAccountConnectorForASubscription( .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 securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void awsCredCreateACloudAccountConnectorForASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .connectors() .define("aws_dev1") .withHybridComputeSettings( @@ -99,15 +103,17 @@ public static void awsCredCreateACloudAccountConnectorForASubscription( .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 securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void awsAssumeRoleCreateACloudAccountConnectorForASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .connectors() .define("aws_dev2") .withHybridComputeSettings( diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsDeleteSamples.java similarity index 50% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsDeleteSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsDeleteSamples.java index ec0a2aefeede9..c00a2e80cb785 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsDeleteSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** 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 securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void deleteACloudAccountConnectorFromASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.connectors().deleteWithResponse("aws_dev1", Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.connectors().deleteWithResponse("aws_dev1", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsGetSamples.java new file mode 100644 index 0000000000000..030dba9b18999 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsGetSamples.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; + +import com.azure.core.util.Context; + +/** 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", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsListSamples.java similarity index 51% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsListSamples.java index 5b366d2f8e5ad..d514b40724794 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ConnectorsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsListSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** 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 securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getAllCloudAccountsConnectorsOfASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.connectors().list(Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.connectors().list(Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsCreateSamples.java new file mode 100644 index 0000000000000..4f4eda42a660c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsCreateSamples.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.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(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsDeleteSamples.java new file mode 100644 index 0000000000000..24ca795d71f95 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** 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() + .deleteWithResponse("TestResourceGroup", "MyCustomAssessmentAutomation", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..ce01fa6f39689 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsGetByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** 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", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..9cefc95fc412b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** 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", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListSamples.java new file mode 100644 index 0000000000000..3c3c3672b7dfe --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListSamples.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; + +import com.azure.core.util.Context; + +/** 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(Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsCreateSamples.java new file mode 100644 index 0000000000000..e06c26adafb26 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsCreateSamples.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.generated; + +/** 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(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsDeleteSamples.java new file mode 100644 index 0000000000000..f995b767d5f57 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** 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() + .deleteWithResponse("TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..4434a4e307b7d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsGetByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** 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", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..267815ae5beac --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** 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", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListSamples.java new file mode 100644 index 0000000000000..611304842ae74 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListSamples.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; + +import com.azure.core.util.Context; + +/** 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(Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsCreateOrUpdateSamples.java similarity index 77% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsCreateOrUpdateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsCreateOrUpdateSamples.java index 1a9fc303bef97..24125fcaa96ad 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsCreateOrUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsCreateOrUpdateSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.resourcemanager.security.models.ActiveConnectionsNotInAllowedRange; import java.time.Duration; @@ -10,15 +10,17 @@ /** Samples for DeviceSecurityGroups CreateOrUpdate. */ public final class DeviceSecurityGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/PutDeviceSecurityGroups_example.json + */ /** * Sample code: Create or update a device security group for the specified IoT hub resource. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void createOrUpdateADeviceSecurityGroupForTheSpecifiedIoTHubResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .deviceSecurityGroups() .define("samplesecuritygroup") .withExistingResourceId( diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsDeleteSamples.java similarity index 67% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsDeleteSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsDeleteSamples.java index 1d020d2367233..d43fcd696dec9 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsDeleteSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for DeviceSecurityGroups Delete. */ public final class DeviceSecurityGroupsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/DeleteDeviceSecurityGroups_example.json + */ /** * Sample code: Delete a device security group for the specified IoT Hub resource. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void deleteADeviceSecurityGroupForTheSpecifiedIoTHubResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .deviceSecurityGroups() .deleteWithResponse( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsGetSamples.java similarity index 66% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsGetSamples.java index e4aa1153ce3a2..ed7273a61a0b4 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsGetSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for DeviceSecurityGroups Get. */ public final class DeviceSecurityGroupsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/GetDeviceSecurityGroups_example.json + */ /** * Sample code: Get a device security group for the specified IoT Hub resource. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getADeviceSecurityGroupForTheSpecifiedIoTHubResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .deviceSecurityGroups() .getWithResponse( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsListSamples.java similarity index 65% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsListSamples.java index 5858a1d45d040..509ed4381408d 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DeviceSecurityGroupsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsListSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for DeviceSecurityGroups List. */ public final class DeviceSecurityGroupsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/ListDeviceSecurityGroups_example.json + */ /** * Sample code: List all device security groups for the specified IoT Hub resource. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void listAllDeviceSecurityGroupsForTheSpecifiedIoTHubResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .deviceSecurityGroups() .list( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetSamples.java new file mode 100644 index 0000000000000..a9b5a5131d72e --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for DiscoveredSecuritySolutions Get. */ +public final class DiscoveredSecuritySolutionsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionResourceGroupLocation_example.json + */ + /** + * Sample code: Get discovered security solution from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getDiscoveredSecuritySolutionFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.discoveredSecuritySolutions().getWithResponse("myRg2", "centralus", "paloalto7", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListByHomeRegionSamples.java similarity index 51% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsListByHomeRegionSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListByHomeRegionSamples.java index e7f1fd9905818..c91f1ac4215e5 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/DiscoveredSecuritySolutionsListByHomeRegionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListByHomeRegionSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for DiscoveredSecuritySolutions ListByHomeRegion. */ public final class DiscoveredSecuritySolutionsListByHomeRegionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionsSubscriptionLocation_example.json + */ /** * Sample code: Get discovered security solutions from a security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getDiscoveredSecuritySolutionsFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.discoveredSecuritySolutions().listByHomeRegion("centralus", Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.discoveredSecuritySolutions().listByHomeRegion("centralus", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListSamples.java new file mode 100644 index 0000000000000..b47bac33d4f42 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for DiscoveredSecuritySolutions List. */ +public final class DiscoveredSecuritySolutionsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionsSubscription_example.json + */ + /** + * Sample code: Get discovered security solutions. + * + * @param manager Entry point to SecurityManager. + */ + public static void getDiscoveredSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { + manager.discoveredSecuritySolutions().list(Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsGetSamples.java similarity index 65% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsGetSamples.java index 4037da239892b..a973316c35103 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsGetSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for ExternalSecuritySolutions Get. */ public final class ExternalSecuritySolutionsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolution_example.json + */ /** * Sample code: Get external security solution. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getExternalSecuritySolution(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void getExternalSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { + manager .externalSecuritySolutions() .getWithResponse( "defaultresourcegroup-eus", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListByHomeRegionSamples.java similarity index 53% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsListByHomeRegionSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListByHomeRegionSamples.java index 9912c79417fb5..b904166fdf625 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsListByHomeRegionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListByHomeRegionSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for ExternalSecuritySolutions ListByHomeRegion. */ public final class ExternalSecuritySolutionsListByHomeRegionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolutionsSubscriptionLocation_example.json + */ /** * Sample code: Get external security solutions on a subscription from security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getExternalSecuritySolutionsOnASubscriptionFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.externalSecuritySolutions().listByHomeRegion("centralus", Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.externalSecuritySolutions().listByHomeRegion("centralus", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListSamples.java similarity index 51% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListSamples.java index 48ab7a09d10f7..8fc973100527f 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ExternalSecuritySolutionsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** 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 securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getExternalSecuritySolutionsOnASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.externalSecuritySolutions().list(Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.externalSecuritySolutions().list(Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateSamples.java similarity index 89% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesCreateOrUpdateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateSamples.java index 302f064f24579..012b40d82e3a7 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesCreateOrUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.resourcemanager.security.models.InformationProtectionKeyword; import com.azure.resourcemanager.security.models.InformationProtectionPoliciesInformationProtectionPolicyName; @@ -15,15 +15,17 @@ /** Samples for InformationProtectionPolicies CreateOrUpdate. */ public final class InformationProtectionPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/CreateOrUpdateInformationProtectionPolicy_example.json + */ /** * Sample code: Create or update an information protection policy for a management group. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void createOrUpdateAnInformationProtectionPolicyForAManagementGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .informationProtectionPolicies() .define(InformationProtectionPoliciesInformationProtectionPolicyName.CUSTOM) .withExistingScope("providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e") diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetSamples.java similarity index 65% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetSamples.java index 1892817035b42..515dc01402c9e 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetSamples.java @@ -2,22 +2,24 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.InformationProtectionPoliciesInformationProtectionPolicyName; /** Samples for InformationProtectionPolicies Get. */ public final class InformationProtectionPoliciesGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/GetCustomInformationProtectionPolicy_example.json + */ /** * Sample code: Get the customized information protection policy for a management group. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getTheCustomizedInformationProtectionPolicyForAManagementGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .informationProtectionPolicies() .getWithResponse( "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", @@ -25,15 +27,17 @@ public static void getTheCustomizedInformationProtectionPolicyForAManagementGrou Context.NONE); } + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/GetEffectiveInformationProtectionPolicy_example.json + */ /** * Sample code: Get the effective information protection policy for a management group. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getTheEffectiveInformationProtectionPolicyForAManagementGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .informationProtectionPolicies() .getWithResponse( "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListSamples.java similarity index 55% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListSamples.java index ae86d7fba7ae2..a0caa0b0060ed 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/InformationProtectionPoliciesListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListSamples.java @@ -2,21 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for InformationProtectionPolicies List. */ public final class InformationProtectionPoliciesListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/ListInformationProtectionPolicies_example.json + */ /** * Sample code: Get information protection policies. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getInformationProtectionPolicies( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void getInformationProtectionPolicies(com.azure.resourcemanager.security.SecurityManager manager) { + manager .informationProtectionPolicies() .list("providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", Context.NONE); } 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/IngestionSettingsCreateSamples.java new file mode 100644 index 0000000000000..822344341a76f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsCreateSamples.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 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(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteSamples.java similarity index 50% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsDeleteSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteSamples.java index f9d9e84a733a0..110f7d10abd7b 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** 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 securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void deleteAnIngestionSettingForTheSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.ingestionSettings().deleteWithResponse("default", Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.ingestionSettings().deleteWithResponse("default", 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 new file mode 100644 index 0000000000000..100bc62997789 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetSamples.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; + +import com.azure.core.util.Context; + +/** 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", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListConnectionStringsSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsSamples.java similarity index 52% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListConnectionStringsSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsSamples.java index 8a37257f9de1e..83f53d7b32b2d 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListConnectionStringsSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** 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 securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void listConnectionStringsForIngestingSecurityDataAndLogs( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.ingestionSettings().listConnectionStringsWithResponse("default", Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.ingestionSettings().listConnectionStringsWithResponse("default", 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 new file mode 100644 index 0000000000000..88446ff86d961 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListSamples.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; + +import com.azure.core.util.Context; + +/** 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(Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListTokensSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListTokensSamples.java similarity index 50% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListTokensSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListTokensSamples.java index c1c4f2e63867e..3266ef4937bf2 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IngestionSettingsListTokensSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListTokensSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** 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 securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void listIngestionSettingTokens(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.ingestionSettings().listTokensWithResponse("default", Context.NONE); + public static void listIngestionSettingTokens(com.azure.resourcemanager.security.SecurityManager manager) { + manager.ingestionSettings().listTokensWithResponse("default", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetSamples.java new file mode 100644 index 0000000000000..a730f27225dc7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for IotSecuritySolutionAnalytics Get. */ +public final class IotSecuritySolutionAnalyticsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalytics.json + */ + /** + * Sample code: Get Security Solution Analytics. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecuritySolutionAnalytics(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionAnalytics().getWithResponse("MyGroup", "default", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListSamples.java new file mode 100644 index 0000000000000..ea9d60a61c130 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for IotSecuritySolutionAnalytics List. */ +public final class IotSecuritySolutionAnalyticsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalyticsList.json + */ + /** + * Sample code: Get Security Solution Analytics. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecuritySolutionAnalytics(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionAnalytics().listWithResponse("MyGroup", "default", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionCreateOrUpdateSamples.java similarity index 87% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionCreateOrUpdateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionCreateOrUpdateSamples.java index 87f966cfdd6fe..3b20451ebc2eb 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionCreateOrUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionCreateOrUpdateSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.resourcemanager.security.models.RecommendationConfigStatus; import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; @@ -16,15 +16,16 @@ /** Samples for IotSecuritySolution CreateOrUpdate. */ public final class IotSecuritySolutionCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/CreateIoTSecuritySolution.json + */ /** * Sample code: Create or update a IoT security solution. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void createOrUpdateAIoTSecuritySolution( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void createOrUpdateAIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { + manager .iotSecuritySolutions() .define("default") .withExistingResourceGroup("MyGroup") diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionDeleteSamples.java similarity index 50% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionDeleteSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionDeleteSamples.java index f0600963ce35a..d8c6a6aef3922 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionDeleteSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for IotSecuritySolution Delete. */ public final class IotSecuritySolutionDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/DeleteIoTSecuritySolution.json + */ /** * Sample code: Delete an IoT security solution. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void deleteAnIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotSecuritySolutions().deleteWithResponse("MyGroup", "default", Context.NONE); + public static void deleteAnIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutions().deleteWithResponse("MyGroup", "default", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionGetByResourceGroupSamples.java similarity index 51% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionGetByResourceGroupSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionGetByResourceGroupSamples.java index ed945a50d5c1e..ed7eaa93f72ac 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionGetByResourceGroupSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionGetByResourceGroupSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for IotSecuritySolution GetByResourceGroup. */ public final class IotSecuritySolutionGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolution.json + */ /** * Sample code: Get a IoT security solution. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getAIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotSecuritySolutions().getByResourceGroupWithResponse("MyGroup", "default", Context.NONE); + public static void getAIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutions().getByResourceGroupWithResponse("MyGroup", "default", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListByResourceGroupSamples.java similarity index 55% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionListByResourceGroupSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListByResourceGroupSamples.java index eb3aa2b24dddb..c7ac3f499ea34 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionListByResourceGroupSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListByResourceGroupSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for IotSecuritySolution ListByResourceGroup. */ public final class IotSecuritySolutionListByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByIotHubAndRg.json + */ /** * Sample code: List IoT Security solutions by resource group and IoT Hub. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void listIoTSecuritySolutionsByResourceGroupAndIoTHub( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .iotSecuritySolutions() .listByResourceGroup( "MyRg", @@ -25,14 +27,16 @@ public static void listIoTSecuritySolutionsByResourceGroupAndIoTHub( Context.NONE); } + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByRg.json + */ /** * Sample code: List IoT Security solutions by resource group. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void listIoTSecuritySolutionsByResourceGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotSecuritySolutions().listByResourceGroup("MyGroup", null, Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutions().listByResourceGroup("MyGroup", null, Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListSamples.java similarity index 50% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListSamples.java index 3a0c7317723b6..db8995d2d7a49 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListSamples.java @@ -2,32 +2,35 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for IotSecuritySolution List. */ public final class IotSecuritySolutionListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsList.json + */ /** * Sample code: List IoT Security solutions by subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void listIoTSecuritySolutionsBySubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotSecuritySolutions().list(null, Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutions().list(null, Context.NONE); } + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByIotHub.json + */ /** * Sample code: List IoT Security solutions by IoT Hub. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void listIoTSecuritySolutionsByIoTHub( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void listIoTSecuritySolutionsByIoTHub(com.azure.resourcemanager.security.SecurityManager manager) { + manager .iotSecuritySolutions() .list( "properties.iotHubs/any(i eq" diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionUpdateSamples.java similarity index 82% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionUpdateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionUpdateSamples.java index 5dca3cda751a7..91b615ae42ace 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionUpdateSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.IoTSecuritySolutionModel; @@ -16,19 +16,18 @@ /** Samples for IotSecuritySolution Update. */ public final class IotSecuritySolutionUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/UpdateIoTSecuritySolution.json + */ /** * Sample code: Use this method to update existing IoT Security solution. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void useThisMethodToUpdateExistingIoTSecuritySolution( - com.azure.resourcemanager.security.SecurityManager securityManager) { + com.azure.resourcemanager.security.SecurityManager manager) { IoTSecuritySolutionModel resource = - securityManager - .iotSecuritySolutions() - .getByResourceGroupWithResponse("myRg", "default", Context.NONE) - .getValue(); + manager.iotSecuritySolutions().getByResourceGroupWithResponse("myRg", "default", Context.NONE).getValue(); resource .update() .withTags(mapOf("foo", "bar")) diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java similarity index 62% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java index ea59f30cb66fc..195f009e4ee21 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert Dismiss. */ public final class IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/PostIoTSecuritySolutionsSecurityAggregatedAlertDismiss.json + */ /** * Sample code: Dismiss an aggregated IoT Security Solution Alert. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void dismissAnAggregatedIoTSecuritySolutionAlert( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .iotSecuritySolutionsAnalyticsAggregatedAlerts() .dismissWithResponse("IoTEdgeResources", "default", "IoT_Bruteforce_Fail/2019-02-02/dismiss", Context.NONE); } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples.java similarity index 66% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples.java index 0a70c532e1871..1ec0b400137ba 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples.java @@ -2,23 +2,25 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert Get. */ public final class IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAggregatedAlert.json + */ /** * Sample code: Get the aggregated security analytics alert of yours IoT Security solution. This aggregation is * performed by alert name. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getTheAggregatedSecurityAnalyticsAlertOfYoursIoTSecuritySolutionThisAggregationIsPerformedByAlertName( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .iotSecuritySolutionsAnalyticsAggregatedAlerts() .getWithResponse("MyGroup", "default", "IoT_Bruteforce_Fail/2019-02-02", Context.NONE); } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java similarity index 51% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java index a68339927781d..2a5d44e133544 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert List. */ public final class IotSecuritySolutionsAnalyticsAggregatedAlertListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAggregatedAlertList.json + */ /** * Sample code: Get the aggregated alert list of yours IoT Security solution. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getTheAggregatedAlertListOfYoursIoTSecuritySolution( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.iotSecuritySolutionsAnalyticsAggregatedAlerts().list("MyGroup", "default", null, Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionsAnalyticsAggregatedAlerts().list("MyGroup", "default", null, Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsRecommendationGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationGetSamples.java similarity index 64% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsRecommendationGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationGetSamples.java index 3489f2cc9db68..deb456d305d91 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsRecommendationGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationGetSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for IotSecuritySolutionsAnalyticsRecommendation Get. */ public final class IotSecuritySolutionsAnalyticsRecommendationGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendation.json + */ /** * Sample code: Get the aggregated security analytics recommendation of yours IoT Security solution. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getTheAggregatedSecurityAnalyticsRecommendationOfYoursIoTSecuritySolution( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .iotSecuritySolutionsAnalyticsRecommendations() .getWithResponse("IoTEdgeResources", "default", "OpenPortsOnDevice", Context.NONE); } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsRecommendationListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationListSamples.java similarity index 53% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsRecommendationListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationListSamples.java index 01f29343e7f19..d62d0c7b56fa0 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/IotSecuritySolutionsAnalyticsRecommendationListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationListSamples.java @@ -2,22 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for IotSecuritySolutionsAnalyticsRecommendation List. */ public final class IotSecuritySolutionsAnalyticsRecommendationListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendationList.json + */ /** * Sample code: Get the list of aggregated security analytics recommendations of yours IoT Security solution. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getTheListOfAggregatedSecurityAnalyticsRecommendationsOfYoursIoTSecuritySolution( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager - .iotSecuritySolutionsAnalyticsRecommendations() - .list("IoTEdgeResources", "default", null, Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionsAnalyticsRecommendations().list("IoTEdgeResources", "default", null, Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesCreateOrUpdateSamples.java similarity index 88% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesCreateOrUpdateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesCreateOrUpdateSamples.java index bf559ca052686..733f04468703e 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesCreateOrUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesCreateOrUpdateSamples.java @@ -2,14 +2,14 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyVirtualMachine; import com.azure.resourcemanager.security.models.JitNetworkAccessPortRule; import com.azure.resourcemanager.security.models.JitNetworkAccessRequestPort; import com.azure.resourcemanager.security.models.JitNetworkAccessRequestVirtualMachine; -import com.azure.resourcemanager.security.models.ProtocolValue; +import com.azure.resourcemanager.security.models.Protocol; import com.azure.resourcemanager.security.models.Status; import com.azure.resourcemanager.security.models.StatusReason; import java.time.OffsetDateTime; @@ -17,15 +17,16 @@ /** Samples for JitNetworkAccessPolicies CreateOrUpdate. */ public final class JitNetworkAccessPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/CreateJitNetworkAccessPolicy_example.json + */ /** * Sample code: Create JIT network access policy. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void createJITNetworkAccessPolicy( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void createJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { + manager .jitNetworkAccessPolicies() .define("default") .withExistingLocation("myRg1", "westeurope") @@ -40,14 +41,15 @@ public static void createJITNetworkAccessPolicy( .asList( new JitNetworkAccessPortRule() .withNumber(22) - .withProtocol(ProtocolValue.ASTERISK) + .withProtocol(Protocol.ASTERISK) .withAllowedSourceAddressPrefix("*") .withMaxRequestAccessDuration("PT3H"), new JitNetworkAccessPortRule() .withNumber(3389) - .withProtocol(ProtocolValue.ASTERISK) + .withProtocol(Protocol.ASTERISK) .withAllowedSourceAddressPrefix("*") .withMaxRequestAccessDuration("PT3H"))))) + .withKind("Basic") .withRequests( Arrays .asList( @@ -70,7 +72,6 @@ public static void createJITNetworkAccessPolicy( .withStatusReason(StatusReason.USER_REQUESTED))))) .withStartTimeUtc(OffsetDateTime.parse("2018-05-17T08:06:45.5691611Z")) .withRequestor("barbara@contoso.com"))) - .withKind("Basic") .create(); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteSamples.java new file mode 100644 index 0000000000000..901e757aee799 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for JitNetworkAccessPolicies Delete. */ +public final class JitNetworkAccessPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/DeleteJitNetworkAccessPolicy_example.json + */ + /** + * Sample code: Delete a JIT network access policy. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteAJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies().deleteWithResponse("myRg1", "westeurope", "default", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetSamples.java new file mode 100644 index 0000000000000..7980fe421c11a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for JitNetworkAccessPolicies Get. */ +public final class JitNetworkAccessPoliciesGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPolicy_example.json + */ + /** + * Sample code: Get JIT network access policy. + * + * @param manager Entry point to SecurityManager. + */ + public static void getJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies().getWithResponse("myRg1", "westeurope", "default", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesInitiateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesInitiateSamples.java similarity index 83% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesInitiateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesInitiateSamples.java index 43649aef6b621..580773955da76 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesInitiateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesInitiateSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiatePort; @@ -12,15 +12,17 @@ /** Samples for JitNetworkAccessPolicies Initiate. */ public final class JitNetworkAccessPoliciesInitiateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/InitiateJitNetworkAccessPolicy_example.json + */ /** * Sample code: Initiate an action on a JIT network access policy. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void initiateAnActionOnAJITNetworkAccessPolicy( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .jitNetworkAccessPolicies() .initiateWithResponse( "myRg1", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByRegionSamples.java similarity index 53% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByRegionSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByRegionSamples.java index 0f8fc45db0b0f..1b28bab688c3d 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByRegionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByRegionSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for JitNetworkAccessPolicies ListByRegion. */ public final class JitNetworkAccessPoliciesListByRegionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesSubscriptionLocation_example.json + */ /** * Sample code: Get JIT network access policies on a subscription from a security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getJITNetworkAccessPoliciesOnASubscriptionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.jitNetworkAccessPolicies().listByRegion("westeurope", Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies().listByRegion("westeurope", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java similarity index 53% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java index e6f026cb04e5b..6c889374a2e07 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for JitNetworkAccessPolicies ListByResourceGroupAndRegion. */ public final class JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesResourceGroupLocation_example.json + */ /** * Sample code: Get JIT network access policies on a resource group from a security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getJITNetworkAccessPoliciesOnAResourceGroupFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.jitNetworkAccessPolicies().listByResourceGroupAndRegion("myRg1", "westeurope", Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies().listByResourceGroupAndRegion("myRg1", "westeurope", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupSamples.java similarity index 51% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByResourceGroupSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupSamples.java index f72d5fd8f1dc8..9869861f626ed 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListByResourceGroupSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for JitNetworkAccessPolicies ListByResourceGroup. */ public final class JitNetworkAccessPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesResourceGroup_example.json + */ /** * Sample code: Get JIT network access policies on a resource group. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getJITNetworkAccessPoliciesOnAResourceGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.jitNetworkAccessPolicies().listByResourceGroup("myRg1", Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies().listByResourceGroup("myRg1", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListSamples.java similarity index 51% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListSamples.java index dc07fc66348ad..282237c4306dc 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/JitNetworkAccessPoliciesListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for JitNetworkAccessPolicies List. */ public final class JitNetworkAccessPoliciesListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesSubscription_example.json + */ /** * Sample code: Get JIT network access policies on a subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getJITNetworkAccessPoliciesOnASubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.jitNetworkAccessPolicies().list(Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies().list(Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/LocationsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsGetSamples.java similarity index 50% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/LocationsGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsGetSamples.java index faa57df79bab3..67816790d9a44 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/LocationsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsGetSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Locations Get. */ public final class LocationsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Locations/GetLocation_example.json + */ /** * Sample code: Get security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getSecurityDataLocation(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.locations().getWithResponse("centralus", Context.NONE); + public static void getSecurityDataLocation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.locations().getWithResponse("centralus", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/LocationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsListSamples.java similarity index 52% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/LocationsListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsListSamples.java index b81a22baab765..ef4c1b59677d1 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/LocationsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsListSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Locations List. */ public final class LocationsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Locations/GetLocations_example.json + */ /** * Sample code: Get security data locations. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getSecurityDataLocations(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.locations().list(Context.NONE); + public static void getSecurityDataLocations(com.azure.resourcemanager.security.SecurityManager manager) { + manager.locations().list(Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetSamples.java new file mode 100644 index 0000000000000..a1d769d0f6340 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for MdeOnboardings Get. */ +public final class MdeOnboardingsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-10-01-preview/examples/MdeOnboardings/GetMdeOnboardings_example.json + */ + /** + * Sample code: The default configuration or data needed to onboard the machine to MDE. + * + * @param manager Entry point to SecurityManager. + */ + public static void theDefaultConfigurationOrDataNeededToOnboardTheMachineToMDE( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.mdeOnboardings().getWithResponse(Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListSamples.java new file mode 100644 index 0000000000000..2fa5b118906d8 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for MdeOnboardings List. */ +public final class MdeOnboardingsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-10-01-preview/examples/MdeOnboardings/ListMdeOnboardings_example.json + */ + /** + * Sample code: The configuration or data needed to onboard the machine to MDE. + * + * @param manager Entry point to SecurityManager. + */ + public static void theConfigurationOrDataNeededToOnboardTheMachineToMDE( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.mdeOnboardings().listWithResponse(Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsGetSamples.java similarity index 50% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsGetSamples.java index fc2e9bb56a0a4..134c79483823e 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsGetSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Pricings Get. */ public final class PricingsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/examples/Pricings/GetPricingByName_example.json + */ /** * Sample code: Get pricings on subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getPricingsOnSubscription(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.pricings().getWithResponse("VirtualMachines", Context.NONE); + public static void getPricingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings().getWithResponse("VirtualMachines", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsListSamples.java similarity index 52% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsListSamples.java index 703d0d9cd5ed6..cc97cbc33b0c5 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsListSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Pricings List. */ public final class PricingsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/examples/Pricings/ListPricings_example.json + */ /** * Sample code: Get pricings on subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getPricingsOnSubscription(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.pricings().listWithResponse(Context.NONE); + public static void getPricingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings().listWithResponse(Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsUpdateSamples.java similarity index 67% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsUpdateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsUpdateSamples.java index 9102510c307d2..f0b75eaadc2c2 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/PricingsUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsUpdateSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.security.fluent.models.PricingInner; @@ -10,14 +10,16 @@ /** Samples for Pricings Update. */ public final class PricingsUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/examples/Pricings/PutPricingByName_example.json + */ /** * Sample code: Update pricing on subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void updatePricingOnSubscription(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void updatePricingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager .pricings() .updateWithResponse( "VirtualMachines", new PricingInner().withPricingTier(PricingTier.STANDARD), Context.NONE); diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceAssessmentsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsGetSamples.java similarity index 62% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceAssessmentsGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsGetSamples.java index af1bb81d6ace9..f738a6e89a514 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceAssessmentsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsGetSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for RegulatoryComplianceAssessments Get. */ public final class RegulatoryComplianceAssessmentsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceAssessment_example.json + */ /** * Sample code: Get selected regulatory compliance assessment details and state. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getSelectedRegulatoryComplianceAssessmentDetailsAndState( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .regulatoryComplianceAssessments() .getWithResponse("PCI-DSS-3.2", "1.1", "968548cb-02b3-8cd2-11f8-0cf64ab1a347", Context.NONE); } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceAssessmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsListSamples.java similarity index 51% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceAssessmentsListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsListSamples.java index 3099ee7d6f2d0..625601c1643d4 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceAssessmentsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsListSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for RegulatoryComplianceAssessments List. */ public final class RegulatoryComplianceAssessmentsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceAssessmentList_example.json + */ /** * Sample code: Get all assessments mapped to selected regulatory compliance control. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getAllAssessmentsMappedToSelectedRegulatoryComplianceControl( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.regulatoryComplianceAssessments().list("PCI-DSS-3.2", "1.1", null, Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.regulatoryComplianceAssessments().list("PCI-DSS-3.2", "1.1", null, Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceControlsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsGetSamples.java similarity index 50% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceControlsGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsGetSamples.java index ffac6ffea7a7a..75cf0f0987626 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceControlsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsGetSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for RegulatoryComplianceControls Get. */ public final class RegulatoryComplianceControlsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceControl_example.json + */ /** * Sample code: Get selected regulatory compliance control details and state. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getSelectedRegulatoryComplianceControlDetailsAndState( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.regulatoryComplianceControls().getWithResponse("PCI-DSS-3.2", "1.1", Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.regulatoryComplianceControls().getWithResponse("PCI-DSS-3.2", "1.1", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceControlsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsListSamples.java similarity index 53% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceControlsListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsListSamples.java index a3e8b3ffc374d..cbbe872370a38 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceControlsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsListSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for RegulatoryComplianceControls List. */ public final class RegulatoryComplianceControlsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceControlList_example.json + */ /** * Sample code: Get all regulatory compliance controls details and state for selected standard. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getAllRegulatoryComplianceControlsDetailsAndStateForSelectedStandard( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.regulatoryComplianceControls().list("PCI-DSS-3.2", null, Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.regulatoryComplianceControls().list("PCI-DSS-3.2", null, Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceStandardsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsGetSamples.java similarity index 51% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceStandardsGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsGetSamples.java index 7931c47fff84b..23d37a285792a 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceStandardsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsGetSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for RegulatoryComplianceStandards Get. */ public final class RegulatoryComplianceStandardsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceStandard_example.json + */ /** * Sample code: Get selected regulatory compliance standard details and state. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getSelectedRegulatoryComplianceStandardDetailsAndState( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.regulatoryComplianceStandards().getWithResponse("PCI-DSS-3.2", Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.regulatoryComplianceStandards().getWithResponse("PCI-DSS-3.2", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceStandardsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsListSamples.java similarity index 52% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceStandardsListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsListSamples.java index d9a460ad52804..ba2eb53c723f7 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/RegulatoryComplianceStandardsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsListSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for RegulatoryComplianceStandards List. */ public final class RegulatoryComplianceStandardsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceStandardList_example.json + */ /** * Sample code: Get all supported regulatory compliance standards details and state. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getAllSupportedRegulatoryComplianceStandardsDetailsAndState( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.regulatoryComplianceStandards().list(null, Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.regulatoryComplianceStandards().list(null, Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlDefinitionsListBySubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListBySubscriptionSamples.java similarity index 51% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlDefinitionsListBySubscriptionSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListBySubscriptionSamples.java index 4929da4c92ed3..b9369eaff31f2 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlDefinitionsListBySubscriptionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListBySubscriptionSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for SecureScoreControlDefinitions ListBySubscription. */ public final class SecureScoreControlDefinitionsListBySubscriptionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScoreControlDefinitions/ListSecureScoreControlDefinitions_subscription_example.json + */ /** * Sample code: List security controls definition by subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void listSecurityControlsDefinitionBySubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.secureScoreControlDefinitions().listBySubscription(Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScoreControlDefinitions().listBySubscription(Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListSamples.java new file mode 100644 index 0000000000000..5fbb2adbae3cc --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for SecureScoreControlDefinitions List. */ +public final class SecureScoreControlDefinitionsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScoreControlDefinitions/ListSecureScoreControlDefinitions_example.json + */ + /** + * Sample code: List security controls definition. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecurityControlsDefinition(com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScoreControlDefinitions().list(Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreSamples.java new file mode 100644 index 0000000000000..455b442dd2e0d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreSamples.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.core.util.Context; +import com.azure.resourcemanager.security.models.ExpandControlsEnum; + +/** Samples for SecureScoreControls ListBySecureScore. */ +public final class SecureScoreControlsListBySecureScoreSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControlsForNameWithExpand_builtin_example.json + */ + /** + * Sample code: Get security controls and their current score for the specified initiative with the expand + * parameter. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiativeWithTheExpandParameter( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScoreControls().listBySecureScore("ascScore", ExpandControlsEnum.DEFINITION, Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControlsForName_builtin_example.json + */ + /** + * Sample code: Get security controls and their current score for the specified initiative. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiative( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScoreControls().listBySecureScore("ascScore", null, Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListSamples.java similarity index 52% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlsListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListSamples.java index 262f583cae531..69b765b9b8bbd 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoreControlsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for SecureScoreControls List. */ public final class SecureScoreControlsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControls_example.json + */ /** * Sample code: List all secure scores controls. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void listAllSecureScoresControls(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.secureScoreControls().list(null, Context.NONE); + public static void listAllSecureScoresControls(com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScoreControls().list(null, Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoresGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresGetSamples.java similarity index 50% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoresGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresGetSamples.java index ce64877674c85..a253c982e80a5 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoresGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresGetSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for SecureScores Get. */ public final class SecureScoresGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/GetSecureScoresSingle_example.json + */ /** * Sample code: Get single secure score. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getSingleSecureScore(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.secureScores().getWithResponse("ascScore", Context.NONE); + public static void getSingleSecureScore(com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScores().getWithResponse("ascScore", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoresListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresListSamples.java similarity index 52% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoresListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresListSamples.java index a8a2cbd57a9aa..1e67c7946beb5 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecureScoresListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresListSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for SecureScores List. */ public final class SecureScoresListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScores_example.json + */ /** * Sample code: List secure scores. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void listSecureScores(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.secureScores().list(Context.NONE); + public static void listSecureScores(com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScores().list(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 new file mode 100644 index 0000000000000..acc3d3136d28c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.security.models.CloudName; +import com.azure.resourcemanager.security.models.CspmMonitorAwsOffering; +import com.azure.resourcemanager.security.models.CspmMonitorAwsOfferingNativeCloudConnection; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SecurityConnectors CreateOrUpdate. */ +public final class SecurityConnectorsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/SecurityConnectors/PutSecurityConnector_example.json + */ + /** + * Sample code: Create or update a security connector. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .securityConnectors() + .define("exampleSecurityConnectorName") + .withRegion("Central US") + .withExistingResourceGroup("exampleResourceGroup") + .withTags(mapOf()) + .withHierarchyIdentifier("exampleHierarchyId") + .withCloudName(CloudName.AWS) + .withOfferings( + Arrays + .asList( + new CspmMonitorAwsOffering() + .withNativeCloudConnection( + new CspmMonitorAwsOfferingNativeCloudConnection() + .withCloudRoleArn("arn:aws:iam::00000000:role/ASCMonitor")))) + .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/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 new file mode 100644 index 0000000000000..6cf5154b4bf74 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for SecurityConnectors Delete. */ +public final class SecurityConnectorsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/SecurityConnectors/DeleteSecurityConnector_example.json + */ + /** + * Sample code: Delete a security connector. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityConnectors().deleteWithResponse("myRg", "mySecurityConnectorName", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..3f28a3d8c5b05 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for SecurityConnectors GetByResourceGroup. */ +public final class SecurityConnectorsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/SecurityConnectors/GetSecurityConnectorResourceGroup_example.json + */ + /** + * Sample code: Retrieve a security connector. + * + * @param manager Entry point to SecurityManager. + */ + public static void retrieveASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .securityConnectors() + .getByResourceGroupWithResponse("exampleResourceGroup", "exampleSecurityConnectorName", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..95dc04823b6bd --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for SecurityConnectors ListByResourceGroup. */ +public final class SecurityConnectorsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/SecurityConnectors/GetSecurityConnectorsResourceGroup_example.json + */ + /** + * Sample code: List all security connectors of a specified resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAllSecurityConnectorsOfASpecifiedResourceGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityConnectors().listByResourceGroup("exampleResourceGroup", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..175c9c989c9ee --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for SecurityConnectors List. */ +public final class SecurityConnectorsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/SecurityConnectors/GetSecurityConnectorsSubscription_example.json + */ + /** + * Sample code: List all security connectors of a specified subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAllSecurityConnectorsOfASpecifiedSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityConnectors().list(Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..9dd026790d1a0 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsUpdateSamples.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.models.CloudName; +import com.azure.resourcemanager.security.models.CspmMonitorAwsOffering; +import com.azure.resourcemanager.security.models.CspmMonitorAwsOfferingNativeCloudConnection; +import com.azure.resourcemanager.security.models.SecurityConnector; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SecurityConnectors Update. */ +public final class SecurityConnectorsUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/SecurityConnectors/PatchSecurityConnector_example.json + */ + /** + * Sample code: Update a security connector. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { + SecurityConnector resource = + manager + .securityConnectors() + .getByResourceGroupWithResponse("exampleResourceGroup", "exampleSecurityConnectorName", Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf()) + .withHierarchyIdentifier("exampleHierarchyId") + .withCloudName(CloudName.AWS) + .withOfferings( + Arrays + .asList( + new CspmMonitorAwsOffering() + .withNativeCloudConnection( + new CspmMonitorAwsOfferingNativeCloudConnection() + .withCloudRoleArn("arn:aws:iam::00000000:role/ASCMonitor")))) + .apply(); + } + + @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/samples/java/com/azure/resourcemanager/security/SecurityContactsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsCreateSamples.java similarity index 57% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsCreateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsCreateSamples.java index 8122f57a22c7c..12c81978c058f 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsCreateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsCreateSamples.java @@ -2,22 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.resourcemanager.security.models.AlertNotifications; import com.azure.resourcemanager.security.models.AlertsToAdmins; /** Samples for SecurityContacts Create. */ public final class SecurityContactsCreateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/CreateSecurityContact_min_example.json + */ /** * Sample code: Create security contact data minimal. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void createSecurityContactDataMinimal( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void createSecurityContactDataMinimal(com.azure.resourcemanager.security.SecurityManager manager) { + manager .securityContacts() .define("default2") .withEmail("chen@contoso.com") @@ -26,15 +27,16 @@ public static void createSecurityContactDataMinimal( .create(); } + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/CreateSecurityContact_full_example.json + */ /** * Sample code: Create security contact data full. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void createSecurityContactDataFull( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void createSecurityContactDataFull(com.azure.resourcemanager.security.SecurityManager manager) { + manager .securityContacts() .define("default1") .withEmail("john@contoso.com") diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsDeleteSamples.java similarity index 50% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsDeleteSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsDeleteSamples.java index 5242484431a4f..5354205010763 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecurityContactsDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsDeleteSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for SecurityContacts Delete. */ public final class SecurityContactsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/DeleteSecurityContact_example.json + */ /** * Sample code: Delete security contact data. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void deleteSecurityContactData(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.securityContacts().deleteWithResponse("default1", Context.NONE); + public static void deleteSecurityContactData(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityContacts().deleteWithResponse("default1", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsGetSamples.java new file mode 100644 index 0000000000000..60d688db8441c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsGetSamples.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.core.util.Context; + +/** Samples for SecurityContacts Get. */ +public final class SecurityContactsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/GetSecurityContact_min_example.json + */ + /** + * Sample code: Get security contact data minimal. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityContactDataMinimal(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityContacts().getWithResponse("default2", Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/GetSecurityContact_full_example.json + */ + /** + * Sample code: Get security contact data full. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityContactDataFull(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityContacts().getWithResponse("default1", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsListSamples.java new file mode 100644 index 0000000000000..d65f760e9ef07 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsListSamples.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.core.util.Context; + +/** Samples for SecurityContacts List. */ +public final class SecurityContactsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/GetSecurityContactsSubscription_min_example.json + */ + /** + * Sample code: Update security contact data minimal. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityContactDataMinimal(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityContacts().list(Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/GetSecurityContactsSubscription_full_example.json + */ + /** + * Sample code: Update security contact data full. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityContactDataFull(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityContacts().list(Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsUpdateSamples.java new file mode 100644 index 0000000000000..a3c7d5764daf5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsUpdateSamples.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.core.util.Context; +import com.azure.resourcemanager.security.models.AlertNotifications; +import com.azure.resourcemanager.security.models.SecurityContact; + +/** Samples for SecurityContacts Update. */ +public final class SecurityContactsUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/UpdateSecurityContact_min_example.json + */ + /** + * Sample code: Update security contact data minimal. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityContactDataMinimal(com.azure.resourcemanager.security.SecurityManager manager) { + SecurityContact resource = manager.securityContacts().getWithResponse("default2", Context.NONE).getValue(); + resource.update().withAlertNotifications(AlertNotifications.ON).apply(); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/UpdateSecurityContact_full_example.json + */ + /** + * Sample code: Update security contact data full. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityContactDataFull(com.azure.resourcemanager.security.SecurityManager manager) { + SecurityContact resource = manager.securityContacts().getWithResponse("john", Context.NONE).getValue(); + resource.update().withPhone("(214)275-4038").withAlertNotifications(AlertNotifications.ON).apply(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetSamples.java new file mode 100644 index 0000000000000..5f533886dc031 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for SecuritySolutions Get. */ +public final class SecuritySolutionsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutions/GetSecuritySolutionsResourceGroupLocation_example.json + */ + /** + * Sample code: Get a security solution from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getASecuritySolutionFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.securitySolutions().getWithResponse("myRg2", "centralus", "paloalto7", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsListSamples.java similarity index 51% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsListSamples.java index 5de8ab0b45af1..8591a99ebc7b7 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsListSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for SecuritySolutions List. */ public final class SecuritySolutionsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutions/GetSecuritySolutionsSubscription_example.json + */ /** * Sample code: Get security solutions. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getSecuritySolutions(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.securitySolutions().list(Context.NONE); + public static void getSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securitySolutions().list(Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListByHomeRegionSamples.java new file mode 100644 index 0000000000000..53299f538ba13 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListByHomeRegionSamples.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; + +import com.azure.core.util.Context; + +/** Samples for SecuritySolutionsReferenceData ListByHomeRegion. */ +public final class SecuritySolutionsReferenceDataListByHomeRegionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutionsReferenceData/GetSecuritySolutionsReferenceDataSubscriptionLocation_example.json + */ + /** + * Sample code: Get security solutions from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecuritySolutionsFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.securitySolutionsReferenceDatas().listByHomeRegionWithResponse("westcentralus", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsReferenceDataListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListSamples.java similarity index 50% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsReferenceDataListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListSamples.java index a4dee50417a65..dfa11f8c404e8 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SecuritySolutionsReferenceDataListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for SecuritySolutionsReferenceData List. */ public final class SecuritySolutionsReferenceDataListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutionsReferenceData/GetSecuritySolutionsReferenceDataSubscription_example.json + */ /** * Sample code: Get security solutions. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getSecuritySolutions(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.securitySolutionsReferenceDatas().listWithResponse(Context.NONE); + public static void getSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securitySolutionsReferenceDatas().listWithResponse(Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java similarity index 70% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java index b16ff165ae2a6..fe3017416bf1a 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java @@ -2,23 +2,25 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for ServerVulnerabilityAssessment CreateOrUpdate. */ public final class ServerVulnerabilityAssessmentCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/CreateServerVulnerabilityAssessments_example.json + */ /** * Sample code: Create a server vulnerability assessments on a resource. Only 'default' resource is supported. Once * creating the resource, the server will be onboarded to vulnerability assessment by Microsoft.Security. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void createAServerVulnerabilityAssessmentsOnAResourceOnlyDefaultResourceIsSupportedOnceCreatingTheResourceTheServerWillBeOnboardedToVulnerabilityAssessmentByMicrosoftSecurity( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .serverVulnerabilityAssessments() .createOrUpdateWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentDeleteSamples.java similarity index 68% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentDeleteSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentDeleteSamples.java index a76d502b5ed6b..056566f775603 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentDeleteSamples.java @@ -2,23 +2,25 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for ServerVulnerabilityAssessment Delete. */ public final class ServerVulnerabilityAssessmentDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/DeleteServerVulnerabilityAssessments_example.json + */ /** * Sample code: Delete a server vulnerability assessments on a resource. Only 'default' resource is supported. Once * deleting, Microsoft.Security will not provide vulnerability assessment findings on the resource. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void deleteAServerVulnerabilityAssessmentsOnAResourceOnlyDefaultResourceIsSupportedOnceDeletingMicrosoftSecurityWillNotProvideVulnerabilityAssessmentFindingsOnTheResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .serverVulnerabilityAssessments() .delete("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentGetSamples.java similarity index 66% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentGetSamples.java index 7e6e17855d726..50daf86f9917b 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentGetSamples.java @@ -2,23 +2,25 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for ServerVulnerabilityAssessment Get. */ public final class ServerVulnerabilityAssessmentGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/GetServerVulnerabilityAssessments_example.json + */ /** * Sample code: Get a server vulnerability assessments onboarding status on a resource. Currently Microsoft.Security * only supports the single 'default' resource. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getAServerVulnerabilityAssessmentsOnboardingStatusOnAResourceCurrentlyMicrosoftSecurityOnlySupportsTheSingleDefaultResource( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .serverVulnerabilityAssessments() .getWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java similarity index 69% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java index 202571e39bef5..cc1f30350ef7e 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java @@ -2,23 +2,25 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for ServerVulnerabilityAssessment ListByExtendedResource. */ public final class ServerVulnerabilityAssessmentListByExtendedResourceSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/ListByExtendedResourceServerVulnerabilityAssessments_example.json + */ /** * Sample code: Get a list of server vulnerability assessments on a resource. Though this API returns a list, * Currently Microsoft.Security only supports a single default type of server vulnerability assessment. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getAListOfServerVulnerabilityAssessmentsOnAResourceThoughThisAPIReturnsAListCurrentlyMicrosoftSecurityOnlySupportsASingleDefaultTypeOfServerVulnerabilityAssessment( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .serverVulnerabilityAssessments() .listByExtendedResourceWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsGetSamples.java similarity index 54% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsGetSamples.java index 4d6cec7b9c8f2..dce92cbfb92f3 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsGetSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.SettingsSettingName; /** Samples for Settings Get. */ public final class SettingsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-07-01/examples/Settings/GetSetting_example.json + */ /** * Sample code: Get a setting on subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getASettingOnSubscription(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.settings().getWithResponse(SettingsSettingName.MCAS, Context.NONE); + public static void getASettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.settings().getWithResponse(SettingsSettingName.MCAS, Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsListSamples.java similarity index 53% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsListSamples.java index b2ee58f03c97d..07a3ee35387d6 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsListSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Settings List. */ public final class SettingsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-07-01/examples/Settings/GetSettings_example.json + */ /** * Sample code: Get settings of subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getSettingsOfSubscription(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.settings().list(Context.NONE); + public static void getSettingsOfSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.settings().list(Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsUpdateSamples.java similarity index 61% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsUpdateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsUpdateSamples.java index d637c330428b2..48e1dab84173e 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SettingsUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsUpdateSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.DataExportSettings; @@ -10,15 +10,16 @@ /** Samples for Settings Update. */ public final class SettingsUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-07-01/examples/Settings/UpdateSetting_example.json + */ /** * Sample code: Update a setting for subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void updateASettingForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void updateASettingForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager .settings() .updateWithResponse(SettingsSettingName.MCAS, new DataExportSettings().withEnabled(true), Context.NONE); } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesGetSamples.java similarity index 66% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesGetSamples.java index 5fa329832916e..e1d6fd5142f36 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesGetSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for SoftwareInventories Get. */ public final class SoftwareInventoriesGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/GetSoftware_example.json + */ /** * Sample code: Gets a single software data of the virtual machine. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getsASingleSoftwareDataOfTheVirtualMachine( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .softwareInventories() .getWithResponse( "EITAN-TESTS", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesListByExtendedResourceSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListByExtendedResourceSamples.java similarity index 61% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesListByExtendedResourceSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListByExtendedResourceSamples.java index 64db12e3120d9..fea25b9e2a46e 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesListByExtendedResourceSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListByExtendedResourceSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for SoftwareInventories ListByExtendedResource. */ public final class SoftwareInventoriesListByExtendedResourceSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/ListByExtendedResourceSoftwareInventories_example.json + */ /** * Sample code: Gets the software inventory of the virtual machine. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getsTheSoftwareInventoryOfTheVirtualMachine( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .softwareInventories() .listByExtendedResource("EITAN-TESTS", "Microsoft.Compute", "virtualMachines", "Eitan-Test1", Context.NONE); } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListSamples.java similarity index 53% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListSamples.java index 5f65508eeca0c..31f4d777c7016 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SoftwareInventoriesListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for SoftwareInventories List. */ public final class SoftwareInventoriesListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/ListBySubscriptionSoftwareInventories_example.json + */ /** * Sample code: Gets the software inventory of all virtual machines in the subscriptions. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getsTheSoftwareInventoryOfAllVirtualMachinesInTheSubscriptions( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.softwareInventories().list(Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.softwareInventories().list(Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java similarity index 75% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java index cd69b7e6cb066..752e4ed3fbc57 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.RulesResultsInput; @@ -12,14 +12,16 @@ /** Samples for SqlVulnerabilityAssessmentBaselineRules Add. */ public final class SqlVulnerabilityAssessmentBaselineRulesAddSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Add.json + */ /** * Sample code: Create a baseline for all rules. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void createABaselineForAllRules(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void createABaselineForAllRules(com.azure.resourcemanager.security.SecurityManager manager) { + manager .sqlVulnerabilityAssessmentBaselineRules() .addWithResponse( "55555555-6666-7777-8888-999999999999", @@ -35,15 +37,17 @@ public static void createABaselineForAllRules(com.azure.resourcemanager.security Context.NONE); } + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_AddLatest.json + */ /** * Sample code: Create a baseline for all rules using the latest scan results. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void createABaselineForAllRulesUsingTheLatestScanResults( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .sqlVulnerabilityAssessmentBaselineRules() .addWithResponse( "55555555-6666-7777-8888-999999999999", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.java similarity index 68% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.java index d941f2e4dd0ed..e33ba7d2f3d80 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import java.util.Arrays; /** Samples for SqlVulnerabilityAssessmentBaselineRules CreateOrUpdate. */ public final class SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_PutLatest.json + */ /** * Sample code: Create a baseline using the latest scan results. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void createABaselineUsingTheLatestScanResults( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .sqlVulnerabilityAssessmentBaselineRules() .define("VA1234") .withExistingResourceId( @@ -27,14 +29,16 @@ public static void createABaselineUsingTheLatestScanResults( .create(); } + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Put.json + */ /** * Sample code: Create a baseline. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void createABaseline(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void createABaseline(com.azure.resourcemanager.security.SecurityManager manager) { + manager .sqlVulnerabilityAssessmentBaselineRules() .define("VA1234") .withExistingResourceId( diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesDeleteSamples.java similarity index 68% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesDeleteSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesDeleteSamples.java index ec5faa465280a..7d3abebdf0e9b 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesDeleteSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for SqlVulnerabilityAssessmentBaselineRules Delete. */ public final class SqlVulnerabilityAssessmentBaselineRulesDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Delete.json + */ /** * Sample code: Delete the baseline. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void deleteTheBaseline(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void deleteTheBaseline(com.azure.resourcemanager.security.SecurityManager manager) { + manager .sqlVulnerabilityAssessmentBaselineRules() .deleteWithResponse( "VA1234", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesGetSamples.java similarity index 68% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesGetSamples.java index a4fff784603fc..f516b62809d80 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesGetSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for SqlVulnerabilityAssessmentBaselineRules Get. */ public final class SqlVulnerabilityAssessmentBaselineRulesGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Get.json + */ /** * Sample code: Get the baseline. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getTheBaseline(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void getTheBaseline(com.azure.resourcemanager.security.SecurityManager manager) { + manager .sqlVulnerabilityAssessmentBaselineRules() .getWithResponse( "VA1234", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesListSamples.java similarity index 67% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesListSamples.java index ad21bbf21e935..55a5b4292c52b 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentBaselineRulesListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesListSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for SqlVulnerabilityAssessmentBaselineRules List. */ public final class SqlVulnerabilityAssessmentBaselineRulesListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_List.json + */ /** * Sample code: List baseline for all rules. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void listBaselineForAllRules(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void listBaselineForAllRules(com.azure.resourcemanager.security.SecurityManager manager) { + manager .sqlVulnerabilityAssessmentBaselineRules() .listWithResponse( "55555555-6666-7777-8888-999999999999", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScanResultsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsGetSamples.java similarity index 63% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScanResultsGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsGetSamples.java index 33b6c2a566441..71cd4c97543fd 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScanResultsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsGetSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for SqlVulnerabilityAssessmentScanResults Get. */ public final class SqlVulnerabilityAssessmentScanResultsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_Get.json + */ /** * Sample code: Get scan details of a scan record. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getScanDetailsOfAScanRecord(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void getScanDetailsOfAScanRecord(com.azure.resourcemanager.security.SecurityManager manager) { + manager .sqlVulnerabilityAssessmentScanResults() .getWithResponse( "Scheduled-20200623", @@ -25,15 +27,16 @@ public static void getScanDetailsOfAScanRecord(com.azure.resourcemanager.securit Context.NONE); } + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_GetLatest.json + */ /** * Sample code: Get scan details of the latest scan record. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getScanDetailsOfTheLatestScanRecord( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void getScanDetailsOfTheLatestScanRecord(com.azure.resourcemanager.security.SecurityManager manager) { + manager .sqlVulnerabilityAssessmentScanResults() .getWithResponse( "latest", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScanResultsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsListSamples.java similarity index 62% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScanResultsListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsListSamples.java index ede5d3ca69bf1..d04ac4c8762a3 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScanResultsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsListSamples.java @@ -2,21 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for SqlVulnerabilityAssessmentScanResults List. */ public final class SqlVulnerabilityAssessmentScanResultsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_ListLatest.json + */ /** * Sample code: List scan results of the latest scan. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void listScanResultsOfTheLatestScan( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void listScanResultsOfTheLatestScan(com.azure.resourcemanager.security.SecurityManager manager) { + manager .sqlVulnerabilityAssessmentScanResults() .listWithResponse( "latest", @@ -25,14 +26,16 @@ public static void listScanResultsOfTheLatestScan( Context.NONE); } + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_List.json + */ /** * Sample code: List scan results. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void listScanResults(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void listScanResults(com.azure.resourcemanager.security.SecurityManager manager) { + manager .sqlVulnerabilityAssessmentScanResults() .listWithResponse( "Scheduled-20200623", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScansGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetSamples.java similarity index 62% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScansGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetSamples.java index 5df8d2e1d2520..d2479c2dba22a 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScansGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for SqlVulnerabilityAssessmentScans Get. */ public final class SqlVulnerabilityAssessmentScansGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_Get.json + */ /** * Sample code: Get scan details of a scan record. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getScanDetailsOfAScanRecord(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void getScanDetailsOfAScanRecord(com.azure.resourcemanager.security.SecurityManager manager) { + manager .sqlVulnerabilityAssessmentScans() .getWithResponse( "Scheduled-20200623", @@ -24,15 +26,16 @@ public static void getScanDetailsOfAScanRecord(com.azure.resourcemanager.securit Context.NONE); } + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_GetLatest.json + */ /** * Sample code: Get scan details of the latest scan record. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getScanDetailsOfTheLatestScanRecord( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void getScanDetailsOfTheLatestScanRecord(com.azure.resourcemanager.security.SecurityManager manager) { + manager .sqlVulnerabilityAssessmentScans() .getWithResponse( "latest", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScansListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansListSamples.java similarity index 68% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScansListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansListSamples.java index 35629aea04426..255cd84d8df02 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SqlVulnerabilityAssessmentScansListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansListSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for SqlVulnerabilityAssessmentScans List. */ public final class SqlVulnerabilityAssessmentScansListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_List.json + */ /** * Sample code: List scan details. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void listScanDetails(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void listScanDetails(com.azure.resourcemanager.security.SecurityManager manager) { + manager .sqlVulnerabilityAssessmentScans() .listWithResponse( "55555555-6666-7777-8888-999999999999", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsGetSamples.java similarity index 68% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsGetSamples.java index f714507b11e14..6862f82270e96 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsGetSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for SubAssessments Get. */ public final class SubAssessmentsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/GetSubAssessment_example.json + */ /** * Sample code: Get security recommendation task from security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getSecurityRecommendationTaskFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .subAssessments() .getWithResponse( "subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/DEMORG/providers/Microsoft.Compute/virtualMachines/vm2", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListAllSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListAllSamples.java new file mode 100644 index 0000000000000..fc9160cd5786c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListAllSamples.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; + +import com.azure.core.util.Context; + +/** Samples for SubAssessments ListAll. */ +public final class SubAssessmentsListAllSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ListSubscriptionSubAssessments_example.json + */ + /** + * Sample code: List security sub-assessments. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecuritySubAssessments(com.azure.resourcemanager.security.SecurityManager manager) { + manager.subAssessments().listAll("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListSamples.java similarity index 64% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListSamples.java index a69467e5ef4f5..8314850e4a11d 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/SubAssessmentsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for SubAssessments List. */ public final class SubAssessmentsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ListSubAssessments_example.json + */ /** * Sample code: List security sub-assessments. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void listSecuritySubAssessments(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + public static void listSecuritySubAssessments(com.azure.resourcemanager.security.SecurityManager manager) { + manager .subAssessments() .list( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksGetResourceGroupLevelTaskSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetResourceGroupLevelTaskSamples.java similarity index 63% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksGetResourceGroupLevelTaskSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetResourceGroupLevelTaskSamples.java index 4928c649965c7..681c605bbbc75 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksGetResourceGroupLevelTaskSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetResourceGroupLevelTaskSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Tasks GetResourceGroupLevelTask. */ public final class TasksGetResourceGroupLevelTaskSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTaskResourceGroupLocation_example.json + */ /** * Sample code: Get security recommendation task in a resource group. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getSecurityRecommendationTaskInAResourceGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .tasks() .getResourceGroupLevelTaskWithResponse( "myRg", "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", Context.NONE); diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksGetSubscriptionLevelTaskSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetSubscriptionLevelTaskSamples.java similarity index 62% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksGetSubscriptionLevelTaskSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetSubscriptionLevelTaskSamples.java index 3bc50fc31eb80..2ff665519cd1a 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksGetSubscriptionLevelTaskSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetSubscriptionLevelTaskSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Tasks GetSubscriptionLevelTask. */ public final class TasksGetSubscriptionLevelTaskSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTaskSubscriptionLocation_example.json + */ /** * Sample code: Get security recommendation task from security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getSecurityRecommendationTaskFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .tasks() .getSubscriptionLevelTaskWithResponse("westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", Context.NONE); } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByHomeRegionSamples.java similarity index 52% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListByHomeRegionSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByHomeRegionSamples.java index 6b4fe6c36456e..2640d12e2c78f 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListByHomeRegionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByHomeRegionSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Tasks ListByHomeRegion. */ public final class TasksListByHomeRegionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksSubscriptionLocation_example.json + */ /** * Sample code: Get security recommendations tasks from security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getSecurityRecommendationsTasksFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.tasks().listByHomeRegion("westeurope", null, Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.tasks().listByHomeRegion("westeurope", null, Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByResourceGroupSamples.java similarity index 51% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListByResourceGroupSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByResourceGroupSamples.java index 7aee116bcf29e..bf564a298da7a 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksListByResourceGroupSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByResourceGroupSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Tasks ListByResourceGroup. */ public final class TasksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksResourceGroupLocation_example.json + */ /** * Sample code: Get security recommendation tasks in a resource group. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getSecurityRecommendationTasksInAResourceGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.tasks().listByResourceGroup("myRg", "westeurope", null, Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.tasks().listByResourceGroup("myRg", "westeurope", null, Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListSamples.java new file mode 100644 index 0000000000000..86ed670d92a06 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Tasks List. */ +public final class TasksListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksSubscription_example.json + */ + /** + * Sample code: Get security recommendations tasks. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityRecommendationsTasks(com.azure.resourcemanager.security.SecurityManager manager) { + manager.tasks().list(null, Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksUpdateResourceGroupLevelTaskStateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateResourceGroupLevelTaskStateSamples.java similarity index 68% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksUpdateResourceGroupLevelTaskStateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateResourceGroupLevelTaskStateSamples.java index 07300cb1ca0ce..f0c62d10b784a 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksUpdateResourceGroupLevelTaskStateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateResourceGroupLevelTaskStateSamples.java @@ -2,22 +2,24 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.TasksTaskUpdateActionType; /** Samples for Tasks UpdateResourceGroupLevelTaskState. */ public final class TasksUpdateResourceGroupLevelTaskStateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/UpdateTaskResourceGroupLocation_example.json + */ /** * Sample code: Change security recommendation task state. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void changeSecurityRecommendationTaskState( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .tasks() .updateResourceGroupLevelTaskStateWithResponse( "myRg", diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksUpdateSubscriptionLevelTaskStateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateSubscriptionLevelTaskStateSamples.java similarity index 66% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksUpdateSubscriptionLevelTaskStateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateSubscriptionLevelTaskStateSamples.java index 6b2bcdbaf26ba..c8204a434cccf 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TasksUpdateSubscriptionLevelTaskStateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateSubscriptionLevelTaskStateSamples.java @@ -2,22 +2,24 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.TasksTaskUpdateActionType; /** Samples for Tasks UpdateSubscriptionLevelTaskState. */ public final class TasksUpdateSubscriptionLevelTaskStateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/UpdateTaskSubscriptionLocation_example.json + */ /** * Sample code: Change security recommendation task state. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void changeSecurityRecommendationTaskState( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .tasks() .updateSubscriptionLevelTaskStateWithResponse( "westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", TasksTaskUpdateActionType.DISMISS, Context.NONE); diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyGetSamples.java new file mode 100644 index 0000000000000..3722e0ab3e1e7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Topology Get. */ +public final class TopologyGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopology_example.json + */ + /** + * Sample code: Get topology. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTopology(com.azure.resourcemanager.security.SecurityManager manager) { + manager.topologies().getWithResponse("myservers", "centralus", "vnets", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListByHomeRegionSamples.java similarity index 52% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyListByHomeRegionSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListByHomeRegionSamples.java index f0e2b21c8786b..470219b343bdf 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyListByHomeRegionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListByHomeRegionSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Topology ListByHomeRegion. */ public final class TopologyListByHomeRegionSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopologySubscriptionLocation_example.json + */ /** * Sample code: Get topology on a subscription from security data location. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void getTopologyOnASubscriptionFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.topologies().listByHomeRegion("centralus", Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.topologies().listByHomeRegion("centralus", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListSamples.java similarity index 52% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyListSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListSamples.java index a9ee3b0016766..e05f1b16277b3 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/TopologyListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for Topology List. */ public final class TopologyListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopologySubscription_example.json + */ /** * Sample code: Get topology on a subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ - public static void getTopologyOnASubscription(com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.topologies().list(Context.NONE); + public static void getTopologyOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.topologies().list(Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsCreateSamples.java similarity index 66% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsCreateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsCreateSamples.java index d115370a96eb6..f0b501ff063a3 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsCreateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsCreateSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; /** Samples for WorkspaceSettings Create. */ public final class WorkspaceSettingsCreateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/CreateWorkspaceSetting_example.json + */ /** * Sample code: Create a workspace setting data for subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void createAWorkspaceSettingDataForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager + com.azure.resourcemanager.security.SecurityManager manager) { + manager .workspaceSettings() .define("default") .withWorkspaceId( diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsDeleteSamples.java similarity index 50% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsDeleteSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsDeleteSamples.java index e3c3c33d96ae3..6e1442fb22c99 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsDeleteSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; /** Samples for WorkspaceSettings Delete. */ public final class WorkspaceSettingsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/DeleteWorkspaceSetting_example.json + */ /** * Sample code: Delete a workspace setting data for resource group. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void deleteAWorkspaceSettingDataForResourceGroup( - com.azure.resourcemanager.security.SecurityManager securityManager) { - securityManager.workspaceSettings().deleteWithResponse("default", Context.NONE); + com.azure.resourcemanager.security.SecurityManager manager) { + manager.workspaceSettings().deleteWithResponse("default", Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetSamples.java new file mode 100644 index 0000000000000..88a6b0efc9b9c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for WorkspaceSettings Get. */ +public final class WorkspaceSettingsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/GetWorkspaceSetting_example.json + */ + /** + * Sample code: Get a workspace setting on subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAWorkspaceSettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.workspaceSettings().getWithResponse("default", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListSamples.java new file mode 100644 index 0000000000000..f6c1549921b52 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for WorkspaceSettings List. */ +public final class WorkspaceSettingsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/GetWorkspaceSettings_example.json + */ + /** + * Sample code: Get workspace settings on subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getWorkspaceSettingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.workspaceSettings().list(Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsUpdateSamples.java similarity index 61% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsUpdateSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsUpdateSamples.java index 6aa8064d0b983..fea537bd70fa8 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/WorkspaceSettingsUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsUpdateSamples.java @@ -2,23 +2,24 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.security; +package com.azure.resourcemanager.security.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.WorkspaceSetting; /** Samples for WorkspaceSettings Update. */ public final class WorkspaceSettingsUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/UpdateWorkspaceSetting_example.json + */ /** * Sample code: Update a workspace setting data for subscription. * - * @param securityManager Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * @param manager Entry point to SecurityManager. */ public static void updateAWorkspaceSettingDataForSubscription( - com.azure.resourcemanager.security.SecurityManager securityManager) { - WorkspaceSetting resource = - securityManager.workspaceSettings().getWithResponse("default", Context.NONE).getValue(); + com.azure.resourcemanager.security.SecurityManager manager) { + WorkspaceSetting resource = manager.workspaceSettings().getWithResponse("default", Context.NONE).getValue(); resource .update() .withWorkspaceId(